本文整理匯總了PHP中Sonata\AdminBundle\Admin\AdminInterface::getList方法的典型用法代碼示例。如果您正苦於以下問題:PHP AdminInterface::getList方法的具體用法?PHP AdminInterface::getList怎麽用?PHP AdminInterface::getList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Sonata\AdminBundle\Admin\AdminInterface
的用法示例。
在下文中一共展示了AdminInterface::getList方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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);
}
示例2: 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);
}
示例3: 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);
}
示例4: getBaseDatagrid
/**
* @param \Sonata\AdminBundle\Admin\AdminInterface $admin
* @param array $values
* @return \Sonata\AdminBundle\Datagrid\DatagridInterface
*/
public function getBaseDatagrid(AdminInterface $admin, array $values = array())
{
$queryBuilder = $admin->getModelManager()->createQuery($admin->getClass());
$query = new ProxyQuery($queryBuilder);
$pager = new Pager;
$pager->setCountColumn($admin->getModelManager()->getIdentifierFieldNames($admin->getClass()));
return new Datagrid(
$query,
$admin->getList(),
$pager,
$this->formFactory,
$values
);
}
示例5: getBaseDatagrid
/**
* @param \Sonata\AdminBundle\Admin\AdminInterface $admin
* @param array $values
* @return \Sonata\AdminBundle\Datagrid\DatagridInterface
*/
public function getBaseDatagrid(AdminInterface $admin, array $values = array())
{
$queryBuilder = $admin->getModelManager()->getDocumentManager()->createQueryBuilder();
$qomFactory = $queryBuilder->getQOMFactory();
$query = new ProxyQuery($qomFactory, $queryBuilder);
$query->setDocumentName($admin->getClass());
$query->setDocumentManager($admin->getModelManager()->getDocumentManager());
$pager = new Pager();
$formBuilder = $this->formFactory->createNamedBuilder('form', 'filter', array(), array('csrf_protection' => false));
return new Datagrid($query, $admin->getList(), $pager, $formBuilder, $values);
}
示例6: getBaseDatagrid
/**
* @param \Sonata\AdminBundle\Admin\AdminInterface $admin
* @param array $values
* @return \Sonata\AdminBundle\Datagrid\DatagridInterface
*/
public function getBaseDatagrid(AdminInterface $admin, array $values = array())
{
$queryBuilder = $admin->getModelManager()->createQuery($admin->getClass());
$query = new ProxyQuery($queryBuilder);
return new Datagrid($query, $admin->getList(), new Pager(), $this->formFactory, $values);
}