src/Data/FormatAbleObject.php
protected function setPropertyByPath($path, $value)
    {
        $path = explode('.', $path);
        $root = $path[0];
        unset($path[0]);

        $array = ($this->hasProperty($root) ? $this->getProperty($root) : []);
        $pointer = &$array;

        // Loop through the array path and set array parts
        foreach ($path as $part) {
            if (!isset($pointer[$part])) {
                $pointer[$part] = [];
            }

            if (!is_array($pointer[$part])) {
                $pointer[$part] = [];
            }

            $pointer = &$pointer[$part];
        }

        $pointer = $value;
        unset($pointer);

        $this->setProperty($root, $array);
    }
protected function setPropertyByPath($path, $value)
    {
        $path = explode('.', $path);
        $root = $path[0];
        unset($path[0]);

        $array = ($this->hasProperty($root) ? $this->getProperty($root) : []);
        $pointer = &$array;

        // Loop through the array path and set array parts
        foreach ($path as $part) {
            if (!isset($pointer[$part])) {
                $pointer[$part] = [];
            }

            if (!is_array($pointer[$part])) {
                $pointer[$part] = [];
            }

            $pointer = &$pointer[$part];
        }

        $pointer = $value;
        unset($pointer);

        $this->setProperty($root, $array);
    }
protected function setPropertyByPath ( $ path , $ value ) { $ path = explode ( '.' , $ path ) ; $ root = $ path [ 0 ] ; unset ( $ path [ 0 ] ) ; $ array = ( $ this -> hasProperty ( $ root ) ? $ this -> getProperty ( $ root ) : [ ] ) ; $ pointer = & $ array ; // Loop through the array path and set array parts foreach ( $ path as $ part ) { if ( ! isset ( $ pointer [ $ part ] ) ) { $ pointer [ $ part ] = [ ] ; } if ( ! is_array ( $ pointer [ $ part ] ) ) { $ pointer [ $ part ] = [ ] ; } $ pointer = & $ pointer [ $ part ] ; } $ pointer = $ value ; unset ( $ pointer ) ; $ this -> setProperty ( $ root , $ array ) ; }
Set a property by looping through.

@param string $path
Set a property by looping through .