diff --git a/sandbox/data/fixtures/adult.yml b/sandbox/data/fixtures/adult.yml new file mode 100644 index 000000000..9e5cea976 --- /dev/null +++ b/sandbox/data/fixtures/adult.yml @@ -0,0 +1,5 @@ +--- +Adult: + Adult_1: + name: Parent 1 + Contact: Contact_1 \ No newline at end of file diff --git a/sandbox/data/fixtures/car.yml b/sandbox/data/fixtures/car.yml new file mode 100644 index 000000000..f4982734f --- /dev/null +++ b/sandbox/data/fixtures/car.yml @@ -0,0 +1,8 @@ +--- +Car: + Car_1: + name: Chevorlet Trailblazer + Car_2: + name: Chevorlet Blazer + Car_3: + name: Buick \ No newline at end of file diff --git a/sandbox/data/fixtures/child.yml b/sandbox/data/fixtures/child.yml new file mode 100644 index 000000000..abcb32122 --- /dev/null +++ b/sandbox/data/fixtures/child.yml @@ -0,0 +1,5 @@ +--- +Child: + Child_1: + name: Child 1 + Adult: Adult_1 \ No newline at end of file diff --git a/sandbox/data/fixtures/contact.yml b/sandbox/data/fixtures/contact.yml new file mode 100644 index 000000000..cfda25e2d --- /dev/null +++ b/sandbox/data/fixtures/contact.yml @@ -0,0 +1,8 @@ +--- +Contact: + Contact_1: + name: Jonathan H. Wage + Contact_3: + name: Daniel Adams + Contact_4: + name: Robert Adams \ No newline at end of file diff --git a/sandbox/data/fixtures/data.yml b/sandbox/data/fixtures/data.yml new file mode 100644 index 000000000..a0b665c20 --- /dev/null +++ b/sandbox/data/fixtures/data.yml @@ -0,0 +1,8 @@ +--- +Contact: + Contact_1: + name: jonathan h. wage +User: + User_1: + username: jonwage + Contact: Contact_1 diff --git a/sandbox/data/fixtures/dog.yml b/sandbox/data/fixtures/dog.yml new file mode 100644 index 000000000..8c2794300 --- /dev/null +++ b/sandbox/data/fixtures/dog.yml @@ -0,0 +1,11 @@ +--- +Dog: + Dog_1: + name: Sam + User: User_1 + Dog_2: + name: Dixie + User: User_2 + Dog_3: + name: Chief + User: User_3 \ No newline at end of file diff --git a/sandbox/data/fixtures/self_reference.yml b/sandbox/data/fixtures/self_reference.yml new file mode 100644 index 000000000..8a2cefadb --- /dev/null +++ b/sandbox/data/fixtures/self_reference.yml @@ -0,0 +1,20 @@ +--- +SelfReference: + SelfReference_1: + User1: User_1 + User2: User_2 + name: Self Reference 1 + SelfReference1: SelfReference_2 + SelfReference2: SelfReference_3 + SelfReference_2: + User1: User_2 + User2: User_1 + name: Self Reference 2 + SelfReference1: SelfReference_1 + SelfReference2: SelfReference_1 + SelfReference_3: + User1: User_2 + User2: User_1 + name: Self Reference 3 + SelfReference1: SelfReference_3 + SelfReference2: SelfReference_3 \ No newline at end of file diff --git a/sandbox/data/fixtures/user.yml b/sandbox/data/fixtures/user.yml new file mode 100644 index 000000000..aaeece0f8 --- /dev/null +++ b/sandbox/data/fixtures/user.yml @@ -0,0 +1,14 @@ +--- +User: + User_1: + username: jwage + hair_color: light brown + Contact: Contact_1 + User_2: + username: dadams + hair_color: dark brown + Contact: Contact_3 + User_3: + username: radams + hair_color: light brown + Contact: Contact_4 \ No newline at end of file diff --git a/sandbox/data/fixtures/user_car.yml b/sandbox/data/fixtures/user_car.yml new file mode 100644 index 000000000..af7802614 --- /dev/null +++ b/sandbox/data/fixtures/user_car.yml @@ -0,0 +1,11 @@ +--- +UserCar: + UserCar_1: + User: User_1 + Car: Car_1 + UserCar_2: + User: User_2 + Car: Car_2 + UserCar_3: + User: User_3 + Car: Car_3 \ No newline at end of file diff --git a/sandbox/models/Adult.class.php b/sandbox/models/Adult.class.php new file mode 100644 index 000000000..c3bdc3146 --- /dev/null +++ b/sandbox/models/Adult.class.php @@ -0,0 +1,12 @@ +setTableName('adult'); + $this->hasColumn('id', 'integer', 11, array('primary' => true, + 'autoincrement' => true)); + + $this->hasColumn('name', 'string', 255); + $this->hasColumn('contact_id', 'integer', 11); + + + + + + } + + public function setUp() + { + $this->hasOne('Contact', array('local' => 'contact_id', + 'foreign' => 'id')); + + $this->hasMany('Child as Children', array('local' => 'id', + 'foreign' => 'adult_id')); + + } + +} \ No newline at end of file diff --git a/sandbox/models/generated/BaseCar.class.php b/sandbox/models/generated/BaseCar.class.php new file mode 100644 index 000000000..20550425f --- /dev/null +++ b/sandbox/models/generated/BaseCar.class.php @@ -0,0 +1,30 @@ +setTableName('car'); + $this->hasColumn('id', 'integer', 11, array('primary' => true, + 'autoincrement' => true)); + $this->hasColumn('name', 'string', 255); + + + + + + } + + public function setUp() + { + $this->hasMany('User as Users', array('refClass' => 'UserCar', + 'local' => 'car_id', + 'foreign' => 'user_id')); + + } + +} \ No newline at end of file diff --git a/sandbox/models/generated/BaseChild.class.php b/sandbox/models/generated/BaseChild.class.php new file mode 100644 index 000000000..77ca67798 --- /dev/null +++ b/sandbox/models/generated/BaseChild.class.php @@ -0,0 +1,31 @@ +setTableName('child'); + $this->hasColumn('id', 'integer', 11, array('primary' => true, + 'autoincrement' => true)); + + $this->hasColumn('name', 'string', 255); + $this->hasColumn('adult_id', 'integer', 11); + + + + + + } + + public function setUp() + { + $this->hasOne('Adult', array('local' => 'adult_id', + 'foreign' => 'id')); + + } + +} \ No newline at end of file diff --git a/sandbox/models/generated/BaseDog.class.php b/sandbox/models/generated/BaseDog.class.php new file mode 100644 index 000000000..2fbd9408f --- /dev/null +++ b/sandbox/models/generated/BaseDog.class.php @@ -0,0 +1,31 @@ +setTableName('dog'); + $this->hasColumn('id', 'integer', 11, array('primary' => true, + 'autoincrement' => true)); + + $this->hasColumn('name', 'string', 255); + $this->hasColumn('user_id', 'integer', 11); + + + + + + } + + public function setUp() + { + $this->hasOne('User', array('local' => 'user_id', + 'foreign' => 'id')); + + } + +} \ No newline at end of file diff --git a/sandbox/models/generated/BaseEntity.class.php b/sandbox/models/generated/BaseEntity.class.php new file mode 100644 index 000000000..16e4f421b --- /dev/null +++ b/sandbox/models/generated/BaseEntity.class.php @@ -0,0 +1,22 @@ +setTableName('entity'); + $this->hasColumn('id', 'integer', 11, array('primary' => true, + 'autoincrement' => true)); + + + + + + } + + +} \ No newline at end of file diff --git a/sandbox/models/generated/BaseGroup.class.php b/sandbox/models/generated/BaseGroup.class.php new file mode 100644 index 000000000..d50e2cd10 --- /dev/null +++ b/sandbox/models/generated/BaseGroup.class.php @@ -0,0 +1,31 @@ +setTableName('group'); + $this->hasColumn('id', 'integer', 4, array('notnull' => true, + 'primary' => true, + 'autoincrement' => true)); + $this->hasColumn('name', 'string', 255); + + + + + + } + + public function setUp() + { + $this->hasMany('User as Users', array('refClass' => 'UserGroup', + 'local' => 'group_id', + 'foreign' => 'user_id')); + + } + +} \ No newline at end of file diff --git a/sandbox/models/generated/BaseSelfReference.class.php b/sandbox/models/generated/BaseSelfReference.class.php new file mode 100644 index 000000000..414ce81fb --- /dev/null +++ b/sandbox/models/generated/BaseSelfReference.class.php @@ -0,0 +1,52 @@ +setTableName('self_reference'); + $this->hasColumn('id', 'integer', 11, array('primary' => true, + 'autoincrement' => true)); + + $this->hasColumn('name', 'string', 255); + + $this->hasColumn('user_id1', 'integer', 11); + + $this->hasColumn('user_id2', 'integer', 11); + + $this->hasColumn('parent_self_reference_id', 'integer', 11); + $this->hasColumn('parent_self_reference_id2', 'integer', 11); + + + + + + } + + public function setUp() + { + $this->hasOne('User as User1', array('local' => 'user_id1', + 'foreign' => 'id')); + + $this->hasOne('User as User2', array('local' => 'user_id2', + 'foreign' => 'id')); + + $this->hasOne('SelfReference as SelfReference1', array('local' => 'parent_self_reference_id', + 'foreign' => 'id')); + + $this->hasOne('SelfReference as SelfReference2', array('local' => 'parent_self_reference_id2', + 'foreign' => 'id')); + + $this->hasMany('SelfReference as SelfReferences1', array('local' => 'id', + 'foreign' => 'parent_self_reference_id')); + + $this->hasMany('SelfReference as SelfReferences2', array('local' => 'id', + 'foreign' => 'parent_self_reference_id2')); + + } + +} \ No newline at end of file diff --git a/sandbox/models/generated/BaseUserCar.class.php b/sandbox/models/generated/BaseUserCar.class.php new file mode 100644 index 000000000..ac7e0c001 --- /dev/null +++ b/sandbox/models/generated/BaseUserCar.class.php @@ -0,0 +1,31 @@ +setTableName('user_car'); + $this->hasColumn('user_id', 'integer', 11, array('primary' => true)); + $this->hasColumn('car_id', 'integer', 11, array('primary' => true)); + + + + + + } + + public function setUp() + { + $this->hasOne('User', array('local' => 'user_id', + 'foreign' => 'id')); + + $this->hasOne('Car', array('local' => 'car_id', + 'foreign' => 'id')); + + } + +} \ No newline at end of file diff --git a/sandbox/models/generated/BaseUserGroup.class.php b/sandbox/models/generated/BaseUserGroup.class.php new file mode 100644 index 000000000..9048a0709 --- /dev/null +++ b/sandbox/models/generated/BaseUserGroup.class.php @@ -0,0 +1,31 @@ +setTableName('user_group'); + $this->hasColumn('user_id', 'integer', 4, array('primary' => true)); + $this->hasColumn('group_id', 'integer', 4, array('primary' => true)); + + + + + + } + + public function setUp() + { + $this->hasOne('User', array('local' => 'user_id', + 'foreign' => 'id')); + + $this->hasOne('Group', array('local' => 'group_id', + 'foreign' => 'id')); + + } + +} \ No newline at end of file diff --git a/sandbox/schema/adult.yml b/sandbox/schema/adult.yml new file mode 100644 index 000000000..37c71fed0 --- /dev/null +++ b/sandbox/schema/adult.yml @@ -0,0 +1,17 @@ +--- +Adult: + fields: + id: + type: integer + size: 11 + primary: true + autoincrement: true + name: + type: string + size: 255 + contact_id: + type: integer + size: 11 + relations: + Contact: + foreignType: one \ No newline at end of file diff --git a/sandbox/schema/car.yml b/sandbox/schema/car.yml new file mode 100644 index 000000000..4553ef4b3 --- /dev/null +++ b/sandbox/schema/car.yml @@ -0,0 +1,15 @@ +--- +Car: + columns: + id: + type: integer + length: 11 + primary: true + autoincrement: true + name: + type: string + length: 255 + relations: + Users: + class: User + refClass: UserCar \ No newline at end of file diff --git a/sandbox/schema/child.yml b/sandbox/schema/child.yml new file mode 100644 index 000000000..8bf108d98 --- /dev/null +++ b/sandbox/schema/child.yml @@ -0,0 +1,17 @@ +--- +Child: + fields: + id: + type: integer + size: 11 + primary: true + autoincrement: true + name: + type: string + size: 255 + adult_id: + type: integer + size: 11 + relations: + Adult: + foreignAlias: Children \ No newline at end of file diff --git a/sandbox/schema/dog.yml b/sandbox/schema/dog.yml new file mode 100644 index 000000000..34551e187 --- /dev/null +++ b/sandbox/schema/dog.yml @@ -0,0 +1,17 @@ +--- +Dog: + columns: + id: + type: integer + length: 11 + primary: true + autoincrement: true + name: + type: string + length: 255 + user_id: + type: integer + length: 11 + relations: + User: + foreignType: one \ No newline at end of file diff --git a/sandbox/schema/entity.yml b/sandbox/schema/entity.yml new file mode 100644 index 000000000..47282a80d --- /dev/null +++ b/sandbox/schema/entity.yml @@ -0,0 +1,8 @@ +--- +Entity: + columns: + id: + type: integer + size: 11 + primary: true + autoincrement: true \ No newline at end of file diff --git a/sandbox/schema/group.yml b/sandbox/schema/group.yml new file mode 100644 index 000000000..3f9ee988b --- /dev/null +++ b/sandbox/schema/group.yml @@ -0,0 +1,17 @@ +--- +Group: + columns: + id: + notnull: true + primary: true + autoincrement: true + type: integer + length: 4 + name: id + name: + type: string + length: 255 + relations: + Users: + class: User + refClass: UserGroup \ No newline at end of file diff --git a/sandbox/schema/self_reference.yml b/sandbox/schema/self_reference.yml new file mode 100644 index 000000000..30a8b234b --- /dev/null +++ b/sandbox/schema/self_reference.yml @@ -0,0 +1,40 @@ +--- +SelfReference: + fields: + id: + type: integer + size: 11 + primary: true + autoincrement: true + name: + type: string + size: 255 + user_id1: + type: integer + size: 11 + user_id2: + type: integer + size: 11 + parent_self_reference_id: + type: integer + size: 11 + parent_self_reference_id2: + type: integer + size: 11 + relations: + User1: + class: User + local: user_id1 + foreignAlias: SelfReference1 + User2: + class: User + local: user_id2 + foreignAlias: SelfReference2 + SelfReference1: + class: SelfReference + local: parent_self_reference_id + foreignAlias: SelfReferences1 + SelfReference2: + class: SelfReference + local: parent_self_reference_id2 + foreignAlias: SelfReferences2 \ No newline at end of file diff --git a/sandbox/schema/user_car.yml b/sandbox/schema/user_car.yml new file mode 100644 index 000000000..204d047e5 --- /dev/null +++ b/sandbox/schema/user_car.yml @@ -0,0 +1,14 @@ +--- +UserCar: + columns: + user_id: + type: integer + length: 11 + primary: true + car_id: + type: integer + length: 11 + primary: true + relations: + User: - + Car: - \ No newline at end of file diff --git a/sandbox/schema/user_group.yml b/sandbox/schema/user_group.yml new file mode 100644 index 000000000..0d3bd07ae --- /dev/null +++ b/sandbox/schema/user_group.yml @@ -0,0 +1,14 @@ +--- +UserGroup: + columns: + user_id: + type: integer + length: 4 + primary: true + group_id: + type: integer + length: 4 + primary: true + relations: + User: - + Group: - \ No newline at end of file