Fuel\Validation\Result::setValidated PHP Method

setValidated() public method

Since: 2.0
public setValidated ( string $field )
$field string
    public function setValidated($field)
    {
        $this->validated[] = $field;
        return $this;
    }

Usage Example

Example #1
0
 public function testMerge()
 {
     $result1 = new Result();
     $result1->setResult(false);
     $result1->setError('foo', 'foo failed', 'foocheck');
     $result1->setValidated('bar');
     $result2 = new Result();
     $result2->setResult(true);
     $result2->setError('baz', 'baz failed', 'bazcheck');
     $result2->setValidated('bat');
     $result1->merge($result2, 'sub.');
     $this->assertEquals(['foo' => 'foo failed', 'sub.baz' => 'baz failed'], $result1->getErrors());
     $this->assertEquals(['foo' => 'foocheck', 'sub.baz' => 'bazcheck'], $result1->getFailedRules());
     $this->assertEquals(['bar', 'sub.bat'], $result1->getValidated());
 }
All Usage Examples Of Fuel\Validation\Result::setValidated