Hi, i will know if it's possible. I have Concatcs and Tipos class
class Contacts extends Phalcon\Mvc\Model
/*
* @Primary
* @Identity
* @Column(type="integer", nullable=false)
*/
public $id;
public $type;
public $origen_id;
public $name;
public function initialize()
{
$user = $this->getDI()->getSession()->get('auth');
$this->setSource('contacts');
$this->belongsTo('type', 'Tipos', 'id');
$this->belongsTo('origen_id', 'Tipos', 'id',['alias'=>'Origenes']);
}
class Tipos extends Phalcon\Mvc\Model{
public $id;
public $name;
public $tipo_id;
public function initialize()
{
$this->belongsTo('tipo_id', // which column
'Tipos', // referenced table
'id', // referenced table column
['alias' => 'parent']);
}
}
two questions, ¿could i use Contacts->Tipos->name and Contacts->Origenes->name? ¿how to construct phalcon\tag select()?
Thanks.