function changeFeature($cid, $value) { $obj_table = YiiArticle::getInstance(); $obj_table = $obj_table->loadItem($cid); // check quyen so huu global $user; if (!($bool = $user->modifyChecking($obj_table->created_by))) { $obj_users = YiiUser::getInstance(); $item_user = $obj_users->getUser($obj_table->created_by); YiiMessage::raseNotice("Your account not have permission to modify resource of: {$item_user->username}"); $this->redirect(Router::buildLink("articles")); return false; } $obj_table->feature = $value; $obj_table->store(); }
public function getItem($cid) { $obj_table = YiiArticle::getInstance(); $result = $obj_table->loadItem($cid); return $result; }