当前位置: 首页>>代码示例>>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;未经允许,请勿转载。