Loads the filter that enforces a specific rule.
Inheritance: implements DMS\Filter\Filters\Loader\FilterLoaderInterface
コード例 #1
0
 /**
  * @param $rule
  * @param $return
  * @param $expectException
  *
  * @dataProvider provideForGetFilter
  */
 public function testGetFilterForRule($rule, $return, $expectException)
 {
     if ($expectException) {
         $this->setExpectedException('\\UnexpectedValueException');
     }
     $this->assertEquals($return, $this->loader->getFilterForRule($rule));
 }
コード例 #2
0
 /**
  * Attempts to load Filter from Container or hands off to parent loader.
  *
  * @param Rule $rule
  * @return BaseFilter
  */
 public function getFilterForRule(Rule $rule)
 {
     $filterIdentifier = $rule->getFilter();
     if ($this->container === null || !$this->container->has($filterIdentifier)) {
         return parent::getFilterForRule($rule);
     }
     return $this->container->get($filterIdentifier);
 }