Hello community,
I have an issue handling extra fields from the intermediate table.
Look at the diagram:
I need to get all fields from the "PerfumeCategory" table, which is just an intermediate table between Perfumes and Categories. So relationship is defined as one Perfume can have many Categories.
Is Phalcon ORM capable of doing so?
So far we defined Perfume model as:
$this->hasManyToMany('PerfumeID', 'PerfumeCategory','PerfumeID','CategoryID','Category', 'CategoryID', array('alias' => 'PerfumeCategory'));
and Category model as:
$this->hasManyToMany('CategoryID', 'PerfumeCategory','CategoryID','PerfumeID','Perfume', 'PerfumeID', array('alias' => 'PerfumeCategory'));