Scalr_Account::loadById PHP Method

loadById() public method

public loadById ( $id ) : Scalr_Account
return Scalr_Account
    public function loadById($id)
    {
        return parent::loadById($id);
    }

Usage Example

Exemplo n.º 1
0
 protected function getUserInfoByAccountId($accountId)
 {
     if (!isset($this->accountsCache[$accountId])) {
         if ($accountId) {
             try {
                 $acc = new \Scalr_Account();
                 $acc->loadById($accountId);
                 $this->accountsCache[$accountId] = array('id' => $acc->getOwner()->id, 'email' => $acc->getOwner()->getEmail());
             } catch (\Exception $e) {
                 $this->console->error($e->getMessage());
                 return array('id' => 0, 'email' => '');
             }
         } else {
             $user = new \Scalr_Account_User();
             $user->loadByEmail('admin', 0);
             $this->accountsCache[$accountId] = array('id' => $user->id, 'email' => $user->getEmail());
         }
     }
     return $this->accountsCache[$accountId];
 }
All Usage Examples Of Scalr_Account::loadById