php/Scandio/js/Bridge.php
private static function setByDotNotation($dots, $value, $scalar = true)
    {
        if ($dots == null) { static::$store = $value; }

        $exploded = explode('.', $dots);
        $valuePointer = &static::$store;

        # Loop until end of explodes and reset store's pointer to $valuePointer by reference
        $length = count($exploded);
        for ($i = 0; $i < $length; $i++) {
            $key = $exploded[$i];

            $valuePointer = &$valuePointer[$key];
        }

         if ($scalar === true) {
            $valuePointer = $value;
         } else {
            (array) $valuePointer;
            $valuePointer[] = $value;
         }


        return $valuePointer;
    }
private static function setByDotNotation($dots, $value, $scalar = true)
    {
        if ($dots == null) { static::$store = $value; }

        $exploded = explode('.', $dots);
        $valuePointer = &static::$store;

        # Loop until end of explodes and reset store's pointer to $valuePointer by reference
        $length = count($exploded);
        for ($i = 0; $i < $length; $i++) {
            $key = $exploded[$i];

            $valuePointer = &$valuePointer[$key];
        }

         if ($scalar === true) {
            $valuePointer = $value;
         } else {
            (array) $valuePointer;
            $valuePointer[] = $value;
         }


        return $valuePointer;
    }
private static function setByDotNotation ( $ dots , $ value , $ scalar = true ) { if ( $ dots == null ) { static :: $ store = $ value ; } $ exploded = explode ( '.' , $ dots ) ; $ valuePointer = & static :: $ store ; # Loop until end of explodes and reset store's pointer to $valuePointer by reference $ length = count ( $ exploded ) ; for ( $ i = 0 ; $ i < $ length ; $ i ++ ) { $ key = $ exploded [ $ i ] ; $ valuePointer = & $ valuePointer [ $ key ] ; } if ( $ scalar === true ) { $ valuePointer = $ value ; } else { ( array ) $ valuePointer ; $ valuePointer [ ] = $ value ; } return $ valuePointer ; }
Sets a value in the data-store by dot notation.

@param string $dots notation for value to be set
@param $value value to be set
@param boolean $scalar indicating if value shall be written as scalar or inserted into array
Sets a value in the data - store by dot notation .