class ArrayMapNamingStrategy in Zircon Profile 8.0
Same name in this branch
- 8.0 vendor/zendframework/zend-hydrator/src/NamingStrategy/ArrayMapNamingStrategy.php \Zend\Hydrator\NamingStrategy\ArrayMapNamingStrategy
- 8.0 vendor/zendframework/zend-stdlib/src/Hydrator/NamingStrategy/ArrayMapNamingStrategy.php \Zend\Stdlib\Hydrator\NamingStrategy\ArrayMapNamingStrategy
Same name and namespace in other branches
- 8 vendor/zendframework/zend-hydrator/src/NamingStrategy/ArrayMapNamingStrategy.php \Zend\Hydrator\NamingStrategy\ArrayMapNamingStrategy
Hierarchy
- class \Zend\Hydrator\NamingStrategy\ArrayMapNamingStrategy implements NamingStrategyInterface
Expanded class hierarchy of ArrayMapNamingStrategy
1 file declares its use of ArrayMapNamingStrategy
- ArrayMapNamingStrategy.php in vendor/
zendframework/ zend-stdlib/ src/ Hydrator/ NamingStrategy/ ArrayMapNamingStrategy.php
File
- vendor/
zendframework/ zend-hydrator/ src/ NamingStrategy/ ArrayMapNamingStrategy.php, line 12
Namespace
Zend\Hydrator\NamingStrategyView source
class ArrayMapNamingStrategy implements NamingStrategyInterface {
/**
* @var string[]
*/
private $extractionMap = [];
/**
* @var string[]
*/
private $hydrationMap = [];
/**
* Constructor
*
* @param array $extractionMap A map of string keys and values for symmetric translation of hydrated
* and extracted field names
*/
public function __construct(array $extractionMap) {
$this->extractionMap = $extractionMap;
$this->hydrationMap = array_flip($extractionMap);
}
/**
* {@inheritDoc}
*/
public function hydrate($name) {
return isset($this->hydrationMap[$name]) ? $this->hydrationMap[$name] : $name;
}
/**
* {@inheritDoc}
*/
public function extract($name) {
return isset($this->extractionMap[$name]) ? $this->extractionMap[$name] : $name;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ArrayMapNamingStrategy:: |
private | property | ||
ArrayMapNamingStrategy:: |
private | property | ||
ArrayMapNamingStrategy:: |
public | function |
Converts the given name so that it can be hydrated by the hydrator. Overrides NamingStrategyInterface:: |
|
ArrayMapNamingStrategy:: |
public | function |
Converts the given name so that it can be extracted by the hydrator. Overrides NamingStrategyInterface:: |
|
ArrayMapNamingStrategy:: |
public | function | Constructor |