class UnderscoreNamingStrategy in Zircon Profile 8.0
Same name in this branch
- 8.0 vendor/zendframework/zend-hydrator/src/NamingStrategy/UnderscoreNamingStrategy.php \Zend\Hydrator\NamingStrategy\UnderscoreNamingStrategy
- 8.0 vendor/zendframework/zend-stdlib/src/Hydrator/NamingStrategy/UnderscoreNamingStrategy.php \Zend\Stdlib\Hydrator\NamingStrategy\UnderscoreNamingStrategy
Same name and namespace in other branches
- 8 vendor/zendframework/zend-hydrator/src/NamingStrategy/UnderscoreNamingStrategy.php \Zend\Hydrator\NamingStrategy\UnderscoreNamingStrategy
Hierarchy
- class \Zend\Hydrator\NamingStrategy\UnderscoreNamingStrategy implements NamingStrategyInterface
Expanded class hierarchy of UnderscoreNamingStrategy
1 file declares its use of UnderscoreNamingStrategy
- UnderscoreNamingStrategy.php in vendor/
zendframework/ zend-stdlib/ src/ Hydrator/ NamingStrategy/ UnderscoreNamingStrategy.php
File
- vendor/
zendframework/ zend-hydrator/ src/ NamingStrategy/ UnderscoreNamingStrategy.php, line 14
Namespace
Zend\Hydrator\NamingStrategyView source
class UnderscoreNamingStrategy implements NamingStrategyInterface {
/**
* @var FilterChain|null
*/
protected static $camelCaseToUnderscoreFilter;
/**
* @var FilterChain|null
*/
protected static $underscoreToStudlyCaseFilter;
/**
* Remove underscores and capitalize letters
*
* @param string $name
* @return string
*/
public function hydrate($name) {
return $this
->getUnderscoreToStudlyCaseFilter()
->filter($name);
}
/**
* Remove capitalized letters and prepend underscores.
*
* @param string $name
* @return string
*/
public function extract($name) {
return $this
->getCamelCaseToUnderscoreFilter()
->filter($name);
}
/**
* @return FilterChain
*/
protected function getUnderscoreToStudlyCaseFilter() {
if (static::$underscoreToStudlyCaseFilter instanceof FilterChain) {
return static::$underscoreToStudlyCaseFilter;
}
$filter = new FilterChain();
$filter
->attachByName('WordUnderscoreToStudlyCase');
return static::$underscoreToStudlyCaseFilter = $filter;
}
/**
* @return FilterChain
*/
protected function getCamelCaseToUnderscoreFilter() {
if (static::$camelCaseToUnderscoreFilter instanceof FilterChain) {
return static::$camelCaseToUnderscoreFilter;
}
$filter = new FilterChain();
$filter
->attachByName('WordCamelCaseToUnderscore');
$filter
->attachByName('StringToLower');
return static::$camelCaseToUnderscoreFilter = $filter;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
UnderscoreNamingStrategy:: |
protected static | property | ||
UnderscoreNamingStrategy:: |
protected static | property | ||
UnderscoreNamingStrategy:: |
public | function |
Remove capitalized letters and prepend underscores. Overrides NamingStrategyInterface:: |
|
UnderscoreNamingStrategy:: |
protected | function | ||
UnderscoreNamingStrategy:: |
protected | function | ||
UnderscoreNamingStrategy:: |
public | function |
Remove underscores and capitalize letters Overrides NamingStrategyInterface:: |