public function clean($ttl) { $users = SessionDAO::create()->getObsoleteUserIds(DbQueryHelper::timestamp2date(time() - $ttl)); if (!empty($users)) { SessionDAO::create()->dropByUserIdList($users); PropertiesDAO::create()->dropByUserIdList($users); UserBlacklistDAO::create()->dropByUserIdList($users); UserNotesDAO::create()->dropByUserIdList($users); UserDAO::create()->dropByUserIdList($users); } }
/** * @return UserNotesDAO|null */ public function getUserNotes() { if (!$this[self::NOTES] && $this->getId()) { $this[self::NOTES] = UserNotesDAO::create()->getByUserId($this->getId()); } return $this[self::NOTES]; }