HydraApi.php
private function documentOperations($operations)
    {
        if (null === $operations) {
            return null;
        }

        $result = array();

        foreach ($operations as $operation) {
            $statusCodes = array();
            foreach ($operation->getStatusCodes() as $code => $description) {
                $statusCodes[] = array(
                    'code' => $code,
                    'description' => $description
                );
            }

            $result[] = array(
                '@id' => '_:' . $operation->getName(),
                '@type' => $operation->getType() ?: 'hydra:Operation',
                'method' => $operation->getMethod(),
                'label' => ($operation->getTitle())
                    ?
                    : $operation->getDescription(),
                'description' => (null === $operation->getTitle())
                    ? null
                    : $operation->getDescription(),
                'expects' => $this->getTypeReferenceIri($operation->getExpects()),
                'returns' => $this->getTypeReferenceIri($operation->getReturns()),
                'statusCodes' => $statusCodes
            );
        }

        return $result;
    }
private function documentOperations($operations)
    {
        if (null === $operations) {
            return null;
        }

        $result = array();

        foreach ($operations as $operation) {
            $statusCodes = array();
            foreach ($operation->getStatusCodes() as $code => $description) {
                $statusCodes[] = array(
                    'code' => $code,
                    'description' => $description
                );
            }

            $result[] = array(
                '@id' => '_:' . $operation->getName(),
                '@type' => $operation->getType() ?: 'hydra:Operation',
                'method' => $operation->getMethod(),
                'label' => ($operation->getTitle())
                    ?
                    : $operation->getDescription(),
                'description' => (null === $operation->getTitle())
                    ? null
                    : $operation->getDescription(),
                'expects' => $this->getTypeReferenceIri($operation->getExpects()),
                'returns' => $this->getTypeReferenceIri($operation->getReturns()),
                'statusCodes' => $statusCodes
            );
        }

        return $result;
    }
private function documentOperations ( $ operations ) { if ( null === $ operations ) { return null ; } $ result = array ( ) ; foreach ( $ operations as $ operation ) { $ statusCodes = array ( ) ; foreach ( $ operation -> getStatusCodes ( ) as $ code => $ description ) { $ statusCodes [ ] = array ( 'code' => $ code , 'description' => $ description ) ; } $ result [ ] = array ( '@id' => '_:' . $ operation -> getName ( ) , '@type' => $ operation -> getType ( ) ? : 'hydra:Operation' , 'method' => $ operation -> getMethod ( ) , 'label' => ( $ operation -> getTitle ( ) ) ? : $ operation -> getDescription ( ) , 'description' => ( null === $ operation -> getTitle ( ) ) ? null : $ operation -> getDescription ( ) , 'expects' => $ this -> getTypeReferenceIri ( $ operation -> getExpects ( ) ) , 'returns' => $ this -> getTypeReferenceIri ( $ operation -> getReturns ( ) ) , 'statusCodes' => $ statusCodes ) ; } return $ result ; }
Creates a JSON-LD serialization of the passed operations

@param array|null $operations The operations

@return array|null The JSON-LD serialization of the operations
Creates a JSON - LD serialization of the passed operations