Hi
If I have a Model t1:
<?php
class t1 extends Phalcon\Mvc\Model
{
public $id;
public $t2_id;
public function initialize()
{
$this->setSource('t1');
$this->hasOne('t2_id', 't2', 'id');
}
}
and a Model t2:
<?php
class t2 extends Phalcon\Mvc\Model
{
public $id;
public $name;
public function initialize()
{
$this->setSource('t2');
}
}
and I do $t1 = t1::findFirst()
, I expected $t1->t2_id
to contain the object of t2
, so I can access the t2
object direclty via $t1->t2_id->id
and $t1->t2_id->name
.
Is that not how it's supposed to work? I couldn't find that specific case in the documentation so any help is appreciated
Thanks