public function isValid($property = null) {
		$validators = $this->getValidators();
		
		if ($validators === null) {
			return true;
		}
		
		if ($property === null) {
			$data = &$this->_data;
		} else if (is_array($property)) {
			$data = array_intersect_key($this->_data, array_flip($property));

			if (empty($data)) {
				throw new Exception('Specified properties are absent');
			}
		} else {
			if (! isset($this->_data[$property])) {
				throw new Exception('Specified property is absent');
			}
			
			$data = [$property => $this->_data[$property]];
		}
		
		$valid    = true;
		$messages = [];
		
		foreach ($data as $name => $value) {
			if (! isset($validators[$name])) {
				continue;
			}
			
			foreach ($validators[$name] as $validator) {
				if ($validator->isValid($value)) {
					continue;
				}
				
				if (isset($messages[$name])) {
					$messages[$name] = array_merge($messages[$name], $validator->getMessages());
				} else {
					$messages[$name] = $validator->getMessages();
				}

				$valid = false;
				
			}
			
		}
		
		$this->_validatorsMessages = $messages;
		
		return $valid;
	}
public function isValid($property = null) {
		$validators = $this->getValidators();
		
		if ($validators === null) {
			return true;
		}
		
		if ($property === null) {
			$data = &$this->_data;
		} else if (is_array($property)) {
			$data = array_intersect_key($this->_data, array_flip($property));

			if (empty($data)) {
				throw new Exception('Specified properties are absent');
			}
		} else {
			if (! isset($this->_data[$property])) {
				throw new Exception('Specified property is absent');
			}
			
			$data = [$property => $this->_data[$property]];
		}
		
		$valid    = true;
		$messages = [];
		
		foreach ($data as $name => $value) {
			if (! isset($validators[$name])) {
				continue;
			}
			
			foreach ($validators[$name] as $validator) {
				if ($validator->isValid($value)) {
					continue;
				}
				
				if (isset($messages[$name])) {
					$messages[$name] = array_merge($messages[$name], $validator->getMessages());
				} else {
					$messages[$name] = $validator->getMessages();
				}

				$valid = false;
				
			}
			
		}
		
		$this->_validatorsMessages = $messages;
		
		return $valid;
	}
public function isValid ( $ property = null ) { $ validators = $ this -> getValidators ( ) ; if ( $ validators === null ) { return true ; } if ( $ property === null ) { $ data = & $ this -> _data ; } else if ( is_array ( $ property ) ) { $ data = array_intersect_key ( $ this -> _data , array_flip ( $ property ) ) ; if ( empty ( $ data ) ) { throw new Exception ( 'Specified properties are absent' ) ; } } else { if ( ! isset ( $ this -> _data [ $ property ] ) ) { throw new Exception ( 'Specified property is absent' ) ; } $ data = [ $ property => $ this -> _data [ $ property ] ] ; } $ valid = true ; $ messages = [ ] ; foreach ( $ data as $ name => $ value ) { if ( ! isset ( $ validators [ $ name ] ) ) { continue ; } foreach ( $ validators [ $ name ] as $ validator ) { if ( $ validator -> isValid ( $ value ) ) { continue ; } if ( isset ( $ messages [ $ name ] ) ) { $ messages [ $ name ] = array_merge ( $ messages [ $ name ] , $ validator -> getMessages ( ) ) ; } else { $ messages [ $ name ] = $ validator -> getMessages ( ) ; } $ valid = false ; } } $ this -> _validatorsMessages = $ messages ; return $ valid ; }
Is data valid

@param  string | array $property
@return boolean
Is data valid