當前位置: 首頁>>代碼示例>>PHP>>正文


PHP EntityRepository::getClassMetadata方法代碼示例

本文整理匯總了PHP中Doctrine\ORM\EntityRepository::getClassMetadata方法的典型用法代碼示例。如果您正苦於以下問題:PHP EntityRepository::getClassMetadata方法的具體用法?PHP EntityRepository::getClassMetadata怎麽用?PHP EntityRepository::getClassMetadata使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Doctrine\ORM\EntityRepository的用法示例。


在下文中一共展示了EntityRepository::getClassMetadata方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: populateEntity

 /**
  * Populate the EntityRepository $repo with $count entities.
  *
  * @see \Population\Populator::populate
  *
  * @access public
  * @param EntityRepository $repo
  * @param int $count
  * @param array $options
  * @param callable $callback Function which populates the data for each instance. It is passed a single argument,
  *     the entity to be populated. If $callback returns false, the entity will not be persisted.
  * @param array $options (default: array())
  *     perFlush:        Limit the number of insertions performed in a single flush (default: 100)
  *     clearAfterFlush: Clear the EntityManager after each flush (default:true)
  *     factory:         Optionally, specify a factory callback for populated objects
  *     constructorArgs: An array of args, passed directly to the document's constructor (default: null)
  * @return void
  */
 public function populateEntity(EntityRepository $repo, $count, $callback, array $options = array())
 {
     $em = $repo->getEntityManager();
     if (isset($options['factory'])) {
         $factory = $options['factory'];
     } else {
         $reflClass = $repo->getClassMetadata()->reflClass;
         $factory = array($reflClass, 'newInstanceArgs');
     }
     $this->populateObject($em, $factory, $count, $callback, $options);
 }
開發者ID:bobthecow,項目名稱:population,代碼行數:29,代碼來源:Populator.php

示例2: getClassMetadata

 public function getClassMetadata()
 {
     return parent::getClassMetadata();
 }
開發者ID:raivieira,項目名稱:base-api-php,代碼行數:4,代碼來源:BaseRepository.php


注:本文中的Doctrine\ORM\EntityRepository::getClassMetadata方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。