@@ -25,72 +25,72 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | class Api |
| 27 | 27 | { |
| 28 | - /** |
|
| 29 | - * @var EndpointsContainer |
|
| 30 | - */ |
|
| 31 | - protected $endpointsContainer; |
|
| 28 | + /** |
|
| 29 | + * @var EndpointsContainer |
|
| 30 | + */ |
|
| 31 | + protected $endpointsContainer; |
|
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * @var string |
|
| 35 | - */ |
|
| 36 | - protected $organizationId; |
|
| 33 | + /** |
|
| 34 | + * @var string |
|
| 35 | + */ |
|
| 36 | + protected $organizationId; |
|
| 37 | 37 | |
| 38 | - public function __construct(EndpointsContainer $endpointsContainer) |
|
| 39 | - { |
|
| 40 | - $this->endpointsContainer = $endpointsContainer; |
|
| 41 | - } |
|
| 38 | + public function __construct(EndpointsContainer $endpointsContainer) |
|
| 39 | + { |
|
| 40 | + $this->endpointsContainer = $endpointsContainer; |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - /** |
|
| 44 | - * Magic method to access different endpoints. |
|
| 45 | - * |
|
| 46 | - * @param string $endpoint |
|
| 47 | - * |
|
| 48 | - * @return Endpoint |
|
| 49 | - */ |
|
| 50 | - public function __get($endpoint) |
|
| 51 | - { |
|
| 52 | - $endpoint = $this->endpointsContainer->resolve($endpoint); |
|
| 43 | + /** |
|
| 44 | + * Magic method to access different endpoints. |
|
| 45 | + * |
|
| 46 | + * @param string $endpoint |
|
| 47 | + * |
|
| 48 | + * @return Endpoint |
|
| 49 | + */ |
|
| 50 | + public function __get($endpoint) |
|
| 51 | + { |
|
| 52 | + $endpoint = $this->endpointsContainer->resolve($endpoint); |
|
| 53 | 53 | |
| 54 | - if (method_exists($endpoint, 'setOrganizationId')) { |
|
| 55 | - $endpoint->setOrganizationId($this->organizationId); |
|
| 56 | - } |
|
| 54 | + if (method_exists($endpoint, 'setOrganizationId')) { |
|
| 55 | + $endpoint->setOrganizationId($this->organizationId); |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | - return $endpoint; |
|
| 59 | - } |
|
| 58 | + return $endpoint; |
|
| 59 | + } |
|
| 60 | 60 | |
| 61 | - /** |
|
| 62 | - * @param string $organization |
|
| 63 | - * @return $this |
|
| 64 | - */ |
|
| 65 | - public function setOrganization($organization) |
|
| 66 | - { |
|
| 67 | - $organizations = $this->organizations->getAll(); |
|
| 68 | - foreach ($organizations['entities'] as $entity) { |
|
| 69 | - if($entity['name'] == $organization) { |
|
| 70 | - $this->organizationId = $entity['organizationId']; |
|
| 71 | - } |
|
| 72 | - } |
|
| 61 | + /** |
|
| 62 | + * @param string $organization |
|
| 63 | + * @return $this |
|
| 64 | + */ |
|
| 65 | + public function setOrganization($organization) |
|
| 66 | + { |
|
| 67 | + $organizations = $this->organizations->getAll(); |
|
| 68 | + foreach ($organizations['entities'] as $entity) { |
|
| 69 | + if($entity['name'] == $organization) { |
|
| 70 | + $this->organizationId = $entity['organizationId']; |
|
| 71 | + } |
|
| 72 | + } |
|
| 73 | 73 | |
| 74 | - return $this; |
|
| 75 | - } |
|
| 74 | + return $this; |
|
| 75 | + } |
|
| 76 | 76 | |
| 77 | - /** |
|
| 78 | - * @param int $organizationId |
|
| 79 | - * @return $this |
|
| 80 | - */ |
|
| 81 | - public function setOrganizationId($organizationId) |
|
| 82 | - { |
|
| 83 | - $this->organizationId = $organizationId; |
|
| 77 | + /** |
|
| 78 | + * @param int $organizationId |
|
| 79 | + * @return $this |
|
| 80 | + */ |
|
| 81 | + public function setOrganizationId($organizationId) |
|
| 82 | + { |
|
| 83 | + $this->organizationId = $organizationId; |
|
| 84 | 84 | |
| 85 | - return $this; |
|
| 86 | - } |
|
| 85 | + return $this; |
|
| 86 | + } |
|
| 87 | 87 | |
| 88 | 88 | |
| 89 | - /** |
|
| 90 | - * @return string |
|
| 91 | - */ |
|
| 92 | - public function getOrganizationId() |
|
| 93 | - { |
|
| 94 | - return $this->organizationId; |
|
| 95 | - } |
|
| 89 | + /** |
|
| 90 | + * @return string |
|
| 91 | + */ |
|
| 92 | + public function getOrganizationId() |
|
| 93 | + { |
|
| 94 | + return $this->organizationId; |
|
| 95 | + } |
|
| 96 | 96 | } |
| 97 | 97 | \ No newline at end of file |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | { |
| 67 | 67 | $organizations = $this->organizations->getAll(); |
| 68 | 68 | foreach ($organizations['entities'] as $entity) { |
| 69 | - if($entity['name'] == $organization) { |
|
| 69 | + if ($entity['name'] == $organization) { |
|
| 70 | 70 | $this->organizationId = $entity['organizationId']; |
| 71 | 71 | } |
| 72 | 72 | } |