public function validate($data = null, $entity = null)
    {
        if (is_null($data)) {
            $data = $this->getData();
        }

        $this->data = $data;
        return !count(parent::validate($data, $entity));
    }
public function validate($data = null, $entity = null)
    {
        if (is_null($data)) {
            $data = $this->getData();
        }

        $this->data = $data;
        return !count(parent::validate($data, $entity));
    }
public function validate ( $ data = null , $ entity = null ) { if ( is_null ( $ data ) ) { $ data = $ this -> getData ( ) ; } $ this -> data = $ data ; return ! count ( parent :: validate ( $ data , $ entity ) ) ; }
Validate a set of data according to a set of rules

@param array|object $data
@param object $entity
@return bool
Validate a set of data according to a set of rules