示例#1
0
文件: Filter.php 项目: devrtips/listr
 public function __construct($entity)
 {
     $this->entity = $entity;
     $this->params = new DefaultParameterMethod();
     $config = Listr::getConfig();
     if (!isset($config[$entity]['filters'])) {
         throw new OutOfBoundsException("Filter group '{$entity}' does not exist.");
     }
     foreach ($config[$entity]['filters'] as $name => $filter) {
         $this->items[] = new Filter\Filter($name, $filter, $this->params);
     }
 }
示例#2
0
文件: Setup.php 项目: devrtips/listr
 public function setUp()
 {
     Listr::setConfig($this->blogConfig);
     $this->filters = Listr::getFilters('blog');
 }
示例#3
0
 /**
  * Filter cannot be created without label
  */
 public function testFilterCannotBeCreatedWithoutLabel()
 {
     $this->setExpectedException('Exception', "Label needed for filter 'content'.");
     Listr::setConfig($this->configWithFilterWithoutLabel);
 }