public function remove($entity)
    {
        $idAccessorRegistry = $this->unitOfWork->getEntityRegistry()->getIdAccessorRegistry();
        $entityId           = $idAccessorRegistry->getEntityId($entity);

        $this->updateMap();

        if (!in_array($entityId, $this->map)) {
            throw new EntityNotFoundException;
        }

        $colJoinName = $this->relation->colJoinName();
        $mapObject   = $this->mapRepository->findOne()->with($colJoinName, Operator::EQUAL, $entityId)->getItem();
        $this->mapRepository->remove($mapObject);
        $this->map = array_diff($this->map, [$entityId]);
    }
public function remove($entity)
    {
        $idAccessorRegistry = $this->unitOfWork->getEntityRegistry()->getIdAccessorRegistry();
        $entityId           = $idAccessorRegistry->getEntityId($entity);

        $this->updateMap();

        if (!in_array($entityId, $this->map)) {
            throw new EntityNotFoundException;
        }

        $colJoinName = $this->relation->colJoinName();
        $mapObject   = $this->mapRepository->findOne()->with($colJoinName, Operator::EQUAL, $entityId)->getItem();
        $this->mapRepository->remove($mapObject);
        $this->map = array_diff($this->map, [$entityId]);
    }
public function remove ( $ entity ) { $ idAccessorRegistry = $ this -> unitOfWork -> getEntityRegistry ( ) -> getIdAccessorRegistry ( ) ; $ entityId = $ idAccessorRegistry -> getEntityId ( $ entity ) ; $ this -> updateMap ( ) ; if ( ! in_array ( $ entityId , $ this -> map ) ) { throw new EntityNotFoundException ; } $ colJoinName = $ this -> relation -> colJoinName ( ) ; $ mapObject = $ this -> mapRepository -> findOne ( ) -> with ( $ colJoinName , Operator :: EQUAL , $ entityId ) -> getItem ( ) ; $ this -> mapRepository -> remove ( $ mapObject ) ; $ this -> map = array_diff ( $ this -> map , [ $ entityId ] ) ; }
Deletes an entity from the repo

@param   object $entity The entity to delete

@return  void

@throws  OrmException  if the entity could not be deleted
Deletes an entity from the repo