Hi all,
First of all, thanks for all the hard work. Love Phalcon and we're just starting to use it on a big project. There is one problem I can't easily work around.
How would one make a child-parent relationship between Phalcon MVC models? This is a DB schema I have in mind:
```sql explain show; +---------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------+--------------+------+-----+---------+-------+ | id | int(11) | NO | PRI | NULL | | | length | int(11) | NO | | NULL | | | title | varchar(100) | NO | | NULL | | +---------+--------------+------+-----+---------+-------+
explain show_episode; +---------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------+--------------+------+-----+---------+-------+ | show_id | int(11) | NO | PRI | NULL | | | season | int(11) | NO | | NULL | | | episode | int(11) | NO | | NULL | | +---------+--------------+------+-----+---------+-------+```
Each element in show_episode is also present in show table, however there are show records which are only present in show.
The idea is to have two Phalcon Model classes:
```php class Show extends Phalcon\Mvc\Model { public $id; public $length; public $title; }
class ShowEpisode extends Show { public $season; public $episode; }``` How would I need to configure those models to be able to retrieve and save episode records like this:
```php// retrieve $episode = ShowEpisode::findFirst(array("id"=>333)); echo $episode->season; echo $episode->title;
// save $episode->title = "New Title"; $episode->season = 3; $episode->save();```
Thanks for the help!
Best, Matej