function __construct(AccountStore $accountStore, $idOrFields = null) { $this->apiBase = $accountStore->getApiBase(); parent::__construct(); $this->accountStore = $accountStore; if (is_array($idOrFields)) { $this->fields = $idOrFields; } else { if (is_numeric($idOrFields)) { $this->id = $idOrFields; } } }
/** * AtomxClient constructor. * @param TokenStore|null $tokenStore * @param int|array $idOrFields * @param string $apiBase */ function __construct($tokenStore = null, $idOrFields = null) { if ($tokenStore) { $this->tokenStore = $tokenStore; $this->apiBase = $tokenStore->getApiBase(); } else { if ($this->requiresToken) { throw new \InvalidArgumentException("{$this->endpoint} endpoint requires a TokenStore for the token"); } else { $this->apiBase = AtomxClient::API_BASE; } } parent::__construct(); if (is_array($idOrFields)) { $this->fields = $idOrFields; } else { if (is_numeric($idOrFields)) { $this->id = $idOrFields; } } }