当前位置: 首页>>代码示例>>PHP>>正文


PHP EntityManagerInterface::newHydrator方法代码示例

本文整理汇总了PHP中Doctrine\ORM\EntityManagerInterface::newHydrator方法的典型用法代码示例。如果您正苦于以下问题:PHP EntityManagerInterface::newHydrator方法的具体用法?PHP EntityManagerInterface::newHydrator怎么用?PHP EntityManagerInterface::newHydrator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Doctrine\ORM\EntityManagerInterface的用法示例。


在下文中一共展示了EntityManagerInterface::newHydrator方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: iterate

 /**
  * Executes the query and returns an IterableResult that can be used to incrementally
  * iterate over the result.
  *
  * @param ArrayCollection|array|null $parameters    The query parameters.
  * @param integer|null               $hydrationMode The hydration mode to use.
  *
  * @return \Doctrine\ORM\Internal\Hydration\IterableResult
  */
 public function iterate($parameters = null, $hydrationMode = null)
 {
     if ($hydrationMode !== null) {
         $this->setHydrationMode($hydrationMode);
     }
     if (!empty($parameters)) {
         $this->setParameters($parameters);
     }
     $rsm = $this->getResultSetMapping();
     $stmt = $this->_doExecute();
     return $this->_em->newHydrator($this->_hydrationMode)->iterate($stmt, $rsm, $this->_hints);
 }
开发者ID:BozzaCoon,项目名称:SPHERE-Framework,代码行数:21,代码来源:AbstractQuery.php

示例2: executeIgnoreQueryCache

 /**
  * Execute query ignoring second level cache.
  *
  * @param ArrayCollection|array|null $parameters
  * @param integer|null               $hydrationMode
  *
  * @return mixed
  */
 private function executeIgnoreQueryCache($parameters = null, $hydrationMode = null)
 {
     if ($hydrationMode !== null) {
         $this->setHydrationMode($hydrationMode);
     }
     if (!empty($parameters)) {
         $this->setParameters($parameters);
     }
     $setCacheEntry = function () {
     };
     if ($this->_hydrationCacheProfile !== null) {
         list($cacheKey, $realCacheKey) = $this->getHydrationCacheId();
         $queryCacheProfile = $this->getHydrationCacheProfile();
         $cache = $queryCacheProfile->getResultCacheDriver();
         $result = $cache->fetch($cacheKey);
         if (isset($result[$realCacheKey])) {
             return $result[$realCacheKey];
         }
         if (!$result) {
             $result = array();
         }
         $setCacheEntry = function ($data) use($cache, $result, $cacheKey, $realCacheKey, $queryCacheProfile) {
             $result[$realCacheKey] = $data;
             $cache->save($cacheKey, $result, $queryCacheProfile->getLifetime());
         };
     }
     $stmt = $this->_doExecute();
     if (is_numeric($stmt)) {
         $setCacheEntry($stmt);
         return $stmt;
     }
     $rsm = $this->getResultSetMapping();
     $data = $this->_em->newHydrator($this->_hydrationMode)->hydrateAll($stmt, $rsm, $this->_hints);
     $setCacheEntry($data);
     return $data;
 }
开发者ID:AlexanderForks,项目名称:doctrine2,代码行数:44,代码来源:AbstractQuery.php

示例3: loadCollectionFromStatement

 /**
  * Hydrates a collection from a given DBAL statement.
  *
  * @param array                    $assoc
  * @param \Doctrine\DBAL\Statement $stmt
  * @param PersistentCollection     $coll
  *
  * @return array
  */
 private function loadCollectionFromStatement($assoc, $stmt, $coll)
 {
     $rsm = $this->currentPersisterContext->rsm;
     $hints = array(UnitOfWork::HINT_DEFEREAGERLOAD => true, 'collection' => $coll);
     if (isset($assoc['indexBy'])) {
         $rsm = clone $this->currentPersisterContext->rsm;
         // this is necessary because the "default rsm" should be changed.
         $rsm->addIndexBy('r', $assoc['indexBy']);
     }
     return $this->em->newHydrator(Query::HYDRATE_OBJECT)->hydrateAll($stmt, $rsm, $hints);
 }
开发者ID:BusinessCookies,项目名称:CoffeeMachineProject,代码行数:20,代码来源:BasicEntityPersister.php

示例4: newHydrator

 /**
  * {@inheritdoc}
  */
 public function newHydrator($hydrationMode)
 {
     return $this->wrapped->newHydrator($hydrationMode);
 }
开发者ID:Dren-x,项目名称:mobitnew,代码行数:7,代码来源:EntityManagerDecorator.php

示例5: __construct

 /**
  * Initializes a new instance of a class derived from <tt>AbstractHydrator</tt>.
  *
  * @param EntityManagerInterface $em The EntityManager to use.
  */
 public function __construct(EntityManagerInterface $em)
 {
     $this->em = $em;
     $this->wrapped = $em->newHydrator($this->type);
 }
开发者ID:carnage,项目名称:watson,代码行数:10,代码来源:BaseHydrator.php


注:本文中的Doctrine\ORM\EntityManagerInterface::newHydrator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。