/** * add record * * @param App_Search_Dm $dm * @return multitype:|Ambigous <boolean, number, string, rowCount> */ public function add(App_Search_Dm $dm) { if (true !== ($r = $dm->beforeAdd())) { return $r; } return $this->loadDao()->add($dm->getData()); }
private function saveSearchInfomation($keyword, $type) { $userId = $this->loginUser->uid; $schoolId = $this->getCurrentSchoolId(); if ($type == 'h') { $shop = $keyword; $type = $type; } else { $shop = $this->getInput("shop"); $type = $this->getInput("type"); } $dm = new App_Search_Dm(); $dm->setUid($userId)->setSchoolid($schoolId)->setKeyword($shop)->setSearchType($type); $result = $this->_getSearchDs()->add($dm); }
private function _checkSearch() { $loginUser = Wekit::getLoginUser(); $search_time_interval = $loginUser->getPermission('app_search_time_interval'); $stampTime = Pw::getTime(); if ($stampTime - $loginUser->info['last_search_time'] < $search_time_interval) { return new PwError('permission.search.limittime.allow', array('{limittime}' => $search_time_interval)); } Wind::import('EXT:search.service.dm.App_Search_Dm'); $dm = new App_Search_Dm($loginUser->uid); $dm->setLastSearchTime($stampTime); Wekit::load('user.PwUser')->editUser($dm, PwUser::FETCH_DATA); return true; }