Art4\JsonApiClient\ResourceIdentifierCollection::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_array($object)) {
            throw new ValidationException('Resources for a collection has to be in an array, "' . gettype($object) . '" given.');
        }
        if (count($object) > 0) {
            foreach ($object as $resource) {
                $this->container->set('', $this->parseResource($resource));
            }
        }
        return $this;
    }