當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。