当前位置: 首页>>代码示例>>PHP>>正文


PHP DatagridMapper::add方法代码示例

本文整理汇总了PHP中Sonata\AdminBundle\Datagrid\DatagridMapper::add方法的典型用法代码示例。如果您正苦于以下问题:PHP DatagridMapper::add方法的具体用法?PHP DatagridMapper::add怎么用?PHP DatagridMapper::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sonata\AdminBundle\Datagrid\DatagridMapper的用法示例。


在下文中一共展示了DatagridMapper::add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: configureDatagridFilters

 protected function configureDatagridFilters(DatagridMapper $datagridMapper)
 {
     $datagridMapper->add('id', null, array('label' => 'order_id'));
     if (!$this->isChild()) {
         $datagridMapper->add('partner', null, array('label' => 'customer'));
     }
 }
开发者ID:Nexotap,项目名称:Ivory,代码行数:7,代码来源:SaleOrderAdmin.php

示例2: configureDatagridFilters

 /**
  * {@inheritdoc}
  */
 protected function configureDatagridFilters(DatagridMapper $filter)
 {
     $filter->add('current')->add('type', null, array(), 'sonata_customer_address_types', array('translation_domain' => 'SonataCustomerBundle'));
     if (!$this->isChild()) {
         $filter->add('customer');
     }
 }
开发者ID:saberyounis,项目名称:Sonata-Project,代码行数:10,代码来源:AddressAdmin.php

示例3: configureDatagridFilters

 /**
  * {@inheritdoc}
  */
 protected function configureDatagridFilters(DatagridMapper $datagridMapper, $context = '')
 {
     $datagridMapper->add('name', 'networking_init_cms_simple_string')->add('enabled', null, array('hidden' => true));
     if ($context) {
         $datagridMapper->add('context', null, array('hidden' => true));
     }
 }
开发者ID:lzdv,项目名称:init-cms-bundle,代码行数:10,代码来源:GalleryAdmin.php

示例4: configureDatagridFilters

 /**
  * {@inheritdoc}
  */
 protected function configureDatagridFilters(DatagridMapper $datagridMapper)
 {
     $datagridMapper->add('id');
     if (interface_exists('Sonata\\ClassificationBundle\\Model\\CategoryInterface')) {
         $datagridMapper->add('category');
     }
     $datagridMapper->add('permalink')->add('isCommentable');
 }
开发者ID:saberyounis,项目名称:Sonata-Project,代码行数:11,代码来源:ThreadAdmin.php

示例5: configureDatagridFilters

 protected function configureDatagridFilters(DatagridMapper $datagridMapper)
 {
     $datagridMapper->add('title');
     $datagridMapper->add('slug');
     $datagridMapper->add('createdAt');
     $datagridMapper->add('updatedAt');
     $datagridMapper->add('news');
 }
开发者ID:svintuskbd,项目名称:symfony,代码行数:8,代码来源:CategoryAdmin.php

示例6: configureDatagridFilters

 protected function configureDatagridFilters(DatagridMapper $filter)
 {
     $filter->add('name');
     $filter->add('firstName');
     $filter->add('numEtudiant');
     $filter->add('annee');
     $filter->add('departement');
 }
开发者ID:PhilippeGeek,项目名称:adhesion,代码行数:8,代码来源:EtudiantAdmin.php

示例7: configureDatagridFilters

 /**
  * @param \Sonata\AdminBundle\Datagrid\DatagridMapper $datagridMapper
  * @return void
  */
 protected function configureDatagridFilters(DatagridMapper $datagridMapper)
 {
     $datagridMapper->add('name')->add('providerReference')->add('enabled')->add('context');
     $providers = array();
     foreach ($this->pool->getProviderNamesByContext('default') as $name) {
         $providers[$name] = $name;
     }
     $datagridMapper->add('providerName', 'doctrine_orm_choice', array('field_options' => array('choices' => $providers, 'required' => false, 'multiple' => false, 'expanded' => false), 'field_type' => 'choice'));
 }
开发者ID:helmer,项目名称:SonataMediaBundle,代码行数:13,代码来源:MediaAdmin.php

