DMS\Filter\Filters\Callback::setCurrentObject PHP Method

setCurrentObject() public method

Set the current object so that the filter can access it
public setCurrentObject ( $object ) : object
$object
return object mixed
    public function setCurrentObject($object)
    {
        $this->currentObject = $object;
    }

Usage Example

Example #1
0
 /**
  * @expectedException \DMS\Filter\Exception\InvalidCallbackException
  */
 public function testRuleWithObjectMethodInvalid()
 {
     $this->rule->expects($this->once())->method('getInputType')->will($this->returnValue(CallbackRule::SELF_METHOD_TYPE));
     $this->rule->callback = 'callbackMissingMethod';
     $obj = new AnnotatedClass();
     $this->filter->setCurrentObject($obj);
     $this->filter->apply($this->rule, 'value');
 }