Hi guys, I am new at Phalcon and I have a question.
How can I create a model relation with a composite primary key? I have tables in my schema with composite primary keys. The relations BelongsTo and HasMany seems not to have this feature.
I am doing this way:
public function initialize()
{
$this->belongsTo('idUser', 'Fortec\Models\Form', 'idUser', array ('alias' => 'FormUsers'));
$this->belongsTo('idForm', 'Fortec\Models\Form', 'id', array ('alias' => 'Forms'));
$this->hasMany('idForm', 'Fortec\Models\BrFormImage', 'idForm', array ('alias' => 'BrFormImages'));
$this->hasMany('idUser', 'Fortec\Models\BrFormImage', 'idUser', array ('alias' => 'BrFormImageUsers'));
$this->hasMany('idForm', 'Fortec\Models\BrFormCorrection', 'idForm', array ('alias' => 'BrFormCorrections'));
$this->hasMany('idUser', 'Fortec\Models\BrFormCorrection', 'idUser', array ('alias' => 'BrFormCorrectionUsers'));
}
Thanks.