/** * Load the records for this relation. * * @param Db $db The database object * @param array $record The record * @param string $mode * * @return array Array with records */ public function load($db, $record, $mode) { $res = parent::load($db, $record, $mode); $ret['selected'] = $res; return $ret; }
/** * Load function. * * @param Db $db database instance. * @param array $record record * @param string $mode load mode * * @return array values */ public function load($db, $record, $mode) { if (!$this->hasPositionAttribute()) { return parent::load($db, $record, $mode); } $this->createLink(); $where = $this->_getLoadWhereClause($record); $link = $this->getLink(); return $link->select()->where($where)->orderBy($link->getTable() . '.' . $this->getPositionAttribute())->getAllRows(); }