/** * Returns an instance of class (singleton pattern implementation). * * @return BOL_UserDao */ public static function getInstance() { if (self::$classInstance === null) { self::$classInstance = new self(); } return self::$classInstance; }
/** * Checks and raises event on users birthday list. */ public function checkBirthdays() { $configTs = OW::getConfig()->getValue('birthdays', 'users_birthday_event_ts'); if (date('j', $configTs) !== date('j', time())) { $userList = $this->birthdaysDao->findUserListByBirthday(date('Y-m-d')); $event = new OW_Event('birthdays.today_birthday_user_list', array('userIdList' => $userList)); OW::getEventManager()->trigger($event); OW::getConfig()->saveConfig('birthdays', 'users_birthday_event_ts', time()); } }