Beispiel #1
0
 /**
  * Sets an object by dot-notated path.
  * Each dot ('.') indicates a child array dimension.
  */
 public static function set($dotpath, $object)
 {
     if (false === strpos($dotpath, '.')) {
         return static::$data[$dotpath] = $object;
     }
     return \Phpf\Util\Arr::dotSet(static::$data, $dotpath, $object);
 }
Beispiel #2
0
/**
 * Sets a value in $array given its path in dot notation.
 */
function array_set(array &$array, $dotpath, $value)
{
    return \Phpf\Util\Arr::dotSet($array, $dotpath, $value);
}