本文整理汇总了PHP中EntityManager::find方法的典型用法代码示例。如果您正苦于以下问题:PHP EntityManager::find方法的具体用法?PHP EntityManager::find怎么用?PHP EntityManager::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EntityManager
的用法示例。
在下文中一共展示了EntityManager::find方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load
public function load()
{
if ($this->loaded) {
return true;
}
$this->proxy = $this->em->find($this->entity, $this->reference);
$this->loaded = true;
$this->em = null;
}
示例2: findOneById
public function findOneById($area_id)
{
try {
$area = $this->em->find(Area_tematica_dao::REPOSITORY, $area_id);
return $area;
} catch (Exception $ex) {
$this->CI->log->write_log('error', $ex->getMessage() . ' - area_tematica_dao::findOneById ');
}
}
示例3: setFromStdClass
/**
* @param stdClass $stdClass
* @param EntityManager $manager
*
* @return $this
*/
public function setFromStdClass($stdClass, $manager)
{
$this->id = $stdClass->id;
$this->name = $stdClass->title;
$this->city = $manager->find('NetworkStoreBundle:City', $stdClass->city_id);
return $this;
}
示例4: testReverseTransformRemoveMissingFromCollection
public function testReverseTransformRemoveMissingFromCollection()
{
$transformer = $this->createTransformer();
$tags = $this->createTagCollection();
$newCol = $transformer->reverseTransform(array(1), $tags);
$this->assertEquals(1, count($newCol));
$this->assertFalse($newCol->contains($this->em->find('Symfony\\Bundle\\DoctrineBundle\\Tests\\Form\\ValueTransformer\\Tag', 2)));
}