path = $path;
$this->separator = $separator;
}
/**
* Get from Structure.
*
* @param Structure|array|object $structure
* @param mixed $default
*
* @return mixed
*
* @since 3.5.1
*/
public function get($structure, $default = null)
{
if ($structure instanceof Structure) {
return $structure->get($this->path, $default, $this->separator);
}
return StructureHelper::getByPath($structure, $this->path, $this->separator ?: '.');
}
/**
* Method to get property Path
*
* @return string
*
* @since 3.5.1
*/
public function getPath(): string
{
return $this->path;
}
/**
* Method to set property path
*
* @param string $path
*
* @return static Return self to support chaining.
*
* @since 3.5.1
*/
public function setPath(string $path)
{
$this->path = $path;
return $this;
}
/**
* Method to get property Separator
*
* @return string
*
* @since 3.5.1
*/
public function getSeparator(): string
{
return $this->separator;
}
/**
* Method to set property separator
*
* @param string $separator
*
* @return static Return self to support chaining.
*
* @since 3.5.1
*/
public function setSeparator(string $separator)
{
$this->separator = $separator;
return $this;
}
}