public function required($required = null) {

		if(false === is_bool($required) && null !== $required) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type boolean, "%s" given', __METHOD__, gettype($required)), E_USER_ERROR);
		}

		if(null === $required) {
			$required = true;
		}

		foreach($this -> getFieldnames() as $field) {
			$this -> required[$field] = $required;
		}

		return $this;
	}
public function required($required = null) {

		if(false === is_bool($required) && null !== $required) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type boolean, "%s" given', __METHOD__, gettype($required)), E_USER_ERROR);
		}

		if(null === $required) {
			$required = true;
		}

		foreach($this -> getFieldnames() as $field) {
			$this -> required[$field] = $required;
		}

		return $this;
	}
public function required ( $ required = null ) { if ( false === is_bool ( $ required ) && null !== $ required ) { return trigger_error ( sprintf ( 'Argument 1 passed to %s() must be of the type boolean, "%s" given' , __METHOD__ , gettype ( $ required ) ) , E_USER_ERROR ) ; } if ( null === $ required ) { $ required = true ; } foreach ( $ this -> getFieldnames ( ) as $ field ) { $ this -> required [ $ field ] = $ required ; } return $ this ; }
Set a rule that a field value can be empty or not
@param boolean|null $required
@return sFire\Validator
Set a rule that a field value can be empty or not