Art4\JsonApiClient\Meta::parse PHP Method

parse() public method

Parses the data for this element
public parse ( mixed $object ) : self
$object mixed The data
return self
    public function parse($object)
    {
        if (!is_object($object)) {
            throw new ValidationException('Meta has to be an object, "' . gettype($object) . '" given.');
        }
        $object_vars = get_object_vars($object);
        if (count($object_vars) === 0) {
            return $this;
        }
        foreach ($object_vars as $name => $value) {
            $this->container->set($name, $value);
        }
        return $this;
    }