コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function process($context, Result $result, Collection $collection)
 {
     $model = $context->getAnnotation()->toModel();
     if ($operation = $result->getCurrent('operation')) {
         $operation->addResponse($model);
     }
     $result->set('response', $model->getCode(), $model);
 }
コード例 #2
0
 /**
  * {@inheritdoc}
  */
 public function process($context, Result $result, Collection $collection)
 {
     $model = $context->getAnnotation()->toModel();
     if ($api = $result->getCurrent('api')) {
         $api->addResource($model);
     }
     $result->set('resource', $model->getId(), $model);
 }
コード例 #3
0
 /**
  * {@inheritdoc}
  */
 public function process($context, Result $result, Collection $collection)
 {
     $model = $context->getAnnotation()->toModel();
     if ($operation = $result->getCurrent('operation')) {
         $operation->addParameter($model);
     }
     $result->set('parameter', $model->getId(), $model);
 }
コード例 #4
0
 /**
  * {@inheritdoc}
  */
 public function process($context, Result $result, Collection $collection)
 {
     $model = $context->getAnnotation()->toModel();
     if ($model->getId() === null && $context->getContext() instanceof PHPFunction) {
         $model->setId($context->getContext()->getFunction());
     }
     if ($resource = $result->getCurrent('resource')) {
         $resource->addOperation($model);
     }
     $result->set('operation', $model->getId(), $model);
 }
コード例 #5
0
ファイル: ApiProcessor.php プロジェクト: dokapi/dokapi-rest
 /**
  * {@inheritdoc}
  */
 public function process($context, Result $result, Collection $collection)
 {
     $model = $context->getAnnotation()->toModel();
     $result->set('api', $model->getId(), $model);
 }