/** * Returns class instance * * @return YNSOCIALBRIDGE_BOL_StatisticService */ public static function getInstance() { if (!isset(self::$classInstance)) { self::$classInstance = new self(); } return self::$classInstance; }
public function createOrUpdateStatistic($params = array()) { $statistic = YNSOCIALBRIDGE_BOL_StatisticService::getInstance()->getTotalInviteOfDay($params); if ($statistic) { $statistic->inviteOfDay = $params['inviteOfDay']; } else { $statistic = new YNSOCIALBRIDGE_BOL_Statistic(); $statistic->service = $params['service']; $statistic->userId = $params['userId']; $statistic->uid = $params['uid']; $statistic->inviteOfDay = $params['inviteOfDay']; $statistic->date = $params['date']; } YNSOCIALBRIDGE_BOL_StatisticService::getInstance()->save($statistic); }