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


PHP ProxyQueryInterface::getRootAlias方法代碼示例

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


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

示例1: association

 protected function association(ProxyQueryInterface $queryBuilder, $data)
 {
     $types = array(ClassMetadataInfo::ONE_TO_ONE, ClassMetadataInfo::ONE_TO_MANY, ClassMetadataInfo::MANY_TO_MANY, ClassMetadataInfo::MANY_TO_ONE);
     if (!in_array($this->getOption('mapping_type'), $types)) {
         throw new \RunTimeException('Invalid mapping type');
     }
     if (!$this->getOption('field_name')) {
         throw new \RunTimeException('please provide a field_name options');
     }
     if (!$this->getOption('callback')) {
         $alias = 's_' . $this->getName();
         $queryBuilder->leftJoin(sprintf('%s.%s', $queryBuilder->getRootAlias(), $this->getFieldName()), $alias);
         return array($alias, 'id');
     } else {
         return array($this->getOption('alias', $queryBuilder->getRootAlias()), false);
     }
 }
開發者ID:nucleartux,項目名稱:ShtumiUsefulBundle1,代碼行數:17,代碼來源:AjaxAutocompleteFilter.php

示例2: association

 protected function association(ProxyQueryInterface $queryBuilder, $data)
 {
     $types = array(ClassMetadataInfo::ONE_TO_ONE, ClassMetadataInfo::ONE_TO_MANY, ClassMetadataInfo::MANY_TO_MANY, ClassMetadataInfo::MANY_TO_ONE);
     if (!in_array($this->getOption('mapping_type'), $types)) {
         throw new \RunTimeException('Invalid mapping type');
     }
     if (!$this->getOption('field_name')) {
         throw new \RunTimeException('please provide a field_name options');
     }
     return array($this->getOption('alias', $queryBuilder->getRootAlias()), false);
 }
開發者ID:hisie,項目名稱:UsefulBundle,代碼行數:11,代碼來源:DateRangeFilter.php

示例3: batchDelete

 /**
  * {@inheritdoc}
  */
 public function batchDelete($class, ProxyQueryInterface $queryProxy)
 {
     $queryProxy->select('DISTINCT ' . $queryProxy->getRootAlias());
     try {
         $entityManager = $this->getEntityManager($class);
         $i = 0;
         foreach ($queryProxy->getQuery()->iterate() as $pos => $object) {
             $entityManager->remove($object[0]);
             if (++$i % 20 == 0) {
                 $entityManager->flush();
                 $entityManager->clear();
             }
         }
         $entityManager->flush();
         $entityManager->clear();
     } catch (\PDOException $e) {
         throw new ModelManagerException('', 0, $e);
     } catch (DBALException $e) {
         throw new ModelManagerException('', 0, $e);
     }
 }
開發者ID:LamaDelRay,項目名稱:test_symf,代碼行數:24,代碼來源:ModelManager.php

示例4: association

 /**
  * {@inheritdoc}
  */
 protected function association(ProxyQueryInterface $queryBuilder, $data)
 {
     return array($this->getOption('alias', $queryBuilder->getRootAlias()), false);
 }
開發者ID:LamaDelRay,項目名稱:test_symf,代碼行數:7,代碼來源:CallbackFilter.php


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