Add a data provider to the collection.

@param string $id The data provider service id
@param DataProviderInterface $dataProvider The data provider

@throws Exception
771875
public function add($id, DataProviderInterface $dataProvider)
    {
        if ($this->has($id)) {
            throw new Exception('Trying to add the data provider '.$id.' twice');
        }
        // add the data provider to collection, indexed by ids
        $this->dataProviders[$id] = $dataProvider;
    }
200717
public function addDataSource($interfaceName, $driver, $className)
    {
        if (!isset($this->dataSources[$interfaceName]) || !is_array($this->dataSources[$interfaceName])) {
            $this->dataSources[$interfaceName] = array();
        }
        
        $this->dataSources[$interfaceName][$driver] = $className;
        $this->saveDataSources();
        
        return true;
    }
1182949
protected function checkResponse(ResponseInterface $response, $data)
    {
        $acceptableStatuses = [200, 201];

        if (!in_array($response->getStatusCode(), $acceptableStatuses)) {
            throw new IdentityProviderException(
                $data['message'] ?: $response->getReasonPhrase(),
                $response->getStatusCode(),
                $response
            );
        }
    }
508790
public function setDatatableId($id)
    {
        if (!array_key_exists($id, self::$instances)) {
            self::$instances[$id] = $this;
        } else {
            throw new \Exception('Identifer already exists');
        }

        return $this;
    }
1122902
public function createDumper(DumperConfigDataProvider $configDataProvider): DumperInterface
    {
        $configDataProvider->setSshHost($this->getConfig()->getSshHost());
        $configDataProvider->setSshUser($this->getConfig()->getSshUser());
        $configDataProvider->setProject($this->getConfig()->getProject());
        $configDataProvider->setImageName($this->getConfig()->getImageName());
        $configDataProvider->setDumpDirectory($this->getConfig()->getDumpDirectory());

        return new Dumper(
            $configDataProvider,
            $this->getDockerFacade()
        );
    }
1035457
public function addLoader($id, $loader)
    {
        if (!array_key_exists($id, $this->loaders)) {
            $this->loaders[$id] = $loader;
        }
    }
230252
public function addIdHandler($id, $pointer, $obj = null) {
		$this->idhandlers[$id] = array($pointer, $obj);
	}
891501
private function initDataProviders()
    {
        $this->dataProviders = [];

        foreach ($this->loadDataProviders() as $name => $dataProvider) {
            $this->dataProviders[$name] = $dataProvider;
        }
    }
595193
public function register()
    {
        $this->registerAlias();

        $this->app->bind('data.provider', function ($app) {
            return new DataProvider($this->resolveRequestData($app['request']));
        });
    }
56498
public function registerProvider($id, $provider)
	{
		if (is_array($provider)) {
			$provider['id'] = $id;
			$provider = Yii::createObject($provider);
		}
		if (!($provider instanceof ProviderInterface)) {
			throw new InvalidConfigException("Invalid provider provided to key provider component");
		}
		$this->providers[$id] = $provider;
	}
743557
protected function transformDataProvider(DataProviderInterface $dataProvider)
    {
        if (Craft::$app->getRequest()->getIsHead()) {
            return null;
        } else {
            if (!$transformer = $this->dataTransformer()) {
                return $dataProvider;
            }

            // The transformed data
            $models = Factory::collection(
                $this->resolveTransformer($transformer),
                $dataProvider->getModels(),
                $this->getTransformConfig()
            );

            if ($this->collectionEnvelope === null) {
                return $models;
            } else {
                return [
                    $this->collectionEnvelope => $models,
                ];
            }
        }
    }
112990
public function authenticate(IdentityProvider $identityProvider)
    {
        try {
            // Authenticate the user.
            $identityProvider->authenticate();
            // Success!
            $this->isAuthenticated = true;
            // Set the data obtained from the identity provider.
            $this->name = $identityProvider->getUserName();
            $this->email = $identityProvider->getUserEmail();
        } catch (IdentityException $exception) {
            $this->isAuthenticated = false;
            throw $exception;
        }
    }
1023770
protected function getDataTablesCSVExporter(DataTablesProviderInterface $dtProvider) {

        $this->getLogger()->debug(sprintf("DataTables controller search for a CSV exporter with name \"%s\"", $dtProvider->getName()));

        $dtExporter = $dtProvider->getCSVExporter();
        if (false === ($dtExporter instanceOf DataTablesCSVExporterInterface)) {
            throw new BadDataTablesCSVExporterException($dtExporter);
        }

        $this->getLogger()->debug(sprintf("DataTables controller found a CSV exporter with name \"%s\"", $dtProvider->getName()));

        return $dtExporter;
    }
276001
protected function getData($id, FamilyInterface $family = null): DataInterface
    {
        if ($id instanceof DataInterface) {
            $data = $id;
        } else {
            $dataClass = $this->container->getParameter('sidus_eav_model.entity.data.class');
            if ($family) {
                $dataClass = $family->getDataClass();
            }
            /** @var DataInterface $data */
            $data = $this->getDoctrine()->getRepository($dataClass)->find($id);

            if (!$data) {
                throw new NotFoundHttpException("No data found with id : {$id}");
            }
        }
        if (!$family) {
            $family = $data->getFamily();
        }
        $this->initDataFamily($data, $family);

        return $data;
    }
7110
public function initialize(DataProviderInterface $dataProvider)
    {
        $this->dataProvider = $dataProvider;
        $contextConfiguration = ['workspaceName' => 'live', 'invisibleContentShown' => true];
        $context = $this->contextFactory->create($contextConfiguration);
        $this->rootNode = $context->getRootNode();

        $this->applyOption($this->storageNodeNodePath, 'storageNodeNodePath');
        $this->applyOption($this->nodeTypeName, 'nodeTypeName');

        if (isset($this->options['siteNodePath']) || isset($this->options['siteNodeIdentifier'])) {
            $siteNodePath = isset($this->options['siteNodePath']) ? trim($this->options['siteNodePath']) : null;
            $siteNodeIdentifier = isset($this->options['siteNodeIdentifier']) ? trim($this->options['siteNodeIdentifier']) : null;
            $this->siteNode = $this->rootNode->getNode($siteNodePath) ?: $context->getNodeByIdentifier($siteNodeIdentifier);
            if ($this->siteNode === null) {
                throw new Exception(sprintf('Site node not found (%s)', $siteNodePath ?: $siteNodeIdentifier), 1425077201);
            }
        } else {
            $this->log(get_class($this) . ': siteNodePath is not defined. Please make sure to set the target siteNodePath in your importer options.', LOG_WARNING);
        }
    }
992341
public function addRoleProvider(RoleProvider $provider)
    {
        $this->loaded && $this->loaded->__invoke();

        $this->roleProviders[] = $provider;

        return $this;
    }
663774
public function add(string $id): self
    {
        if (!isset($this->data[$id])) {
            $registeredAddon = \BearFramework\Addons::get($id);
            if ($registeredAddon === null) {
                throw new \Exception('The addon ' . $id . ' is not registered!');
            }
            $registeredAddonOptions = $registeredAddon->options;
            if (isset($registeredAddonOptions['require']) && is_array($registeredAddonOptions['require'])) {
                foreach ($registeredAddonOptions['require'] as $requiredAddonID) {
                    if (is_string($requiredAddonID) && !isset($this->data[$requiredAddonID])) {
                        $this->add($requiredAddonID);
                    }
                }
            }

            $dir = $registeredAddon->dir;
            $this->data[$id] = new \BearFramework\App\Addon($id, $dir);
            $this->app->contexts->add($dir);
        }
        return $this;
    }