hi
i make a Multiple application.
i used this code for get Comments in Current Item :
$item = \Apps\Main\Models\Items::findFirst($id);
$this->view->setVar('comments',$item->Comments);
in Items.php model :
<?php
namespace Apps\Main\Models;
class Items extends Model
{
public function initialize()
{
$this->hasMany('id','\Apps\Main\Models\Comments','item_id');
}
}
And in Comments.php model:
<?php
namespace Apps\Main\Models;
class Comments extends Model
{
public function initialize()
{
$this->belongsTo('item_id','\Apps\Main\Models\Items','id');
}
}
but Show this error:
Notice: Access to undefined property Apps\Main\Models\Items::Comments in /home/xxx/ebazal.ir/public_html/apps/main/controllers/VController.php on line 135
Why ?
sry for bad type english.