/***controller***/ $oPublication = new oPublication(); $oPublication->where('id', $aParams['id'])->get(); //i want to get all images of this publciation $oPublicacion->image->get();
/*** Model Publication ***/ class Publication extends DataMapper { var $table = 'publication'; var $has_one = array("image") function __construct($id = NULL) { parent::__construct($id); } } /*** Model Image***/ class Image extends DataMapper { var $table = 'image'; //var $has_many = array("publication") this is wrong //what should i do here ???? function __construct($id = NULL) { parent::__construct($id); } }