public function delete ($Model)
    {
        $entity   = $Model->getEntity();
        $entityId = $entity->getId();

        // Clear cache first
        if (isset($this->cache[$entityId])) {
            unset($this->cache[$entityId]);
        }

        $this->em->remove($entity);
        $this->em->flush();
    }
public function delete ($Model)
    {
        $entity   = $Model->getEntity();
        $entityId = $entity->getId();

        // Clear cache first
        if (isset($this->cache[$entityId])) {
            unset($this->cache[$entityId]);
        }

        $this->em->remove($entity);
        $this->em->flush();
    }
public function delete ( $ Model ) { $ entity = $ Model -> getEntity ( ) ; $ entityId = $ entity -> getId ( ) ; // Clear cache first if ( isset ( $ this -> cache [ $ entityId ] ) ) { unset ( $ this -> cache [ $ entityId ] ) ; } $ this -> em -> remove ( $ entity ) ; $ this -> em -> flush ( ) ; }
Delete given model instance, handle cache invalidation too

@param    Model\*
@return   void
Delete given model instance handle cache invalidation too