schema() public static méthode

..)` to define the schema manually.
public static schema ( mixed $field = null ) : array | lithium\data\Schema
$field mixed Optional. You may pass a field name to get schema information for just one field. Otherwise, an array containing all fields is returned. If `false`, the schema is reset to an empty value. If an array, field definitions contained are appended to the schema.
Résultat array | lithium\data\Schema
Exemple #1
0
 public static function schema($field = null)
 {
     if (is_array($field)) {
         return static::_object()->_schema = $field;
     }
     return parent::schema($field);
 }
Exemple #2
0
 public static function schema($field = null)
 {
     $result = parent::schema($field);
     if (is_object($result) && get_class($result) === 'lithium\\data\\Schema') {
         return new Schema(array('fields' => $result->fields(), 'meta' => $result->meta()));
     }
     return $result;
 }
 public static function schema($field = null)
 {
     $schema = parent::schema();
     $schema->append(array('_id' => array('type' => 'id'), 'foo' => array('type' => 'object'), 'foo.bar' => array('type' => 'int')));
     return $schema;
 }