コード例 #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
ファイル: FilterTest.php プロジェクト: devrtips/listr
 /**
  * Filter cannot be created without label
  */
 public function testFilterCannotBeCreatedWithoutLabel()
 {
     $this->setExpectedException('Exception', "Label needed for filter 'content'.");
     Listr::setConfig($this->configWithFilterWithoutLabel);
 }