public function findList($count) { $example = new OW_Example(); $example->setLimitClause(0, $count); $example->setOrder('timeStamp DESC'); return $this->findListByExample($example); }
public function findByUserId($userId, $first, $count) { $example = new OW_Example(); $example->andFieldEqual(self::USER_ID, (int) $userId); $example->setLimitClause($first, $count); return $this->findListByExample($example); }
public function deleteCompletedFeatures() { $perDay = OW::getConfig()->getValue('profileprogressbar', 'per_day'); $example = new OW_Example(); $example->andFieldLessOrEqual(self::TIME_STAMP, strtotime("-{$perDay} day")); return $this->deleteByExample($example); }
public function sendExpiryEmail() { $config = OW::getConfig(); $subject = OW::getLanguage()->text('sponsors', 'reminder_subject'); $content = OW::getLanguage()->text('sponsors', 'reminder_content'); $sitemail = $config->getValue('base', 'site_email'); $sitename = $config->getValue('base', 'site_name'); $mails = array(); $example = new OW_Example(); $example->andFieldEqual('status', 1); $example->andFieldGreaterThan('price', 0); $sponsors = $this->dao->findListByExample($example); foreach ($sponsors as $sponsor) { $cutoffDay = $sponsor->validity - (int) OW::getConfig()->getValue('sponsors', 'cutoffDay'); if ((time() - $sponsor->timestamp) / 86400 > $cutoffDay && $cutoffDay > 0) { $mail = OW::getMailer()->createMail(); $mail->addRecipientEmail($sponsor->email); $mail->setSender($sitemail, $sitename); $mail->setSubject($subject); $mail->setHtmlContent($content); $textContent = strip_tags(preg_replace("/\\<br\\s*[\\/]?\\s*\\>/", "\n", $content)); $mail->setTextContent($textContent); $mails[] = $mail; } } if (count($mails) > 0) { OW::getMailer()->addListToQueue($mails); } }
public function deleteByGroupId($groupId, $status = GHEADER_BOL_Cover::STATUS_ACTIVE) { $example = new OW_Example(); $example->andFieldEqual('groupId', $groupId); $example->andFieldEqual('status', $status); return $this->deleteByExample($example); }
public function findByGroup($groupId) { $example = new OW_Example(); $example->andFieldEqual('groupId', $groupId); $example->setOrder('timestamp DESC'); return $this->findListByExample($example); }
public function findListByCategoryId($id) { $example = new OW_Example(); $example->andFieldEqual('categoryId', $id); $example->setOrder('`order` ASC'); return $this->findListByExample($example); }
/** * * @param int $placeId * @param int $entityId * @return BOL_PlaceScheme */ public function findPlaceScheme($placeId, $entityId) { $example = new OW_Example(); $example->andFieldEqual('placeId', $placeId); $example->andFieldEqual('entityId', $entityId); return $this->findObjectByExample($example); }
public function deleteActivity($questionId, $activityType, $activityId) { $example = new OW_Example(); $example->andFieldEqual('questionId', $questionId); $example->andFieldEqual('activityType', $activityType); $example->andFieldEqual('activityId', $activityId); return $this->deleteByExample($example); }
/** * Returns list of packs for account type * * @param $accountTypeId * @return array */ public function getAllPacks($accountTypeId = null) { $example = new OW_Example(); if ($accountTypeId) { $example->andFieldEqual('accountTypeId', $accountTypeId); } $example->setOrder('`price` ASC'); return $this->findListByExample($example); }
/** * get Config * * @param string $name * @return YNSOCIALBRIDGE_BOL_Apisetting */ public function getConfig($name) { if (!$name) { return null; } $example = new OW_Example(); $example->andFieldEqual('apiName', $name); return $this->findObjectByExample($example); }
public function cleareExpiredNotifyLog($timestamp) { if (empty($timestamp)) { return FALSE; } $example = new OW_Example(); $example->andFieldLessOrEqual(self::TIMESTAMP, $timestamp); return $this->deleteByExample($example); }
public function findByUserIdList(array $userIdList) { if (empty($userIdList)) { return array(); } $example = new OW_Example(); $example->andFieldInArray(self::USER_ID, $userIdList); return $this->findListByExample($example); }
public function findUsersetting($userId, $key) { $example = new OW_Example(); $example->andFieldEqual('userId', $userId); if (!empty($key)) { $example->andFieldEqual('key', $key); } return $this->findObjectByExample($example); }
public function getUpdatedActions() { $ex = new OW_Example(); $ex->andFieldEqual(PRIVACY_BOL_CronDao::IN_PROCESS, 0); $ex->setOrder(PRIVACY_BOL_CronDao::TIMESTAMP); $ex->setLimitClause(0, 500); $objectList = $this->findListByExample($ex); return $objectList; }
public function getBalanceForUserList($ids) { if (!count($ids)) { return array(); } $ids = array_unique($ids); $example = new OW_Example(); $example->andFieldInArray('userId', $ids); return $this->findListByExample($example); }
public function markUnfeatured($videoId) { if (!$videoId) { return false; } $example = new OW_Example(); $example->andFieldEqual('videoId', $videoId); $this->deleteByExample($example); return true; }
public function isDuplicate($category) { $example = new OW_Example(); $example->andFieldEqual('name', $category); if (count($this->findObjectByExample($example)) > 0) { return true; } else { return false; } }
public function deleteIndexItem($entityTypeId, $entityId) { if (empty($entityTypeId) || empty($entityId)) { return FALSE; } $example = new OW_Example(); $example->andFieldEqual(self::ENTITY_TYPE_ID, $entityTypeId); $example->andFieldEqual(self::ENTITY_ID, $entityId); return $this->deleteByExample($example); }
public function deleteByUserId($userId) { $example = new OW_Example(); $example->andFieldEqual('userId', $userId); $this->deleteByExample($example); $example = new OW_Example(); $example->andFieldEqual('oppUserId', $userId); $this->deleteByExample($example); return true; }
public function unmark($userId, $markUserId) { if (empty($userId) || empty($markUserId)) { return NULL; } $example = new OW_Example(); $example->andFieldEqual(self::USER_ID, $userId); $example->andFieldEqual(self::MARK_USER_ID, $markUserId); return $this->deleteByExample($example); }
/** * find User Token * * @param array $params * @return YNSOCIALBRIDGE_BOL_Token */ public function findUserToken($params = array()) { if (!$params) { return null; } $example = new OW_Example(); $example->andFieldEqual('service', $params['service']); $example->andFieldEqual('userId', $params['userId']); return $this->findObjectByExample($example); }
public function getItemCategoryId($eventId) { $example = new OW_Example(); $example->andFieldEqual('eventId', $eventId); $categories = $this->findListByExample($example); if (count($categories) > 0) { return $categories; } else { return false; } }
/** * find User Statistic * * @param array $params * @return YNSOCIALBRIDGE_BOL_Statistic */ public function getTotalInviteOfDay($params = array()) { if (!$params) { return null; } $example = new OW_Example(); $example->andFieldEqual('uid', $params['uid']); $example->andFieldEqual('date', $params['date']); $example->andFieldEqual('service', $params['service']); return $this->findObjectByExample($example); }
public function getAllSteps($page, $onlyActive = 1) { $example = new OW_Example(); if ($page != 'all') { $example->andFieldEqual('page', $page); } if ($onlyActive == 1) { $example->andFieldEqual('active', 1); } $example->setOrder('`page` ASC,`order` ASC'); return $this->findListByExample($example); }
/** * find All Provider * * @param array $params * @return array YNCONTACTIMPORTER_BOL_Provider */ public function getAllProviders($params = array()) { $example = new OW_Example(); if (isset($params['limit'])) { $example->setLimitClause(0, $params['limit']); } if (isset($params['enable'])) { $example->andFieldEqual('enable', $params['enable']); } $example->setOrder("`order`"); return $this->providerDao->getAllProviders($example); }
public function getVideoCategories($videoId) { $example = new OW_Example(); $example->andFieldEqual('videoId', $videoId); $categories = $this->findListByExample($example); $list = array(); foreach ($categories as $category) { $list[] = IVIDEO_BOL_CategoryService::getInstance()->getCategoryName($category->categoryId); } if (count($list) > 0) { return $list; } else { return false; } }
/** * Return search result item count * * @param int $listId * @param int $first * @param int $count * return array */ public function getUserIdList($listId, $first, $count, $excludeList = array()) { $example = new OW_Example(); $example->andFieldEqual('searchId', (int) $listId); $example->setOrder(' sortOrder '); $example->setLimitClause($first, $count); if (!empty($excludeList)) { $example->andFieldNotInArray('userId', $excludeList); } $results = BOL_SearchResultDao::getInstance()->findListByExample($example); $userIdList = array(); foreach ($results as $result) { $userIdList[] = $result->userId; } return $userIdList; }
public function processScheduler() { /** * following step to speed up & beat performance * 1. check album limit * 2. check quota limit * 3. get nodes of this schedulers * 4. get all items of current schedulers. * 5. process each node * 5.1 check required quota * 5.2 fetch data to pubic file * 5.3 store to file model * 6. check status of schedulers, if scheduler is completed == (remaining == 0) * 6.1 udpate feed and message. */ /** * Unlimited time. */ set_time_limit(0); /** * default 20 * @var int */ $configs = OW::getConfig()->getValues('ynmediaimporter'); $limitUserPerCron = $configs['number_photo'] ? intval($configs['number_photo']) : 20; /** * default 20 * @var int */ $limitQueuePerCron = $configs['number_queue'] ? intval($configs['number_queue']) : 20; /** * process number queue. */ /** * get scheduler from tables data. */ $example = new OW_Example(); $example->andFieldLessThan('status', '3'); $example->setOrder('last_run'); $example->setLimitClause($first, $count)->setLimitClause(0, $limitQueuePerCron); $schedulers = YNMEDIAIMPORTER_BOL_SchedulerDao::getInstance()->findListByExample($example); foreach ($schedulers as $scheduler) { Ynmediaimporter::processScheduler($scheduler, 0, $limitUserPerCron, 1, 1); } echo "success!"; exit(0); }
public function findRuleList($userId, $actions = null) { $example = new OW_Example(); $example->andFieldEqual('userId', $userId); if (!empty($actions)) { $example->andFieldInArray('action', $actions); } return $this->findListByExample($example); }