You are here

public function ClassMethods::setUnderscoreSeparatedKeys in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/zendframework/zend-hydrator/src/ClassMethods.php \Zend\Hydrator\ClassMethods::setUnderscoreSeparatedKeys()

Parameters

bool $underscoreSeparatedKeys:

Return value

ClassMethods

2 calls to ClassMethods::setUnderscoreSeparatedKeys()
ClassMethods::setOptions in vendor/zendframework/zend-hydrator/src/ClassMethods.php
ClassMethods::__construct in vendor/zendframework/zend-hydrator/src/ClassMethods.php
Define if extract values will use camel case or name with underscore

File

vendor/zendframework/zend-hydrator/src/ClassMethods.php, line 91

Class

ClassMethods

Namespace

Zend\Hydrator

Code

public function setUnderscoreSeparatedKeys($underscoreSeparatedKeys) {
  $this->underscoreSeparatedKeys = (bool) $underscoreSeparatedKeys;
  if ($this->underscoreSeparatedKeys) {
    $this
      ->setNamingStrategy(new NamingStrategy\UnderscoreNamingStrategy());
  }
  elseif ($this
    ->getNamingStrategy() instanceof NamingStrategy\UnderscoreNamingStrategy) {
    $this
      ->removeNamingStrategy();
  }
  return $this;
}