fills the included resources
this will end up in response.included[]

prefer using ->fill_relations() instead

@param  mixed $resources array of \alsvanzelf\jsonapi\resource objects
or \alsvanzelf\jsonapi\collection object
@return void
420091
public function fill_included_resources($resources) {
	if ($resources instanceof \alsvanzelf\jsonapi\collection) {
		$resources = $resources->get_resources();
	}
	
	foreach ($resources as $resource) {
		$this->add_included_resource($resource);
	}
}
377550
protected function addResourceString(string $resource): void
    {
        $data = json_decode($resource, true);
        if (json_last_error() !== \JSON_ERROR_NONE) {
            if (function_exists('json_last_error_msg')) {
                throw new \InvalidArgumentException(json_last_error_msg(), json_last_error());
            }
            throw new \InvalidArgumentException("Error parsing JSON.", json_last_error());
        }

        $this->addResourceArray($data);
    }
450649
protected function loadResource($resource, $required)
    {
        foreach ($this->loaders as $loader) {
            if (!$loader->supports($resource)) {
                continue;
            }

            try {
                return $loader->load($resource);
            } catch (ResourceNotFoundException $e) {
                if ($required) {
                    throw $e;
                }

                return [];
            }
        }

        throw new ResourceException(sprintf('There is no configuration loader available to load the resource "%s"', $resource));
    }
137222
public function addResource(ResourceInterface $resource)
    {
        $key = (string) $resource;

        if (!isset($this->resources[$key])) {
            $this->resources[$key] = $resource;
        }
    }
478148
public static function fromResources(ResourceInterface ...$resources) {
		$collectionDocument = new self();
		
		foreach ($resources as $resource) {
			$collectionDocument->addResource($resource);
		}
		
		return $collectionDocument;
	}
57674
public function fill(array $data)
    {
        foreach ($data as $key => $value) {
            if (in_array($key, $this->fillable)) {
                $this->{$key} = $value;
            }
        }
    }
450636
private function addHeaders($Resource, $headers) {
        $httpHeaders = array();
        foreach ($headers as $header => $value) {
            $httpHeaders[] = $header . ': ' . $value;
        }
        curl_setopt($Resource, CURLOPT_HTTPHEADER, $httpHeaders);
    }
1091468
protected function _addResources(array $resources) {
        foreach ($resources as $resourceName => $properties) {
            // If the properties aren't set as an array, then we will consider
            // the value as the resource ID.
            if (!is_array($properties)) {
                $properties = array('id' => $properties);
            }

            $resourceName = strtolower($resourceName);
            $id = $properties['id'];

            if ($resourceName === 'all') {
                $id = 'all';
            }

            if (is_null($id) || empty($id)) {
                throw new Zend_Application_Resource_Exception(
                    sprintf(
                        $this->_missingPropertyMessage, 'ID', 'resource', $resourceName
                    )
                );
            }

            $this->_addResourceById($resources, $id);
        }
    }
1043233
public function addResources(array $resources) {
		foreach ($resources as $name => $resource) {
			if (is_numeric($name)) {
				$this->addResource($resource);
				continue;
			}
			
			$this->addResource($resource, $name);
		}
		
		return $this;
	}
667410
private function closeResources(array $params): void
    {
        foreach ($params as $param) {
            if (is_array($param) && array_key_exists('content', $param) && is_resource($param['content'])) {
                fclose($param['content']);
            }
        }
    }
336743
protected function fillFromConfig($properties = null)
    {
        if ($properties === null) {
            $properties = array_keys((array) $this->config);
        }

        foreach ($properties as $property) {
            if (property_exists($this, $property)) {
                $this->{$property} = $this->getConfig($property, $this->{$property});
            }
        }
    }
414555
public function addResource(string ...$resource)
    {
        foreach ($resource as $_resource)
        {
            $this->resourceRegistry->save($_resource);
        }
    }
1372192
private function loadImports(array $resources)
    {
        foreach ($resources as $resource) {
            if (!is_string($resource)) {
                continue;
            }

            $this->import($resource);
        }
    }
520800
private void addResources( final Collection<File> items, final Collection<Resource> resources )
    {
        for ( Resource resource : resources )
        {
            items.add( new File( resource.getDirectory() ) );
        }
    }
1371103
public function addResourceRelationships(array $resources, RestRequestInterface $restRequest): array
    {
        foreach ($resources as $resource) {
            /**
             * @var \Generated\Shared\Transfer\CompanyUserTransfer|null $payload
             */
            $payload = $resource->getPayload();

            if ($payload === null || !($payload instanceof CompanyUserTransfer)) {
                continue;
            }

            $companyBusinessUnitTransfer = $payload->getCompanyBusinessUnit();

            if ($companyBusinessUnitTransfer === null) {
                continue;
            }

            $companyBusinessUnitResource = $this->createCompanyBusinessUnitResource(
                $companyBusinessUnitTransfer
            );

            $resource->addRelationship($companyBusinessUnitResource);
        }

        return $resources;
    }
877102
protected function setupIndexReferences($resource)
    {
        foreach ($resource->settings['actions']['IndexReferences']['uris'] as $property => $uri) {
            $this->setupIndex($resource, $uri, $property);
        }
    }
147975
def add_resources(self, resources):
    
    new_resources = self._build_resource_dictionary(resources)

    for key in new_resources:
      self._resources[key] = new_resources[key]
    self._dirty_attributes.add(u'resources')