예제 #1
0
파일: BlogPost.php 프로젝트: solution10/orm
 public static function init(Meta $meta)
 {
     return $meta->table('posts')->field('title', new Field\String())->field('entry', new Field\Text());
 }
예제 #2
0
파일: MetaTest.php 프로젝트: solution10/orm
 public function testTableSingular()
 {
     $meta = new Meta('MyApp\\Models\\User');
     $meta->table('users');
     $this->assertEquals('user', $meta->tableSingular());
 }
예제 #3
0
 public static function init(Meta $meta)
 {
     return $meta->table('users')->field('name', new Field\String(['rules' => [['required'], ['lengthMin', 2]]]))->field('about', new Field\Text())->relationship('posts', 'hasMany', 'BlogPost')->relationship('orders', 'hasMany', 'Solution10\\ORM\\Tests\\ActiveRecord\\Stubs\\Order');
 }
예제 #4
0
파일: Order.php 프로젝트: solution10/orm
 public static function init(Meta $meta)
 {
     return $meta->table('orders')->field('total', new Field\Float());
 }