Constructs the object

@param \Zepi\DataSource\Core\DataAccess\DataAccessInterface $dataSource
179467
abstract public function __construct(DataAccessInterface $dataSource);
    
    /**
     * Returns an array with all entities for the given data request.
     * 
     * @param \Zepi\DataSource\Core\DataRequest $dataRequest
     * @return false|array
     */
    public function find(DataRequest $dataRequest)
    {
        return $this->dataSource->find($dataRequest);
    }
753409
public void setDataSourceConnectionSource(ConnectionSource<DataSource, DataSourceSettings> connectionSource) {
        this.dataSourceName = connectionSource.getName();
        DataSource source = connectionSource.getSource();
        getProperties().put(Environment.DATASOURCE, source);
        getProperties().put(Environment.CURRENT_SESSION_CONTEXT_CLASS, GrailsSessionContext.class.getName());
        final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
        if (contextClassLoader != null && contextClassLoader.getClass().getSimpleName().equalsIgnoreCase("RestartClassLoader")) {
            getProperties().put(AvailableSettings.CLASSLOADERS, contextClassLoader);
        } else {
            getProperties().put(AvailableSettings.CLASSLOADERS, connectionSource.getClass().getClassLoader());
        }
    }
1342446
protected function prepareDatasourceFiles(array $datasourceFiles)
    {

        // initialize the array for the prepared datasources
        $ds = array();

        // prepare the datasources
        foreach ($datasourceFiles as $datasourceFile) {
            // explode the directoriy names from the app base path
            $contextPath = explode(DIRECTORY_SEPARATOR, ltrim(str_replace(sprintf('%s', $this->getAppBase()), '', $datasourceFile), DIRECTORY_SEPARATOR));
            // the first element IS the context name
            $contextName = reset($contextPath);
            // create the path to the web application
            $webappPath = $this->getDatasourceService()->getWebappsDir($this->getContainer()->getContainerNode(), $contextName);
            // append it to the array with the prepared datasources
            $ds[] = array($datasourceFile, $webappPath, $contextName);
        }

        // return the array with the prepared datasources
        return $ds;
    }
1282744
public function storeDatasources(array $datasources)
    {
        foreach ($datasources as $ds) {
            if (!$ds instanceof HTML_QuickForm2_DataSource) {
                throw new HTML_QuickForm2_InvalidArgumentException(
                    'Array should contain only DataSource instances'
                );
            }
        }
        $this->data['datasources'] = $datasources;
    }
496511
public function execute(DataSetInterface $dataSet): void
    {
        $shoppingListEntity = $this->createShoppingListQuery()
            ->filterByKey($dataSet[ShoppingListDataSetInterface::COLUMN_KEY])
            ->findOneOrCreate();

        $shoppingListEntity
            ->setName($dataSet[ShoppingListDataSetInterface::COLUMN_NAME])
            ->setCustomerReference($dataSet[ShoppingListDataSetInterface::COLUMN_OWNER_CUSTOMER_REFERENCE])
            ->save();
    }
140568
public static function create($method, DataSource $annotation = null) {
        Str::assert($method, 'method');

        $annotationStatusCodes = !empty($annotation) && $annotation->getStatusCodes() !== null ? $annotation->getStatusCodes() : array();
        return $annotationStatusCodes ?: self::$expectedStatusCodes[$method];
    }
14803
private function getVars(DataSourceViewInterface $dataSource)
    {
        return isset($this->themesVars[$dataSource->getName()])
            ? $this->themesVars[$dataSource->getName()]
            : []
        ;
    }
