Example #1
0
 /**
  * @param array $config
  * @param array $params
  * @throws ApiRequestException
  */
 public function __construct($config, $params = [])
 {
     $this->default_params['filter'] = new Node('filter');
     if (isset($params['client_id'])) {
         $ownerIdNode = new Node('owner-id', $params['client_id']);
         $params['filter'] = new Node('filter', $ownerIdNode);
     }
     parent::__construct($config, $params);
 }
Example #2
0
 /**
  * ListSubdomains constructor.
  * @param array $config
  * @param array $params
  */
 public function __construct(array $config, array $params = [])
 {
     $this->default_params['filter'] = new Node('filter');
     if (isset($params['domain'])) {
         $ownerIdNode = new Node('site-name', $params['domain']);
         $params['filter'] = new Node('filter', $ownerIdNode);
     }
     if (isset($params['site_id'])) {
         $ownerIdNode = new Node('site-id', $params['site_id']);
         $params['filter'] = new Node('filter', $ownerIdNode);
     }
     parent::__construct($config, $params);
 }
Example #3
0
 /**
  * @param array $config
  * @param array $params
  * @param HttpRequestContract $http
  * @throws ApiRequestException
  */
 public function __construct(array $config, array $params = [], HttpRequestContract $http = null)
 {
     $filterChildNodes = [];
     foreach (['owner-id', 'owner-login', 'guid', 'id'] as $nodeName) {
         if (isset($params[$nodeName])) {
             if (!is_array($params[$nodeName])) {
                 $params[$nodeName] = [$params[$nodeName]];
             }
             foreach ($params[$nodeName] as $value) {
                 $filterChildNodes[] = new Node($nodeName, $value);
             }
         }
     }
     $params = ['filter' => new NodeList($filterChildNodes)];
     parent::__construct($config, $params, $http);
 }
 /**
  * @param array $config
  * @param array $params
  * @param HttpRequestContract $http
  * @throws ApiRequestException
  */
 public function __construct(array $config, array $params = [], HttpRequestContract $http = null)
 {
     $filterNode = new Node('filter');
     if (isset($params['package-id'])) {
         if (!is_array($params['package-id'])) {
             $params['package-id'] = [$params['package-id']];
         }
         $idNodes = [];
         foreach ($params['package-id'] as $id) {
             $idNodes[] = new Node('package-id', $id);
         }
         $filterNode->setValue(new Node('package-id', new NodeList($idNodes)));
     }
     $params['filter'] = $filterNode;
     parent::__construct($config, $params, $http);
 }
 /**
  * @param array $config
  * @param array $params
  * @param HttpRequestContract|null $http
  */
 public function __construct(array $config, array $params = [], HttpRequestContract $http = null)
 {
     $optionsNodes = [];
     $optionsNodes[] = $this->getIdentifierNode($params);
     if ($databaseNode = $this->getDatabaseNode($params)) {
         $optionsNodes[] = $databaseNode;
     }
     if ($settingsNode = $this->getSettingsNode($params)) {
         $optionsNodes[] = $settingsNode;
     }
     if (isset($params['ssl'])) {
         $optionsNodes[] = new Node('ssl', $params['ssl']);
     }
     if (isset($params['url-prefix'])) {
         $optionsNodes[] = new Node('url-prefix', $params['url-prefix']);
     }
     $params['options'] = new NodeList($optionsNodes);
     parent::__construct($config, $params, $http);
 }
Example #6
0
 /**
  * @param array $config
  * @param array $params
  * @throws ApiRequestException
  */
 public function __construct($config, $params = [])
 {
     $filterChildNodes = [];
     foreach (['name', 'owner-id', 'owner-login', 'guid', 'id'] as $nodeName) {
         if (isset($params[$nodeName])) {
             if (!is_array($params[$nodeName])) {
                 $params[$nodeName] = [$params[$nodeName]];
             }
             foreach ($params[$nodeName] as $value) {
                 $filterChildNodes[] = new Node($nodeName, $value);
             }
         }
     }
     $filter = [new Node('filter', new NodeList($filterChildNodes))];
     if (isset($params['since_date'])) {
         $filter[] = new Node('since_date', $params['since_date']);
     }
     if (isset($params['to_date'])) {
         $filter[] = new Node('to_date', $params['to_date']);
     }
     $params = ['filter' => new NodeList($filter)];
     parent::__construct($config, $params);
 }
 /**
  * @param array $config
  * @param array $params
  * @param HttpRequestContract $http
  * @throws ApiRequestException
  */
 public function __construct(array $config, array $params = [], HttpRequestContract $http = null)
 {
     if (isset($params['admin']) && $params['admin'] === true) {
         $params['destination'] = new Node('admin');
     }
     if (isset($params['webspace'])) {
         $params['destination'] = new Node('webspace', $params['webspace']);
     }
     if (!isset($params['destination'])) {
         throw new ApiRequestException('admin or webspace parameter is required');
     }
     if (isset($params['crt'])) {
         $params['crt'] = new Node('crt', $params['crt']);
     } else {
         $params['crt'] = '';
     }
     if (isset($params['ca'])) {
         $params['ca'] = new Node('ca', $params['ca']);
     } else {
         $params['ca'] = '';
     }
     parent::__construct($config, $params, $http);
 }
Example #8
0
 /**
  * @param array $config
  * @param array $params
  * @param HttpRequestContract|null $http
  */
 public function __construct(array $config, array $params = [], HttpRequestContract $http = null)
 {
     $helper = new MailPreferences();
     $params['prefs'] = $helper->generate($params);
     parent::__construct($config, $params, $http);
 }