/**
  * Returns an instance of class (singleton pattern implementation).
  *
  * @return BOL_AuthorizationModeratorDao
  */
 public static function getInstance()
 {
     if (self::$classInstance === null) {
         self::$classInstance = new self();
     }
     return self::$classInstance;
 }
Esempio n. 2
0
 public function deleteModerator($moderatorId)
 {
     $moderatorId = (int) $moderatorId;
     $adminGroupId = $this->getAdminGroupId();
     if ($this->moderatorPermissionDao->getId($moderatorId, $adminGroupId) !== null) {
         return false;
     }
     $removed = $this->moderatorDao->deleteById($moderatorId) > 0;
     // ? true : false;
     if ($removed) {
         $this->moderatorPermissionDao->deleteByModeratorId($moderatorId);
     }
     return $removed;
 }