public function getValidation($field = null)
    {

        $validation = array();
        $schema = $this->getModelSchema();

        if ($field != null)
            $schema = array($field => $schema[$field]);

        foreach ( $schema as $key => $value ) {
            if (!isset($value['validation']))
                throw new Exception('Validation missing for key: '.$field);
            $validation[$key] = $value['validation'];
        }

        if ($field != null)
            return $validation[$field];

        return $validation;
    }
public function getValidation($field = null)
    {

        $validation = array();
        $schema = $this->getModelSchema();

        if ($field != null)
            $schema = array($field => $schema[$field]);

        foreach ( $schema as $key => $value ) {
            if (!isset($value['validation']))
                throw new Exception('Validation missing for key: '.$field);
            $validation[$key] = $value['validation'];
        }

        if ($field != null)
            return $validation[$field];

        return $validation;
    }
public function getValidation ( $ field = null ) { $ validation = array ( ) ; $ schema = $ this -> getModelSchema ( ) ; if ( $ field != null ) $ schema = array ( $ field => $ schema [ $ field ] ) ; foreach ( $ schema as $ key => $ value ) { if ( ! isset ( $ value [ 'validation' ] ) ) throw new Exception ( 'Validation missing for key: ' . $ field ) ; $ validation [ $ key ] = $ value [ 'validation' ] ; } if ( $ field != null ) return $ validation [ $ field ] ; return $ validation ; }
Returns the model schema, which we'll use for validation

@param string $field The field name

@return array
Returns the model schema which we ll use for validation