示例8: configureDatagridFilters

 /**
  * @param \Sonata\AdminBundle\Datagrid\DatagridMapper $datagridMapper
  */
 protected function configureDatagridFilters(DatagridMapper $datagridMapper)
 {
     $datagridMapper->add('name')->add('title')->add('subtitle')->add('location')->add('keywords')->add('providerReference')->add('enabled')->add('context');
     $providers = array();
     $providerNames = (array) $this->pool->getProviderNamesByContext($this->getPersistentParameter('context', $this->pool->getDefaultContext()));
     foreach ($providerNames as $name) {
         $providers[$name] = $name;
     }
     $datagridMapper->add('providerName', 'doctrine_orm_choice', array('field_options' => array('choices' => $providers, 'required' => false, 'multiple' => false, 'expanded' => false), 'field_type' => 'choice'));
 }
开发者ID:estebannovo,项目名称:multimedia,代码行数:13,代码来源:MediaAdmin.php

示例9: configureDatagridFilters

 protected function configureDatagridFilters(DatagridMapper $datagridMapper)
 {
     $datagridMapper->add('firstname', null, array('label' => 'First name'))->add('lastname', null, array('label' => 'Last name'))->add('year', 'doctrine_orm_choice', array('label' => 'Year'), 'choice', array('choices' => self::getYearChoices()));
     if ($this->isGranted('EDIT')) {
         $datagridMapper->add('payment', 'doctrine_orm_choice', array('label' => 'Payment type'), 'choice', array('choices' => self::getPaymentChoices()));
     }
     $datagridMapper->add('deposit', null, array('label' => 'Deposit'));
     if ($this->isGranted('EDIT')) {
         $datagridMapper->add('mailing', null, array('label' => 'Mailing list'));
     }
 }
开发者ID:HenryTelecom,项目名称:wwwroot,代码行数:11,代码来源:MemberAdmin.php

示例10: configureDatagridFilters

 /**
  * {@inheritdoc}
  */
 protected function configureDatagridFilters(DatagridMapper $datagridMapper)
 {
     $options = array('choices' => array());
     foreach ($this->pool->getContexts() as $name => $context) {
         $options['choices'][$name] = $name;
     }
     $datagridMapper->add('name')->add('providerReference')->add('enabled')->add('context', null, array('show_filter' => $this->getPersistentParameter('hide_context') !== true), 'choice', $options)->add('category', null, array('show_filter' => false))->add('width')->add('height')->add('contentType');
     $providers = array();
     $providerNames = (array) $this->pool->getProviderNamesByContext($this->getPersistentParameter('context', $this->pool->getDefaultContext()));
     foreach ($providerNames as $name) {
         $providers[$name] = $name;
     }
     $datagridMapper->add('providerName', 'doctrine_orm_choice', array('field_options' => array('choices' => $providers, 'required' => false, 'multiple' => false, 'expanded' => false), 'field_type' => 'choice'));
 }
开发者ID:nicolasricci,项目名称:SonataMediaBundle,代码行数:17,代码来源:MediaAdmin.php

示例11: configureDatagridFilters

 /**
  * @param \Sonata\AdminBundle\Datagrid\DatagridMapper $datagridMapper
  *
  * @return void
  */
 protected function configureDatagridFilters(DatagridMapper $datagridMapper)
 {
     $container = $this->getConfigurationPool()->getContainer();
     $entityManager = $container->get('doctrine.orm.default_entity_manager');
     $datagridMapper->add('locale', 'doctrine_orm_callback', ['label' => 'Langue', 'callback' => function (ProxyQuery $queryBuilder, $alias, $field, $value) {
         if (!$value['value']) {
             return false;
         }
         $queryBuilder->andWhere($alias . '.locale = :locale')->setParameter('locale', $value['value']);
         return true;
     }], 'choice', ['choices' => $this->getRealLocales()])->add('title', null, ['label' => 'Page'])->add('published', null, ['label' => 'Publié'])->add('node', 'doctrine_orm_callback', ['label' => 'Type de contenu', 'callback' => function (ProxyQuery $queryBuilder, $alias, $field, $value) use($entityManager) {
         if (!$value['value']) {
             return false;
         }
         // We can't query the type from the AlpixelCMSBundle:Node repository (InheritanceType) because of that
         // we try to get the repository in AppBundle with the value which is the class name of entity. :pig:
         try {
             $repository = $entityManager->getRepository(sprintf('AppBundle:%s', ucfirst($value['value'])));
         } catch (\Doctrine\Common\Persistence\Mapping\MappingException $e) {
             return false;
         }
         $data = $repository->findAll();
         if (empty($data)) {
             return false;
         }
         $queryBuilder->andWhere($alias . '.id IN (:ids)')->setParameter('ids', $data);
         return true;
     }], 'choice', ['choices' => $this->getCMSEntityTypes()]);
 }
