-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
phalcon
committed
Jul 7, 2013
1 parent
14d730f
commit ba14874
Showing
7 changed files
with
85 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
class RelationsParts extends Phalcon\Mvc\Model | ||
{ | ||
|
||
public function initialize() | ||
{ | ||
$this->hasMany('id', 'RelationsRobotsParts', 'parts_id', array( | ||
'foreignKey' => array( | ||
'message' => 'Parts cannot be deleted because is referenced by a Robot' | ||
) | ||
)); | ||
} | ||
|
||
public function getSource() | ||
{ | ||
return 'parts'; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
class RelationsRobots extends Phalcon\Mvc\Model | ||
{ | ||
|
||
public function initialize() | ||
{ | ||
$this->hasMany('id', 'RelationsRobotsParts', 'robots_id', array( | ||
'foreignKey' => true | ||
)); | ||
$this->hasManyToMany('id', 'RelationsRobotsParts', 'robots_id', 'parts_id', 'RelationsParts', 'id'); | ||
} | ||
|
||
public function getSource() | ||
{ | ||
return 'robots'; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
class RelationsRobotsParts extends Phalcon\Mvc\Model | ||
{ | ||
|
||
public function initialize() | ||
{ | ||
$this->belongsTo('parts_id', 'RelationsParts', 'id', array( | ||
'foreignKey' => true | ||
)); | ||
$this->belongsTo('robots_id', 'RelationsRobots', 'id', array( | ||
'foreignKey' => array( | ||
'message' => 'The robot code does not exist' | ||
) | ||
)); | ||
} | ||
|
||
public function getSource() | ||
{ | ||
return 'robots_parts'; | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.