src/Norm/Collection.php
public function prepare($key, $value, $schema = null)
    {
        if (is_null($schema)) {
            $schema = $this->schema($key);
            if (is_null($schema)) {
                return $value;
                // throw new \Exception('Cannot prepare data to set. Schema not found for key ['.$key.'].');
            }
        }
        return $schema->prepare($value);
    }
public function prepare($key, $value, $schema = null)
    {
        if (is_null($schema)) {
            $schema = $this->schema($key);
            if (is_null($schema)) {
                return $value;
                // throw new \Exception('Cannot prepare data to set. Schema not found for key ['.$key.'].');
            }
        }
        return $schema->prepare($value);
    }
public function prepare ( $ key , $ value , $ schema = null ) { if ( is_null ( $ schema ) ) { $ schema = $ this -> schema ( $ key ) ; if ( is_null ( $ schema ) ) { return $ value ; // throw new \Exception('Cannot prepare data to set. Schema not found for key ['.$key.'].'); } } return $ schema -> prepare ( $ value ) ; }
Prepare data value for specific field name

@param  string             $key    Field name
@param  mixed              $value  Original data value
@param  Norm\Schema\Field  $schema If specified will override default schema

@return mixed Prepared data value
Prepare data value for specific field name