Add a virtual config

@param string|array $data
@return ConfigCollection
183908
public function addVirtual($data): ConfigCollection {
        $config = VirtualConfig::load($data);
        if ($config) {
            $this->addConfig($config);
        }
        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;
    }
1081710
public function setData($data)
    {
        if (!$data instanceof CollectorInterface) {
            $data = new Collector($data);
        }

        $this->data = $data;

        return $this;
    }
171698
private function AddCollectionToConfig($collection)
	{
		foreach($collection as $key=>$value)
		{
			if ($key[0] == '/')
				$this->_virtualCommand = str_replace('_', '.', substr($key, 1));
			$this->addPairToConfig($key, $value);
		}
	}
511278
public function addDataArray(array $data)
    {
        $this->data = $data;
        $this->pager->setTotalRows(\count($this->data));

        return $this;
    }
1237054
public function add(array $data) {

        try {

            $document = (new Visitor($data))->toArray();

            $this->collection->insert($document, ['w' => true]);

            return new \MongoId($document['_id']);
        }
        catch (\MongoCursorException $e) {
            throw new MongoMapperException($e->getMessage());
        }
        catch (\MongoException $e) {
            throw new MongoMapperException($e->getMessage());
        }
    }
1165327
public static function create($data)
    {
        if (!$data) {
            return new self(self::COLLECTION_NAME);
        }

        $type = null;
        if (isset($data[self::COLLECTION_NAME])) {
            $type = self::COLLECTION_NAME;
        } elseif (isset($data[self::CONDITION_NAME])) {
            $type = self::CONDITION_NAME;
        }
        if (null === $type) {
            throw new ContainerException(
                sprintf('Invalid container type. Use %s', implode(' or ', self::ALLOWED_TYPES))
            );
        }
        if (!is_array($data[$type])) {
            throw new ContainerException(sprintf('Parameter "%s" must be array', $type));
        }
        /** @var Container $mainContainer */
        $mainContainer = new self($type);
        if (isset($data[self::AND_OR_OPERATOR_NAME])) {
            $mainContainer->setAndOr($data[self::AND_OR_OPERATOR_NAME]);
        }
        if (self::COLLECTION_NAME === $type) {
            foreach ($data[$type] as $datum) {
                $mainContainer->addToCollection(self::create($datum));
            }
        } elseif (self::CONDITION_NAME === $type) {
            $mainContainer->getCondition()->setData($data[$type]);
        }

        return $mainContainer;
    }
257947
public function merge($data) : Collection
    {
        return static::create(array_merge($this->data, $this->convertToArray($data)));
    }
1284167
public function addConfig(array $config)
    {
        foreach ($config as $id => $entry) {
            $args = [];

            if (is_array($entry) && ! empty($entry)) {
                $values = array_values($entry);
                $entry = $values[0];

                if (isset($values[1])) {
                    $args = $values[1];
                }
            }

            $this->container[$id] = new Service($entry, $args);
        }

        return $this;
    }
810618
public function add(array $data)
    {
        $result = null;
        $this->hook->attach('language.add.before', $data, $result, $this);

        if (isset($result)) {
            return (bool) $result;
        }

        if (!empty($data['default'])) {
            $this->setDefault($data['code']);
        }

        $default = $this->getDefaultData();
        $data += $default;

        if (empty($data['name'])) {
            $data['name'] = $data['code'];
        }

        if (empty($data['native_name'])) {
            $data['native_name'] = $data['name'];
        }

        $languages = $this->config->select('languages', array());
        $languages[$data['code']] = array_intersect_key($data, $default);

        $result = $this->config->set('languages', $languages);
        $this->hook->attach('language.add.after', $data, $result, $this);
        return (bool) $result;
    }
1313644
protected function addConfigurations($configurations = array())
    {
        foreach ($configurations as $key => $value) {
            $this->registry->config->set($key, $value);
        }

        return $this;
    }
