Example #1
0
 /**
  * Pobranie instacji Klienta na podstawie id użytkownika (potrzebne dla wywołań via CLI)
  * @param integer $idUser
  * @return Logic_Client
  * @throws Logic_Exception
  */
 public static function getInstanceByClient($clientId)
 {
     $user = new Logic_User();
     $clientId = $user->getAssignetWsClientId($idUser);
     if (null === $clientId) {
         throw new Logic_Exception("User with ID={$idUser} does not have any Client assigned!");
     }
     $client = new Wsclient();
     $clientRow = $client->getClient($clientId);
     if (null === $clientRow) {
         throw new Logic_Exception("Client with ID={$clientId} is not present or it has been ghosted!");
     }
     return self::getInstance(null, $clientRow->id);
 }