public function required(Model $model, $data, $required = true) {
        foreach ($data as $value) {
            if ($required && $this->_isEmpty($value)) {
                return false;
            }
        }

        return true;
    }
public function required(Model $model, $data, $required = true) {
        foreach ($data as $value) {
            if ($required && $this->_isEmpty($value)) {
                return false;
            }
        }

        return true;
    }
public function required ( Model $ model , $ data , $ required = true ) { foreach ( $ data as $ value ) { if ( $ required && $ this -> _isEmpty ( $ value ) ) { return false ; } } return true ; }
Makes sure a file field is required and not optional.

@param Model $model
@param array $data
@param bool $required
@return bool
Makes sure a file field is required and not optional .