class JsonRpcParameterDefinition in JSON-RPC 2.x
Same name and namespace in other branches
- 8 src/Annotation/JsonRpcParameterDefinition.php \Drupal\jsonrpc\Annotation\JsonRpcParameterDefinition
Defines a JsonRpcParameterDefinition annotation object.
Hierarchy
- class \Drupal\jsonrpc\Annotation\JsonRpcParameterDefinition implements ParameterDefinitionInterface
Expanded class hierarchy of JsonRpcParameterDefinition
See also
\Drupal\jsonrpc\Plugin\JsonRpcServiceManager
1 file declares its use of JsonRpcParameterDefinition
- AnnotationNormalizer.php in modules/
jsonrpc_discovery/ src/ Normalizer/ AnnotationNormalizer.php
1 string reference to 'JsonRpcParameterDefinition'
- AnnotationNormalizer::getAnnotationType in modules/
jsonrpc_discovery/ src/ Normalizer/ AnnotationNormalizer.php - Extract the annotation type.
File
- src/
Annotation/ JsonRpcParameterDefinition.php, line 15
Namespace
Drupal\jsonrpc\AnnotationView source
class JsonRpcParameterDefinition implements ParameterDefinitionInterface {
/**
* The name of the parameter if the params are by-name, an offset otherwise.
*
* @var string|int
*/
protected $id;
/**
* The parameter schema.
*
* @var array
*/
public $schema = NULL;
/**
* A description of the parameter.
*
* @var \Drupal\Core\Annotation\Translation
*
* @ingroup plugin_translatable
*/
public $description;
/**
* The parameter factory.
*
* @var string
*/
public $factory;
/**
* Whether the parameter is required.
*
* @var bool
*/
public $required;
/**
* {@inheritdoc}
*/
public function getFactory() {
return $this->factory;
}
/**
* {@inheritdoc}
*/
public function getDescription() {
return $this->description;
}
/**
* {@inheritdoc}
*/
public function isRequired() {
return isset($this->required) ? $this->required : FALSE;
}
/**
* {@inheritdoc}
*/
public function getSchema() {
if (!isset($this->schema) && isset($this->factory)) {
$this->schema = call_user_func_array([
$this->factory,
'schema',
], [
$this,
]);
}
return $this->schema;
}
/**
* {@inheritdoc}
*/
public function get() {
return $this;
}
/**
* Sets the parameter ID.
*
* @param string|int $id
* The ID to set.
*/
public function setId($id) {
$this->id = $id;
}
/**
* {@inheritdoc}
*/
public function getId() {
return $this->id;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
JsonRpcParameterDefinition:: |
public | property | A description of the parameter. | |
JsonRpcParameterDefinition:: |
public | property | The parameter factory. | |
JsonRpcParameterDefinition:: |
protected | property | The name of the parameter if the params are by-name, an offset otherwise. | |
JsonRpcParameterDefinition:: |
public | property | Whether the parameter is required. | |
JsonRpcParameterDefinition:: |
public | property | The parameter schema. | |
JsonRpcParameterDefinition:: |
public | function | ||
JsonRpcParameterDefinition:: |
public | function |
The description of the parameter for the method. Overrides ParameterDefinitionInterface:: |
|
JsonRpcParameterDefinition:: |
public | function |
Get the parameter factory class. Overrides ParameterDefinitionInterface:: |
|
JsonRpcParameterDefinition:: |
public | function |
The name of the parameter if the params are by-name, an offset otherwise. Overrides ParameterDefinitionInterface:: |
|
JsonRpcParameterDefinition:: |
public | function |
Gets the parameter schema. Overrides ParameterDefinitionInterface:: |
|
JsonRpcParameterDefinition:: |
public | function |
Whether the parameter is required. Overrides ParameterDefinitionInterface:: |
|
JsonRpcParameterDefinition:: |
public | function | Sets the parameter ID. |