| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- <?php
- namespace ModulesGarden\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap;
- use ModulesGarden\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Interfaces\AbstractApiClient;
- use ModulesGarden\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Interfaces\AbstractConnection;
- use ModulesGarden\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Repository\Accounts;
- use ModulesGarden\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Repository\Ressources;
- use ModulesGarden\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Repository\ClassOfServices;
- use ModulesGarden\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Repository\Server;
- use ModulesGarden\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Repository\DistributionLists;
- use ModulesGarden\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Repository\Domains;
- use ModulesGarden\Servers\KerioEmail\App\Traits\StorageTrait;
- /**
- *
- * Created by PhpStorm.
- * User: Tomasz Bielecki ( tomasz.bi@modulesgarden.com )
- * Date: 09.09.19
- * Time: 09:37
- * Class Repository
- * @property ClassOfServices $cos
- * @property Domains $domains
- * @property Accounts $accounts
- * @property DistributionLists $lists
- */
- class Repository extends AbstractApiClient
- {
- use StorageTrait;
- public function __get($name)
- {
- $name = strtolower($name);
- $exists = $this->getStorage()->exists($name);
- if(!$exists && method_exists($this, $name))
- {
- $action = $this->$name();
- $this->getStorage()->set($name, $action);
- }elseif(!$exists)
- {
- }elseif($exists){
- $action = $this->getStorage()->get($name);
- }else{
- throw new \Exception("Repository `{$name}` not found");
- }
- return $action;
- }
- /**
- * @return Server
- */
- public function server()
- {
- return new Server($this->getClient());
- }
- /**
- * @return ClassOfServices
- */
- public function cos()
- {
- return new ClassOfServices($this->getClient());
- }
- /**
- * @return Domains
- */
- public function domains()
- {
- return new Domains($this->getClient());
- }
- /**
- * @return Accounts
- */
- public function accounts()
- {
- return new Accounts($this->getClient());
- }
- /**
- * @return Ressources
- */
- public function ressources()
- {
- return new Ressources($this->getClient());
- }
- /**
- *
- */
- public function lists()
- {
- return new DistributionLists($this->getClient());
- }
- }
|