I have this model code:
class TvguideChannel extends Model{
public function initialize() {
$this->setSource('tvguide_channel');
$this->setConnectionService('db');
$this->hasMany('code', __NAMESPACE__.'\Tvguide', "ch_code", ['alias' => 'Tvguide']);
}
public function getSource() {
return 'tvguide_channel';
}
}
And Controller:
$data = TvguideChannel::find();
$dateDetails = $data->getTvguide(['order' => '$_POST["time"] DESC']);
$paginator = new PaginatorModel(
array(
"data" => $data,
"limit" => $limit,
"page" => $curPage
)
);
$items = $paginator->getPaginate();
This is not working. How I Can use columns from Tvguide model in controller? Thanks for help.