/** * Get singletom instance * @return Thethao_Model_Article * @author LamTX */ public static final function getInstance() { //Check instance if (is_null(self::$_instance)) { self::$_instance = new self(); } //Return instance return self::$_instance; }
/** * job delete article * @param type $data * @return type */ public function deleteArticle($params) { //default return $response = false; try { $modelArticle = Thethao_Model_Article::getInstance(); if (isset($params['isMulti']) && $params['isMulti'] === true) { foreach ($params['arrArticles'] as $articleDetail) { $response[] = $modelArticle->deleteArticle($articleDetail); } } else { $articleDetail = $params['old_detail']; $response = $modelArticle->deleteArticle($articleDetail); } //clear cache file self::clearApcFile(); } catch (Exception $ex) { //log error Thethao_Global::sendLog($ex); } return $response; }