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


PHP Query::getEntityManager方法代码示例

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


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

示例1: close

 public function close()
 {
     if ($this->clearEntitiesOnBatch) {
         $em = $this->query->getEntityManager();
         foreach ($this->clearEntitiesOnBatch as $e) {
             $em->clear($e);
         }
     }
     $this->query = null;
     $this->results = null;
 }
开发者ID:cyantree,项目名称:grout,代码行数:11,代码来源:DoctrineBatchReader.php

示例2: current

 /**
  * {@inheritdoc}
  */
 public function current()
 {
     $current = $this->iterator->current();
     $data = array();
     foreach ($this->propertyPaths as $name => $propertyPath) {
         try {
             $data[$name] = $this->getValue($this->propertyAccessor->getValue($current[0], $propertyPath));
         } catch (UnexpectedTypeException $e) {
             //non existent object in path will be ignored
             $data[$name] = null;
         }
     }
     $this->query->getEntityManager()->getUnitOfWork()->detach($current[0]);
     return $data;
 }
开发者ID:LamaDelRay,项目名称:test_symf,代码行数:18,代码来源:DoctrineORMQuerySourceIterator.php

示例3: __construct

 /**
  * Constructor.
  *
  * Stores various parameters that are otherwise unavailable
  * because Doctrine\ORM\Query\SqlWalker keeps everything private without
  * accessors.
  *
  * @param \Doctrine\ORM\Query              $query
  * @param \Doctrine\ORM\Query\ParserResult $parserResult
  * @param array                            $queryComponents
  */
 public function __construct($query, $parserResult, array $queryComponents)
 {
     $this->platform = $query->getEntityManager()->getConnection()->getDatabasePlatform();
     $this->rsm = $parserResult->getResultSetMapping();
     $this->queryComponents = $queryComponents;
     parent::__construct($query, $parserResult, $queryComponents);
 }
开发者ID:neteasy-work,项目名称:hkgbf_crm,代码行数:18,代码来源:CountOutputWalker.php

示例4: __construct

 /**
  * Constructor.
  *
  * Stores various parameters that are otherwise unavailable
  * because Doctrine\ORM\Query\SqlWalker keeps everything private without
  * accessors.
  *
  * @param \Doctrine\ORM\Query              $query
  * @param \Doctrine\ORM\Query\ParserResult $parserResult
  * @param array                            $queryComponents
  */
 public function __construct($query, $parserResult, array $queryComponents)
 {
     $this->platform = $query->getEntityManager()->getConnection()->getDatabasePlatform();
     $this->rsm = $parserResult->getResultSetMapping();
     $this->queryComponents = $queryComponents;
     // Reset limit and offset
     $this->firstResult = $query->getFirstResult();
     $this->maxResults = $query->getMaxResults();
     $query->setFirstResult(null)->setMaxResults(null);
     parent::__construct($query, $parserResult, $queryComponents);
 }
开发者ID:dracony,项目名称:forked-php-orm-benchmark,代码行数:22,代码来源:LimitSubqueryOutputWalker.php

示例5: __construct

 /**
  * Creates a new query parser object.
  *
  * @param Query $query The Query to parse.
  */
 public function __construct(Query $query)
 {
     $this->query = $query;
     $this->em = $query->getEntityManager();
     $this->lexer = new Lexer($query->getDql());
     $this->parserResult = new ParserResult();
 }
开发者ID:BusinessCookies,项目名称:CoffeeMachineProject,代码行数:12,代码来源:Parser.php

示例6: getEntityFromAlias

 /**
  * Resolve DQL alias into class metadata
  *
  * @param  Doctrine\ORM\Query $query
  * @param  string             $alias
  * @return array              | null
  */
 protected function getEntityFromAlias($query, $alias = null)
 {
     $em = $query->getEntityManager();
     $ast = $query->getAST();
     $fromClause = $ast->fromClause;
     foreach ($fromClause->identificationVariableDeclarations as $root) {
         $className = $root->rangeVariableDeclaration->abstractSchemaName;
         $classAlias = $root->rangeVariableDeclaration->aliasIdentificationVariable;
         if ($classAlias == $alias || null === $alias) {
             return array('alias' => $classAlias, 'metadata' => $em->getClassMetadata($className));
         } else {
             foreach ($root->joins as $join) {
                 $joinAlias = $join->joinAssociationDeclaration->aliasIdentificationVariable;
                 $joinField = $join->joinAssociationDeclaration->joinAssociationPathExpression->associationField;
                 $joinParent = $join->joinAssociationDeclaration->joinAssociationPathExpression->identificationVariable;
                 if ($joinAlias == $alias) {
                     if ($joinParent != $classAlias) {
                         $data = $this->getEntityFromAlias($query, $joinParent);
                         $metadata = $data['metadata'];
                     } else {
                         $metadata = $em->getClassMetadata($className);
                     }
                     $joinName = $metadata->associationMappings[$joinField]['targetEntity'];
                     return array('alias' => $joinAlias, 'metadata' => $em->getClassMetadata($joinName));
                 }
             }
         }
     }
     return null;
 }
开发者ID:tchern0,项目名称:LabDB,代码行数:37,代码来源:AclFilter.php

示例7: where

 /**
  * Add conditions to query.
  *
  * @access    public
  * @param    mixed $mPredicates The restriction predicates.
  * @return    DB
  * @since     1.0.0-alpha
  * @version   1.0.0-alpha
  */
 public function where($mPredicates)
 {
     $this->oQuery->getEntityManager()->createQueryBuilder()->where($mPredicates);
     return $this;
 }
开发者ID:ktrzos,项目名称:plethora,代码行数:14,代码来源:DB.php

示例8: __construct

 /**
  * Creates a new query parser object.
  *
  * @param Query $query The Query to parse.
  */
 public function __construct(Query $query)
 {
     $this->_query = $query;
     $this->_em = $query->getEntityManager();
     $this->_lexer = new Lexer($query->getDql());
     $this->_parserResult = new ParserResult();
     //$this->_parserResult->setEntityManager($this->_em);
 }
开发者ID:jackbravo,项目名称:doctrine,代码行数:13,代码来源:Parser.php

示例9: __construct

 /**
  * Constructor.
  *
  * @param DqlQuery                 $query           Doctrine ORM Query object
  * @param SearchConditionInterface $searchCondition SearchCondition object
  *
  * @throws BadMethodCallException When SearchCondition contains errors
  */
 public function __construct(DqlQuery $query, SearchConditionInterface $searchCondition)
 {
     parent::__construct($searchCondition, $query->getEntityManager());
     $this->query = $query;
 }
开发者ID:rollerworks,项目名称:search-doctrine-orm,代码行数:13,代码来源:WhereBuilder.php


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