schema() 공개 정적인 메소드

..)` 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
예제 #1
0
 public static function schema($field = null)
 {
     if (is_array($field)) {
         return static::_object()->_schema = $field;
     }
     return parent::schema($field);
 }
예제 #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;
 }
예제 #3
0
 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;
 }