public static function setArrayPath(&$array, $dotPath, $value) { $path = explode('.', $dotPath); foreach ($path as $p) { if (!isset($array[$p])) { $array[$p] = []; } $array =& $array[$p]; } $array = $value; }
public function mapValues(array &$data) { Tools::setArrayPath($data, $this->getFieldDefinition()->getId(), $this->getValue()); }