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


PHP DatagridMapper::getAdmin方法代码示例

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


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

示例1: testAddException2

 public function testAddException2()
 {
     try {
         $this->datagridMapper->getAdmin()->expects($this->any())->method('hasFilterFieldDescription')->will($this->returnValue(true));
         $this->datagridMapper->add('field');
     } catch (\RuntimeException $e) {
         $this->assertContains('The field "field" is already defined', $e->getMessage());
         return;
     }
     $this->fail('Failed asserting that exception of type "\\RuntimeException" is thrown.');
 }
开发者ID:viral810,项目名称:ngSimpleCMS,代码行数:11,代码来源:DatagridMapperTest.php

示例2: testAddDuplicateNameException

 public function testAddDuplicateNameException()
 {
     $tmpNames = array();
     $this->datagridMapper->getAdmin()->expects($this->exactly(2))->method('hasFilterFieldDescription')->will($this->returnCallback(function ($name) use(&$tmpNames) {
         if (isset($tmpNames[$name])) {
             return true;
         }
         $tmpNames[$name] = $name;
         return false;
     }));
     try {
         $this->datagridMapper->add('fooName');
         $this->datagridMapper->add('fooName');
     } catch (\RuntimeException $e) {
         $this->assertContains('Duplicate field name "fooName" in datagrid mapper. Names should be unique.', $e->getMessage());
         return;
     }
     $this->fail('Failed asserting that exception of type "\\RuntimeException" is thrown.');
 }
开发者ID:andrey1s,项目名称:SonataAdminBundle,代码行数:19,代码来源:DatagridMapperTest.php

示例3: configureDatagridFilters

 /**
  * {@inheritdoc}
  */
 public function configureDatagridFilters(DatagridMapper $filter)
 {
     $this->eventDispatcher->dispatch('sonata.admin.event.configure.datagrid', new ConfigureEvent($filter->getAdmin(), $filter, ConfigureEvent::TYPE_DATAGRID));
 }
开发者ID:saberyounis,项目名称:Sonata-Project,代码行数:7,代码来源:AdminEventExtension.php


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