293823
public function add($data = [])
	{
		if (isset($data['email']) && isset($data['username']) && isset($data['password'])) {
			// todo asserts
			$create = array(
				'email' => $data['email'],
				'username' => Strings::webalize($data['username']),
				'password' => Passwords::hash($data['password']),
			);

		} else {
			throw new \InvalidArgumentException('We need username, email and password');
		}

		if (isset($data['role'])) {
			$create['role'] = $data['role'];
		} else {
			$create['role'] = 'user';
		}

		if (isset($data['name'])) {
			$create['name'] = $data['name'];
		}

		/** @var \Nette\Http\FileUpload $data ->avatar */
		if ($this->useFiles && $data['avatar'] && $data['avatar']->isOk()) {
			$create['avatar'] = $this->saveImage($data['avatar']);
		}

		$person = $this->repository->insert($create);

		return $person;
	}
860505
public static function config_get_configuration_array($data) {
        $config = array();

        if (isset($data->path)) {
            $config['path'] = $data->path;
        }
        if (isset($data->autocreate)) {
            $config['autocreate'] = $data->autocreate;
        }
        if (isset($data->singledirectory)) {
            $config['singledirectory'] = $data->singledirectory;
        }
        if (isset($data->prescan)) {
            $config['prescan'] = $data->prescan;
        }

        return $config;
    }
772691
public function import(array $data)
    {
        foreach ($data as $param => $value) {

            if ($param === 'headers') {
                continue;
            }

            if (property_exists($this, $param)) {
                $this->$param = $value;
            }
        }

        $this->headers = array();

        if (isset($data['headers'])) {
            $this->setHeaders((array) $data['headers']);
        }

        return $this;
    }
600309
public function append($config)
    {
        $config = AnConfig::unbox($config);

        if (is_array($config)) {
            if (!is_numeric(key($config))) {
                foreach ($config as $key => $value) {
                    if (array_key_exists($key, $this->_data)) {
                        if (!empty($value) && ($this->_data[$key] instanceof AnConfig)) {
                            $this->_data[$key] = $this->_data[$key]->append($value);
                        }
                    } else {
                        $this->__set($key, $value);
                    }
                }
            } else {
                foreach ($config as $value) {
                    if (!in_array($value, $this->_data, true)) {
                        $this->_data[] = $value;
                    }
                }
            }
        }

        return $this;
    }
260086
public function create($data)
    {
        $fileDescriptor = new FileDescriptor($data->getHash());
        $fileDescriptor->setPackage(
            $this->extractPackageFromDocBlock($data->getDocBlock()) ?: $this->getBuilder()->getDefaultPackage()
        );

        $fileDescriptor->setName($data->getName());
        $fileDescriptor->setPath($data->getPath());
        if ($this->getBuilder()->getProjectDescriptor()->getSettings()->shouldIncludeSource()) {
            $fileDescriptor->setSource($data->getSource());
        }

        $fileDescriptor->setIncludes(new Collection($data->getIncludes()));
        $fileDescriptor->setNamespaceAliases(new Collection($data->getNamespaces()));

        $this->assembleDocBlock($data->getDocBlock(), $fileDescriptor);
        $this->overridePackageTag($data, $fileDescriptor);

        //$this->addMarkers($data->getMarkers(), $fileDescriptor);
        $this->addConstants($data->getConstants(), $fileDescriptor);
        $this->addFunctions($data->getFunctions(), $fileDescriptor);
        $this->addClasses($data->getClasses(), $fileDescriptor);
        $this->addInterfaces($data->getInterfaces(), $fileDescriptor);
        $this->addTraits($data->getTraits(), $fileDescriptor);

        return $fileDescriptor;
    }
1171696
public function add(array $data)
    {
        $result = null;
        $this->hook->attach('image.style.add.before', $data, $result, $this);

        if (isset($result)) {
            return (int) $result;
        }

        $default = $this->getDefaultData();
        $data += $default;

        $imagestyle_id = count($this->getList()) + 1;
        $imagestyles = $this->config->get('imagestyles', array());

        $imagestyles[$imagestyle_id] = array_intersect_key($data, $default);
        $this->config->set('imagestyles', $imagestyles);

        $this->hook->attach('image.style.add.after', $data, $imagestyle_id, $this);
        return (int) $imagestyle_id;
    }