..)` 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. |
Результат | array | lithium\data\Schema |
public static function schema($field = null) { if (is_array($field)) { return static::_object()->_schema = $field; } return parent::schema($field); }
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; }