You are here

public function ExplodeStrategy::extract in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-hydrator/src/Strategy/ExplodeStrategy.php \Zend\Hydrator\Strategy\ExplodeStrategy::extract()

Join array elements with delimiter

Parameters

string[] $value The original value.:

Return value

string|null

Overrides StrategyInterface::extract

File

vendor/zendframework/zend-hydrator/src/Strategy/ExplodeStrategy.php, line 101

Class

ExplodeStrategy

Namespace

Zend\Hydrator\Strategy

Code

public function extract($value) {
  if (!is_array($value)) {
    throw new Exception\InvalidArgumentException(sprintf('%s expects argument 1 to be array, %s provided instead', __METHOD__, is_object($value) ? get_class($value) : gettype($value)));
  }
  return empty($value) ? null : implode($this->valueDelimiter, $value);
}