Scalr_Account_User::init PHP Method

init() public static method

public static init ( $className = null ) : Scalr_Account_User
return Scalr_Account_User
    public static function init($className = null)
    {
        return parent::init();
    }

Usage Example

Example #1
0
 public function getAccountUsersList()
 {
     if ($this->user->canManageAcl()) {
         $result = $this->db->getAll('SELECT account_users.id FROM account_users WHERE account_id = ?', array($this->user->getAccountId()));
         foreach ($result as &$row) {
             $row = Scalr_Account_User::init()->loadById($row['id'])->getUserInfo();
         }
     } else {
         $result = array();
         $teams = $this->user->getTeams();
         if (!empty($teams)) {
             $sql = '
                 SELECT u.id, u.fullname, u.email
                 FROM account_users u
                 INNER JOIN account_team_users tu ON u.id = tu.user_id
                 WHERE account_id= ?';
             $params[] = $this->user->getAccountId();
             foreach ($teams as $team) {
                 $r[] = 'tu.team_id = ?';
                 $params[] = $team['id'];
             }
             $sql .= ' AND (' . implode(' OR ', $r) . ')';
             $result = $this->db->getAll($sql, $params);
         }
     }
     return $result;
 }
All Usage Examples Of Scalr_Account_User::init