1309661
public function setDataSource($data)
    {
        if ($data instanceof DataSource\DataSourceInterface) {
            $this->dataSource = $data;
        } elseif (is_array($data)) {
            $this->dataSource = new DataSource\PhpArray($data);
        } elseif ($data instanceof QueryBuilder) {
            $this->dataSource = new DataSource\Doctrine2($data);
        } elseif ($data instanceof ZendSelect) {
            $args = func_get_args();
            if (count($args) === 1 ||
                (! $args[1] instanceof \Zend\Db\Adapter\Adapter && ! $args[1] instanceof \Zend\Db\Sql\Sql)
            ) {
                throw new \InvalidArgumentException(
                    'For "Zend\Db\Sql\Select" also a "Zend\Db\Adapter\Sql" or "Zend\Db\Sql\Sql" is needed.'
                );
            }
            $this->dataSource = new DataSource\ZendSelect($data);
            $this->dataSource->setAdapter($args[1]);
        } elseif ($data instanceof Collection) {
            $args = func_get_args();
            if (count($args) === 1 || ! $args[1] instanceof \Doctrine\ORM\EntityManager) {
                throw new \InvalidArgumentException(
                    'If providing a Collection, also the Doctrine\ORM\EntityManager is needed as a second parameter'
                );
            }
            $this->dataSource = new DataSource\Doctrine2Collection($data);
            $this->dataSource->setEntityManager($args[1]);
        } else {
            throw new \InvalidArgumentException(
                '$data must implement the interface ZfcDatagrid\DataSource\DataSourceInterface'
            );
        }
    }
860206
public function fromFileSource(FileSourceInterface $fileSource)
    {
        if ($fileSource instanceof PathSourceInterface) {
            return $this->fromPath($fileSource->getPath());
        }

        throw new RuntimeException('Unsupported file source');
    }
230229
public function execute($method, $resource, array $data = [])
    {
        $request = new Request($this->handler);
        $dataResource = $request->execute($method, $this->makeUrl($resource), array_merge($data, [
            'headers' => [
                'Authorization' => sprintf('Basic %s', base64_encode($this->token . ':' . ''))
            ]
        ]));

        return $dataResource;
    }
84687
public function setSource($source)
    {
        if ($source instanceof DataList) {
            $this->setDataClass($source->dataClass());
        }
        
        return parent::setSource($source);
    }
296356
private function process(ViewSource $source, ContextInterface $context): ViewSource
    {
        foreach ($this->processors as $processor) {
            $source = $processor->process($source, $context);
        }

        return $source;
    }
1192201
public function persist(NodeInterface $datasourceNode)
    {
        $systemConfiguration = $this->getSystemConfiguration();
        $systemConfiguration->attachDatasource($datasourceNode);
        $this->setSystemConfiguration($systemConfiguration);
    }
1026433
public function execute(DataSetInterface $dataSet): void
    {
        $shoppingListCompanyUserEntity = $this->createShoppingListCompanyUserQuery()
            ->filterByFkShoppingList($dataSet[ShoppingListCompanyUserDataSetInterface::ID_SHOPPING_LIST])
            ->filterByFkCompanyUser($dataSet[ShoppingListCompanyUserDataSetInterface::ID_COMPANY_USER])
            ->findOneOrCreate();

        $shoppingListCompanyUserEntity
            ->setFkShoppingListPermissionGroup($dataSet[ShoppingListCompanyUserDataSetInterface::ID_PERMISSION_GROUP])
            ->save();
    }
32607
public final void setDataSource(DataSource dataSource) {
		if (this.jdbcTemplate == null || dataSource != this.jdbcTemplate.getDataSource()) {
			this.jdbcTemplate = createJdbcTemplate(dataSource);
			initTemplateConfig();
		}
	}
1170022
public function execute(DataSetInterface $dataSet): void
    {
        $dataSet = $this->filterDataSet($dataSet);

        $spyProductMeasurementSalesUnitEntity = $this->saveProductMeasurementSalesUnit($dataSet);

        $this->addPublishEvents(
            static::PRODUCT_CONCRETE_MEASUREMENT_UNIT_PUBLISH,
            $spyProductMeasurementSalesUnitEntity->getFkProduct()
        );
    }
1119993
private function checkDataSourceName($name, DataSourceInterface $datasource = null)
    {
        if (empty($name)) {
            throw new DataSourceException('Name of data source can\'t be empty.');
        }

        if (isset($this->datasources[$name]) && ($this->datasources[$name] !== $datasource)) {
            throw new DataSourceException('Name of data source must be unique.');
        }

        if (!preg_match('/^[\w\d]+$/', $name)) {
            throw new DataSourceException('Name of data source may contain only word characters and digits.');
        }
    }