/**
  * @param Limit $limit
  *
  * @return ClientProxyDataRetrieveResult|Traversable
  */
 public function getAll(Limit $limit)
 {
     $retrieveResult = new ClientProxyDataRetrieveResult();
     $retrieveQuery = ClientProxyEntity::find();
     $countQuery = $retrieveQuery->prepare(new Query());
     $retrieveResult->totalItems = $countQuery->count();
     $items = ClientProxyEntity::find()->with('endpoints')->limit($limit->getSize())->offset($limit->getOffset())->all();
     $clientProxies = [];
     foreach ($items as $item) {
         $clientProxy = $this->_mapper->entityToContract($item);
         $endpointList = [];
         foreach ($item->endpoints as $endpointEntityItem) {
             $endpointList[] = $this->_endpointMapper->entityToContract($endpointEntityItem);
         }
         $clientProxy->endpointList = $endpointList;
         $clientProxies[] = $clientProxy;
     }
     $retrieveResult->dataItems = $clientProxies;
     return $retrieveResult;
 }
 public function getVendor()
 {
     return $this->hasOne(ClientProxyEntity::className(), ['id' => 'proxyId']);
 }