Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.72 KB | None | 0 0
  1.     /**
  2.      * @param int $groupId
  3.      * @param int $entityId
  4.      */
  5.     public function dropReferenceDataByGroupAndEntityId($groupId, $entityId) {
  6.  
  7.         $rsm = new ResultSetMappingBuilder($this->getEntityManager());
  8.         $rsm->addRootEntityFromClassMetadata('AppBundle:ReferenceData', 'rd');
  9.  
  10.         $this
  11.             ->getEntityManager()
  12.             ->createNativeQuery(
  13.                 ' DELETE FROM ' . $this->getMappingTableName() .
  14.                 ' WHERE '.
  15.                   ' group_id = :groupId AND ' .
  16.                   $this->getEntityIdColumnName() .' = :entityId ', $rsm)
  17.             ->setParameter('groupId', $groupId)
  18.             ->setParameter('entityId', $entityId)
  19.             ->execute();
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement