Inheritance: extends Phalcon\Mvc\Micro\Collection, implements PhalconApi\Acl\MountableInterface, implements Phalcon\Mvc\Micro\CollectionInterface
 public function addCollection(ApiCollection $apiCollection)
 {
     $aclRoles = $this->acl->getRoles();
     $collection = new DocumentationCollection();
     $collection->setName($apiCollection->getName());
     $collection->setDescription($apiCollection->getDescription());
     $collection->setPath($apiCollection->getPrefix());
     // Set fields
     if ($apiCollection instanceof ApiResource) {
         if ($modelClass = $apiCollection->getModel()) {
             if ($transformerClass = $apiCollection->getTransformer()) {
                 /** @var ModelTransformer $transformer */
                 $transformer = new $transformerClass();
                 if ($transformer instanceof ModelTransformer) {
                     $transformer->setModelClass($modelClass);
                     $responseFields = $transformer->getResponseProperties();
                     $dataTypes = $transformer->getModelDataTypes();
                     $fields = [];
                     foreach ($responseFields as $field) {
                         $fields[$field] = array_key_exists($field, $dataTypes) ? $dataTypes[$field] : ModelTransformer::TYPE_UNKNOWN;
                     }
                     $collection->setFields($fields);
                 }
             }
         }
     }
     // Add endpoints
     foreach ($apiCollection->getEndpoints() as $apiEndpoint) {
         $endpoint = new DocumentationEndpoint();
         $endpoint->setName($apiEndpoint->getName());
         $endpoint->setDescription($apiEndpoint->getDescription());
         $endpoint->setHttpMethod($apiEndpoint->getHttpMethod());
         $endpoint->setPath($apiEndpoint->getPath());
         $endpoint->setExampleResponse($apiEndpoint->getExampleResponse());
         $allowedRoleNames = [];
         /** @var \Phalcon\Acl\Role $role */
         foreach ($aclRoles as $role) {
             if ($this->acl->isAllowed($role->getName(), $apiCollection->getIdentifier(), $apiEndpoint->getIdentifier())) {
                 $allowedRoleNames[] = $role->getName();
             }
         }
         $endpoint->setAllowedRoles($allowedRoleNames);
         $collection->addEndpoint($endpoint);
     }
     $this->collections[] = $collection;
 }
 public function addCollection(\PhalconRest\Api\ApiCollection $collection)
 {
     foreach ($collection->getEndpoints() as $endpoint) {
         $this->addRequest(new Request($this->id, uniqid(), $collection->getPrefix() . $endpoint->getPath(), $endpoint->getDescription(), $this->basePath . $collection->getPrefix() . $endpoint->getPath(), $endpoint->getHttpMethod(), 'Authorization: Bearer {{authToken}}', null, "raw"));
     }
 }