Custom relationship table?

edited January 2015 in Share
First of all, as a new user i must admit that i am impressed of what FuelCMS offer. But, i am little loosed and i am not sure how to continue and use my relationship database tables. Has_many works perfect, but because lots of relations i also need my relationship table for some objects.
I tried to find some working example but without success, so i will be very thankful if someone give me short example for lets say Movies and Actors models and how to prepare in admin editor and store their relations into Actors_to_movies relationship table.

Thanks in advance

Comments

  • edited 4:04AM
    There is some documentation near the end of the Relationships section highlighted in red:
    http://docs.getfuelcms.com/general/models#relationships
    public $has_many = array('attributes' => array('model' => array(FUEL_FOLDER => 'fuel_tags_model'), 'relationships_model' => 'my_relationship_model', 'foreign_key' => 'my_foreign_key', 'candidate_key' => 'candidate_key'));
    The table should have 5 columns though instead of 3, like the built in fuel_relationships table. The foreign_key and candidate_key array keys should be the names of the columns in that table to map to.
Sign In or Register to comment.