Add new data to this provider. If there is already data for that
namespace it will get appended. If you want to prepend it, use
self::prepend().

@param array|ArrayAccess $data
@param string            $namespace (default:'default')

@return $this
10552
public function add($data, $namespace='default')
    {
        Type::force($data, ArrayAccess::class);

        if (!isset($this->addedData[$namespace])) {
            $this->addedData[$namespace] = [];
        }

        $this->addedData[$namespace][] = $data;

        return $this;
    }
416078
public function registerNamespace($namespace)
    {
        if (is_string($namespace)) {
            $namespace = (array) $namespace;
        } elseif (!is_array($namespace)) {
            throw new Zend_Loader_Exception('Invalid namespace provided');
        }

        foreach ($namespace as $ns) {
            if (!isset($this->_namespaces[$ns])) {
                $this->_namespaces[$ns] = true;
            }
        }
        return $this;
    }
1084708
public function add(array $data): self
    {
        $this->data = array_merge_recursive($this->data, $data);
        return $this;
    }
373219
public function registerComposerNamespaces(array $namespaces) {
		foreach ($namespaces as $namespace => $dirs) {
			$namespaceDir = trim($namespace, '\ ');
			$namespaceDir = str_replace('\\', DIRECTORY_SEPARATOR, $namespaceDir);
			
			foreach ($dirs as $dir) {
				$dir .= DIRECTORY_SEPARATOR . $namespaceDir;
				
				$this->registerNamespace($namespace, $dir);
			}
		}
		
		return $this;
	}
689649
public function addNamespace( $prefix, $namespace )
	{
		if ( empty( $namespace ) )
		{
			throw new ArgumentOutOfRangeException( "The $namespace parameter to addNamespace cannot be null or empty" );
		}

		if ( substr( $prefix, 0, 5 ) == "xmlns" )
		{
			$prefix = substr( $prefix, 5 );
		}

		if ( strlen( $prefix ) > 0 && $prefix[0] == ":" )
		{
			$prefix = substr( $prefix, 1 );
		}

		if ( empty( $prefix) && empty( $this->defaultNamespace ) )
		{
			$this->defaultNamespace = $namespace;
		}

		$this->namespaces[ $prefix ] = $namespace;
	}
333475
public function registerNamespace($namespace, $directory)
    {
        $namespace = rtrim($namespace, self::NS_SEPARATOR). self::NS_SEPARATOR;
        $this->namespaces[$namespace] = $this->normalizeDirectory($directory);
        return $this;
    }
4459
public function addRows($data)
    {
        foreach ($data as $key => $row) {
            $this->addRow($row, isset($row['id']) ? $row['id'] : $key);
        }

        return $this;
    }
1200295
public function addData($data)
    {
        $data = (array) $data;

        if (empty($data)) {
            return $this;
        }

        foreach ($data as $key => $value) {
            $this->setData($key, $value);
        }

        return $this;
    }
506162
public function set($key, $value) {
        $this->_data[$this->_namespace][$key] = $value;
        return $this;
    }
1137765
protected function dataForPrefix($namespace, $prefix)
    {
        if (!isset($this->cachedData[$namespace][$prefix])) {
            $this->loadDataForPrefix($namespace, $prefix);

        }

        // If no custom data was setted using offsetSet() just return that
        if (!isset($this->customData[$namespace][$prefix])) {
            return $this->cachedData[$namespace][$prefix];
        }

        $data = $this->cachedData[$namespace][$prefix];

        array_unshift($data, $this->customData[$namespace][$prefix]);

        return $data;

    }
1016201
public function prependPath($path, $namespace = self::MAIN_NAMESPACE)
    {
        $path = rtrim($path, '/\\');

        if (!isset($this->paths[$namespace])) {
            $this->paths[$namespace][] = $path;
        } else {
            array_unshift($this->paths[$namespace], $path);
        }
    }
1009500
public function setNamespace($namespace) : AuditEvent
    {
        $parts = explode('/', $namespace);

        foreach ($parts as &$part) {
            $part = Snake::case($part, '-');
        }

        $namespace = implode('/', $parts);
        $namespace = '/' . trim($namespace, '/');
        $this->namespace = $namespace;

        return $this;
    }
1282938
public function setNamespace($namespace)
    {
        $parts = explode('/', $namespace);

        foreach ($parts as &$part) {
            $part = $this->toSnakeCase($part, '-');
        }

        $namespace = implode('/', $parts);
        $namespace = '/' . trim($namespace, '/');
        $this->namespace = $namespace;

        return $this;
    }
1367546
public function addNamespace($namespace, $priority = PriorityQueue::NORMAL)
    {
        $this->controllerResolver->addNamespace($namespace . '\Controller', $priority);
        $this->repositoryResolver->addNamespace($namespace . '\Repository', $priority);
        $this->repositoryResolver->addNamespace($namespace . '\Model', $priority);
        $this->viewResolver->addNamespace($namespace . '\View', $priority);

        return $this;
    }
495460
public function changeNamespace(string $namespace): void
	{
		$this->setNamespace($namespace);
		$result = $this->getStorage()->fetchAll();
		foreach ($result as $row) {
			$resource = $this->imageStorage->getResource($row->name);
			$resource->setNamespace($this->namespace);
			$this->imageStorage->save($resource);

			$this->getStorage()->update($row->key, $resource->getIdentifier());
		}
	}
749631
public function setNamespaces($namespaces)
    {
        if (is_string($namespaces)) {
            $this->namespaces = array($namespaces);
        } elseif (is_array($namespaces)) {
            $this->namespaces = $namespaces;
        } else {
            throw new Exception\InvalidArgumentException(
                "Invalid argument, expected a string or array. Got ".gettype($namespaces)."."
            );
        }

        return $this;
    }
734984
protected function addMessage($message, $namespace = FlashMessenger::NAMESPACE_DEFAULT)
    {
        // Load flashMessenger
        if (null === $this->messenger) {
            $this->messenger = $this->getServiceLocator()
                    ->get('ControllerPluginManager')
                    ->get('flashMessenger');
        }

        // Set current namespace
        $this->messenger->setNamespace($namespace);

        // Add messages
        $message = (array) $message;
        foreach ($message as $value) {
            $this->messenger->addMessage($value);
        }
    }