Created
October 13, 2014 17:58
-
-
Save DB-009/6fed92fa85bd4be43a9b to your computer and use it in GitHub Desktop.
Model Relationships
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
///EXHIBIT | |
public function medias() | |
{ | |
return $this->hasMany('Media','parent_id','exhibit_id'); | |
} | |
///ARTOBJ | |
public function medias() | |
{ | |
return $this->hasMany('Media','parent_id','object_id'); | |
} | |
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
public function artobjs() | |
{ | |
return $this->belongsTo('ArtObj','parent_id','object_id'); | |
} | |
public function exhibits() | |
{ | |
return $this->belongsTo('Exhibit','parent_id','exhibit_id'); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment