You are here

class RawParameterFactory in JSON-RPC 2.x

Same name and namespace in other branches
  1. 8 src/ParameterFactory/RawParameterFactory.php \Drupal\jsonrpc\ParameterFactory\RawParameterFactory

Class RawParameterFactory just returns the raw parameter.

@package Drupal\jsonrpc\ParameterFactory

Hierarchy

Expanded class hierarchy of RawParameterFactory

1 file declares its use of RawParameterFactory
RpcRequestFactory.php in src/Shaper/RpcRequestFactory.php

File

src/ParameterFactory/RawParameterFactory.php, line 13

Namespace

Drupal\jsonrpc\ParameterFactory
View source
class RawParameterFactory extends ParameterFactoryBase {

  /**
   * {@inheritdoc}
   */
  public static function schema(ParameterDefinitionInterface $parameter_definition) {
    return $parameter_definition
      ->getSchema();
  }

  /**
   * {@inheritdoc}
   */
  public function getOutputValidator() {

    // The input is the same as the output.
    return $this
      ->getInputValidator();
  }

  /**
   * {@inheritdoc}
   */
  protected function doTransform($data, Context $context = NULL) {
    return $data;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ParameterFactoryBase::$definition protected property The parameter definition.
ParameterFactoryBase::$inputValidator protected property The validation class for shaper interactions.
ParameterFactoryBase::$validator protected property The schema validator to ensure the input data adheres to the expectation.
ParameterFactoryBase::create public static function Instantiates a new instance of this class. Overrides ParameterFactoryInterface::create 1
ParameterFactoryBase::getInputValidator public function
ParameterFactoryBase::__construct public function ParameterFactoryBase constructor. 1
RawParameterFactory::doTransform protected function
RawParameterFactory::getOutputValidator public function
RawParameterFactory::schema public static function An array representing the JSON Schema for acceptable input to the factory. Overrides ParameterFactoryInterface::schema