本文整理汇总了PHP中Doctrine\ORM\EntityManager::getPartialReference方法的典型用法代码示例。如果您正苦于以下问题:PHP EntityManager::getPartialReference方法的具体用法?PHP EntityManager::getPartialReference怎么用?PHP EntityManager::getPartialReference使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Doctrine\ORM\EntityManager
的用法示例。
在下文中一共展示了EntityManager::getPartialReference方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
function it_should_delete_entity(ManagerRegistry $registry, EntityManager $em)
{
$em->getPartialReference('foo', 1)->willReturn(42);
$em->remove(42)->shouldBeCalled();
$em->flush()->shouldBeCalled();
$registry->getManager(null)->willReturn($em);
$this->setRegistry($registry);
$this->delete(1)->shouldBe(true);
}
示例2: delete
/**
* Delete an Entity according to given (list of) id(s)
* @param type $ids array/single
* @return boolean
*/
function delete($ids)
{
try {
if (!is_array($ids)) {
$ids = array($ids);
}
foreach ($ids as $id) {
$entity = $this->em->getPartialReference($this->entity, $id);
$this->em->remove($entity);
}
$this->em->flush();
return TRUE;
} catch (Exception $err) {
log_message("error", $err->getMessage(), false);
return FALSE;
}
}
示例3: getPartialReference
/**
* {@inheritdoc}
*/
public function getPartialReference($entityName, $identifier)
{
return $this->wrapped->getPartialReference($entityName, $identifier);
}
示例4: getPartialReference
/**
* {@inheritDoc}
*
* @static
*/
public static function getPartialReference($entityName, $identifier)
{
return \Doctrine\ORM\EntityManager::getPartialReference($entityName, $identifier);
}
示例5: _fillSessionInformation
/**
* @param \Sgdoce\Model\Entity\ArtefatoImagem $artefatoImagemEntity
* @param \Doctrine\ORM\EntityManager $entityManager
* @return void
*/
private function _fillSessionInformation(ArtefatoImagemEntity $artefatoImagemEntity, EntityManager $entityManager)
{
$pessoaEntity = $entityManager->getPartialReference('app:VwPessoa', \Core_Integration_Sica_User::getPersonId());
$unidadeOrgEntity = $entityManager->getPartialReference('app:VwUnidadeOrg', \Core_Integration_Sica_User::getUserUnit());
$artefatoImagemEntity->setSqPessoa($pessoaEntity);
$artefatoImagemEntity->setSqUnidadeOrg($unidadeOrgEntity);
}