function actionUsersAll() { $user = YDDatabaseObject::getInstance('user'); $user->id = 1; $user->findAll(); $this->template->assign('find1_results', YDDebugUtil::r_dump($user->getResults())); $user->resetAll(); $user->id = 1; $user->find('phone', 'group'); $this->template->assign('find2_results', YDDebugUtil::r_dump($user->getResults())); $this->template->display('users_all'); }
/** * This function returns the column name of a defined field. * * @param $field The field name. * @param $alias (optional) If true, returns the table alias * with the column name. Default: false. * * @returns The column name with or without the table alias. */ function getCrossColumn($field, $alias = false) { if (!isset($this->cross_obj)) { $this->cross_obj = YDDatabaseObject::getInstance($this->getCrossClass()); } return $this->cross_obj->getColumn($field, $alias); }
/** * @returns The cross table name. */ function getCrossTable() { if (!isset($this->cross_obj)) { $this->cross_obj = YDDatabaseObject::getInstance($this->getCrossClass()); } return $this->cross_obj->getTable(); }
/** * This function will overide the YDDatabaseObject to reset object but init order */ function resetAll() { parent::resetAll(); $this->order($this->_tree_order); }