本文整理汇总了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);
}