class TypesInfoEvent in Charts 8.4
Same name and namespace in other branches
- 5.0.x src/Event/TypesInfoEvent.php \Drupal\charts\Event\TypesInfoEvent
The TypesInfoEvent.
Hierarchy
- class \Drupal\charts\Event\TypesInfoEvent extends \Symfony\Component\EventDispatcher\Event
Expanded class hierarchy of TypesInfoEvent
1 file declares its use of TypesInfoEvent
- TypeManager.php in src/
TypeManager.php
File
- src/
Event/ TypesInfoEvent.php, line 10
Namespace
Drupal\charts\EventView source
class TypesInfoEvent extends Event {
/**
* The chart types.
*
* @var array
*/
protected $types;
/**
* Constructs a new TypesInfoEvent object.
*
* @param array $types
* The chart type definitions.
*/
public function __construct(array $types) {
$this->types = $types;
}
/**
* Gets the condition definitions.
*
* @return array
* The condition definitions.
*/
public function getTypes() : array {
return $this->types;
}
/**
* Sets the condition definitions.
*
* @param array $types
* The condition definitions.
*
* @return $this
*/
public function setTypes(array $types) {
$this->types = $types;
return $this;
}
/**
* Gets a chart type.
*
* @param string $type
* The chart type name.
*
* @return array
* The chart type info.
*/
public function getType($type) : array {
return $this->types[$type] ?? [];
}
/**
* Sets a chart type information.
*
* @param string $type
* The chart type name.
* @param array $info
* The chart type information settings.
*
* @return $this
*/
public function setType($type, array $info) {
if ($this
->getType($type)) {
$this->types[$type] = $info;
}
return $this;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TypesInfoEvent:: |
protected | property | The chart types. | |
TypesInfoEvent:: |
public | function | Gets a chart type. | |
TypesInfoEvent:: |
public | function | Gets the condition definitions. | |
TypesInfoEvent:: |
public | function | Sets a chart type information. | |
TypesInfoEvent:: |
public | function | Sets the condition definitions. | |
TypesInfoEvent:: |
public | function | Constructs a new TypesInfoEvent object. |