private function configureGet(Get $operation, array $options)
    {
        if (!$operation->summary) {
            if ($options['returns'] == Route::RETURNS_ENTITY) {
                $operation->summary = 'Fetch a '.$options['entity_name'].' entity';
            } else {
                $operation->summary = 'Fetch a collection of '.$options['entity_name'].' entities';
            }
        }

        // verify that the x-collection property is set
        if ($options['returns'] == Route::RETURNS_COLLECTION) {
            $schema = [
                'type' => 'array',
                'items' => [
                    '$ref' => '#/definitions/'.$options['entity_name'],
                ],
            ];
        } else {
            $schema = [
                '$ref' => '#/definitions/'.$options['entity_name'],
            ];
        }

        if ($options['returns'] == Route::RETURNS_ENTITY) {
            $successText = 'Entity Found and Returned';
        } else {
            $successText = 'Entity Collection Found and Returned';
        }

        $this->appendResponses(
            $operation,
            [
                new Response(
                    [
                        'response' => 200,
                        'description' => $successText,
                        'schema' => $schema,
                    ]
                ),
                new Response(
                    [
                        'response' => 404,
                        'description' => 'Entity Not Found',
                    ]
                ),
            ]
        );
    }
private function configureGet(Get $operation, array $options)
    {
        if (!$operation->summary) {
            if ($options['returns'] == Route::RETURNS_ENTITY) {
                $operation->summary = 'Fetch a '.$options['entity_name'].' entity';
            } else {
                $operation->summary = 'Fetch a collection of '.$options['entity_name'].' entities';
            }
        }

        // verify that the x-collection property is set
        if ($options['returns'] == Route::RETURNS_COLLECTION) {
            $schema = [
                'type' => 'array',
                'items' => [
                    '$ref' => '#/definitions/'.$options['entity_name'],
                ],
            ];
        } else {
            $schema = [
                '$ref' => '#/definitions/'.$options['entity_name'],
            ];
        }

        if ($options['returns'] == Route::RETURNS_ENTITY) {
            $successText = 'Entity Found and Returned';
        } else {
            $successText = 'Entity Collection Found and Returned';
        }

        $this->appendResponses(
            $operation,
            [
                new Response(
                    [
                        'response' => 200,
                        'description' => $successText,
                        'schema' => $schema,
                    ]
                ),
                new Response(
                    [
                        'response' => 404,
                        'description' => 'Entity Not Found',
                    ]
                ),
            ]
        );
    }
private function configureGet ( Get $ operation , array $ options ) { if ( ! $ operation -> summary ) { if ( $ options [ 'returns' ] == Route :: RETURNS_ENTITY ) { $ operation -> summary = 'Fetch a ' . $ options [ 'entity_name' ] . ' entity' ; } else { $ operation -> summary = 'Fetch a collection of ' . $ options [ 'entity_name' ] . ' entities' ; } } // verify that the x-collection property is set if ( $ options [ 'returns' ] == Route :: RETURNS_COLLECTION ) { $ schema = [ 'type' => 'array' , 'items' => [ '$ref' => '#/definitions/' . $ options [ 'entity_name' ] , ] , ] ; } else { $ schema = [ '$ref' => '#/definitions/' . $ options [ 'entity_name' ] , ] ; } if ( $ options [ 'returns' ] == Route :: RETURNS_ENTITY ) { $ successText = 'Entity Found and Returned' ; } else { $ successText = 'Entity Collection Found and Returned' ; } $ this -> appendResponses ( $ operation , [ new Response ( [ 'response' => 200 , 'description' => $ successText , 'schema' => $ schema , ] ) , new Response ( [ 'response' => 404 , 'description' => 'Entity Not Found' , ] ) , ] ) ; }
Configure a Get annotation with FosRest data.

@param Get   $operation
@param array $options
Configure a Get annotation with FosRest data .