开发者ID:alpixel,项目名称:AlpixelCMSBundle,代码行数:34,代码来源:AdminNode.php

示例12: configureDatagridFilters

 protected function configureDatagridFilters(DatagridMapper $datagridMapper)
 {
     // Getting the container parameters set in the config file that exist
     $commentSettings = $this->getConfigurationPool()->getContainer()->getParameter('comment_settings');
     $commentTypeChoice = $commentSettings['commenttypes'];
     $datagridMapper->add('title')->add('commentType', 'doctrine_orm_string', array(), 'choice', array('choices' => $commentTypeChoice))->add('blogPost')->add('created', 'doctrine_orm_date_range', array('input_type' => 'date'), 'sonata_type_date_range')->add('username')->add('approved', 'doctrine_orm_string', array(), 'choice', array('choices' => array('0' => 'Hide', '1' => 'Show')));
 }
开发者ID:elom5000,项目名称:BardisCMS,代码行数:7,代码来源:CommentAdmin.php

示例13: configureDatagridFilters

 protected function configureDatagridFilters(DatagridMapper $datagridMapper)
 {
     $datagridMapper
         ->add('title', 'doctrine_phpcr_string')
         ->add('name',  'doctrine_phpcr_nodename')
     ;
 }
开发者ID:xxspartan16,项目名称:BMS-Market,代码行数:7,代码来源:StaticContentAdmin.php

示例14: configureDatagridFilters

 protected function configureDatagridFilters(DatagridMapper $datagridMapper)
 {
     $container = $this->getConfigurationPool()->getContainer();
     $roles = $container->getParameter('security.role_hierarchy.roles');
     $rolesChoices = self::flattenRoles($roles);
     $datagridMapper->add('username')->add('firstname')->add('lastname');
 }
开发者ID:bricegates,项目名称:cba_trainning.com,代码行数:7,代码来源:UserAdmin.php

示例15: configureDatagridFilters

 protected function configureDatagridFilters(DatagridMapper $datagridMapper)
 {
     $em = $this->modelManager->getEntityManager('Vidal\\MainBundle\\Entity\\User');
     $cityChoices = $em->getRepository('VidalMainBundle:City')->getChoices();
     $regionChoices = $em->getRepository('VidalMainBundle:Region')->getChoices();
     $countryChoices = $em->getRepository('VidalMainBundle:Country')->getChoices();
     $datagridMapper->add('id')->add('username', null, array('label' => 'E-mail'))->add('lastName', null, array('label' => 'Фамилия'))->add('primarySpecialty', null, array('label' => 'Основная специальность'))->add('city', 'doctrine_orm_choice', array('label' => 'Город'), 'choice', array('choices' => $cityChoices))->add('region', 'doctrine_orm_choice', array('label' => 'Область'), 'choice', array('choices' => $regionChoices))->add('country', 'doctrine_orm_choice', array('label' => 'Страна'), 'choice', array('choices' => $countryChoices))->add('emailConfirmed', null, array('label' => 'e-mail подтвержден'))->add('oldUser', null, array('label' => 'Со старого сайта'))->add('confirmationHas', null, array('label' => 'Со сканами'));
 }
开发者ID:Evrika,项目名称:Vidal,代码行数:8,代码来源:UserAdmin.php


注:本文中的Sonata\AdminBundle\Datagrid\DatagridMapper::add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。