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


PHP AdminInterface::createQuery方法代碼示例

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


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

示例1: getBaseDatagrid

 /**
  * @param \Sonata\AdminBundle\Admin\AdminInterface $admin
  * @param array $values
  * @return \Sonata\AdminBundle\Datagrid\DatagridInterface
  */
 public function getBaseDatagrid(AdminInterface $admin, array $values = array())
 {
     $pager = new Pager();
     $pager->setCountColumn($admin->getModelManager()->getIdentifierFieldNames($admin->getClass()));
     $formBuilder = $this->formFactory->createNamedBuilder('form', 'filter', array(), array('csrf_protection' => false));
     return new Datagrid($admin->createQuery(), $admin->getList(), $pager, $formBuilder, $values);
 }
開發者ID:hunter1271,項目名稱:IphpTreeBundle,代碼行數:12,代碼來源:DatagridBuilder.php

示例2: getBaseDatagrid

 /**
  * {@inheritdoc}
  */
 public function getBaseDatagrid(AdminInterface $admin, array $values = array())
 {
     $pager = new Pager();
     $defaultOptions = array();
     $defaultOptions['csrf_protection'] = false;
     $formBuilder = $this->formFactory->createNamedBuilder('filter', 'form', array(), $defaultOptions);
     $proxyQuery = $admin->createQuery();
     // if the default modelmanager query builder is used, we need to replace it with elastica
     // if not, that means $admin->createQuery has been overriden by the user and already returns an ElasticaProxyQuery object
     if (!$proxyQuery instanceof ElasticaProxyQuery) {
         if ($this->isSmart($admin, $values)) {
             $proxyQuery = new ElasticaProxyQuery($this->finderProvider->getFinderByAdmin($admin));
         }
     }
     return new Datagrid($proxyQuery, $admin->getList(), $pager, $formBuilder, $values);
 }
開發者ID:Kertudex,項目名稱:SonataAdminSearchBundle,代碼行數:19,代碼來源:ElasticaDatagridBuilder.php

示例3: getBaseDatagrid

 /**
  * {@inheritdoc}
  */
 public function getBaseDatagrid(AdminInterface $admin, array $values = array())
 {
     $pager = $this->getPager($admin->getPagerType());
     $pager->setCountColumn($admin->getModelManager()->getIdentifierFieldNames($admin->getClass()));
     $defaultOptions = array();
     if ($this->csrfTokenEnabled) {
         $defaultOptions['csrf_protection'] = false;
     }
     $formBuilder = $this->formFactory->createNamedBuilder('filter', 'form', array(), $defaultOptions);
     return new Datagrid($admin->createQuery(), $admin->getList(), $pager, $formBuilder, $values);
 }
開發者ID:jayesbe,項目名稱:SonataDoctrineORMAdminBundle,代碼行數:14,代碼來源:DatagridBuilder.php

示例4: getBaseDatagrid

 /**
  * {@inheritdoc}
  */
 public function getBaseDatagrid(AdminInterface $admin, array $values = array())
 {
     $defaultOptions = array();
     if ($this->csrfTokenEnabled) {
         $defaultOptions['csrf_protection'] = false;
     }
     $formBuilder = $this->formFactory->createNamedBuilder('filter', 'form', array(), $defaultOptions);
     return new Datagrid($admin->createQuery(), $admin->getList(), $this->getPager(), $formBuilder, $values);
 }
開發者ID:jmontoyaa,項目名稱:SonataDoctrinePhpcrAdminBundle,代碼行數:12,代碼來源:DatagridBuilder.php


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