Art4\JsonApiClient\Utils\DataContainer::get PHP Method

get() public method

Get a value by a key
public get ( mixed $key ) : mixed
$key mixed The key
return mixed
    public function get($key)
    {
        $key = $this->parseKey($key);
        $string = $key->shift();
        $key->next();
        $value = $this->getValue($string);
        if ($key->count() === 0) {
            return $value;
        }
        // #TODO Handle other objects and arrays
        if (!$value instanceof AccessInterface) {
            throw new AccessException('Could not get the value for the key "' . $key->raw . '".');
        }
        return $value->get($key);
    }