My first model class:
class Ads extends \Phalcon\Mvc\Model
{
public function initialize()
{
$this->belongsTo(
'app_id',
Apps::class,
'id',
[
'alias' => 'app',
'reusable' => true,
'params'=>[ // When I use this params, the parent relation not work!!!
'columns' => 'id, name, pid',
]
]
);
}
}
The second model class:
class Apps extends \Phalcon\Mvc\Model
{
public function initialize()
{
$this->belongsTo(
'pid',
self::class,
'id',
['alias' => 'parent','reusable' => true,]
);
}
}
If I used params
columns
in model Ads
, the second parent
relation not work