Read all values from readers and store it into array of $name => reader $value
Throw exception if at least one reader cannot read value

@param array $dataSource
@return array All collected data from $this->readers
@throws MetadataInjectorReadException
172914
public function read(array $dataSource)
    {
        $data = $errors = [];

        foreach ($this->readers as $name => $reader) {
            try {
                $data[$name] = $reader->getValue($dataSource);
            } catch (MetadataReaderNotFoundException $e) {
                $errors[$name] = $e->getMessage();
            }
        }

        if (! empty($errors)) {
            foreach ($errors as $name => $error) {
                \common_Logger::d('Error on injector "' . __CLASS__ . '" with reader "' . $name . '" : ' . $error);
            }
            throw new MetadataInjectorReadException(
                'Injector "' . __CLASS__ . '" cannot read all required values from readers: ' . implode(', ', array_keys($errors))
            );
        }

        return $data;
    }
629723
public function setDataValues($dataValues = array(), $refreshDataSource = TRUE) {
		$this->_dataValues = PHPExcel_Calculation_Functions::flattenArray($dataValues);
		$this->_pointCount = count($dataValues);

		if ($refreshDataSource) {
			//	TO DO
		}

		return $this;
	}
594041
public double[] readTS(String dataFileName, int loadLimit) throws SAXException, IOException {

    Path path = Paths.get(dataFileName);
    if (!(Files.exists(path))) {
      throw new SAXException("unable to load data - data source not found.");
    }

    BufferedReader reader = Files.newBufferedReader(path, DEFAULT_CHARSET);

    return readTS(reader, 0, loadLimit);

  }
1055815
public function getMetadata(array $mappingSources): array
    {
        $mappingSources = $this->normalizeMappingSources($mappingSources);

        $cacheKey = $this->getCacheKey($mappingSources);

        if ($this->cache !== null && $this->cache->has($cacheKey)) {
            return $this->cache->get($cacheKey);
        }

        $metadata = \array_map(
            function (array $mappingSource) {
                return $this->driverFactory->getDriver($mappingSource)->getMetadata();
            },
            $mappingSources
        );
        $metadata = \count($metadata) > 0 ? \array_merge(...$metadata) : [];

        if ($this->cache !== null) {
            $this->cache->set($cacheKey, $metadata);
        }

        return $metadata;
    }
107687
public function getAdapter($name = null)
    {
        if (null === $name) {
            $name = $this->getDefaultDatasource();
        }
        if (!isset($this->adapters[$name])) {
            if (!isset($this->adapterClasses[$name])) {
                throw new AdapterException(sprintf('No adapter class defined for datasource "%s"', $name));
            }
            $this->adapters[$name] = AdapterFactory::create($this->adapterClasses[$name]);
        }

        return $this->adapters[$name];
    }
362628
public function setDataSources(array $datasources)
    {
        foreach ($datasources as $ds) {
            if (!$ds instanceof HTML_QuickForm2_DataSource) {
                throw new HTML_QuickForm2_InvalidArgumentException(
                    'Array should contain only DataSource instances'
                );
            }
        }
        $this->datasources = $datasources;
        $this->updateValue();
    }
216069
private function __buildDatasourcePooledParamList($datasources)
    {
        if (!is_array($datasources) || empty($datasources)) {
            return array();
        }

        $list = array();

        foreach ($datasources as $handle) {
            $rootelement = str_replace('_', '-', $handle);
            $list[] = '$ds-' . $rootelement;
        }

        return $list;
    }
82055
protected function getDataStream($dataSource, $dataSourceOptions = null)
    {
        $dataSourceOptions = array_merge([
            'schema' => $this->schema(),
            'dialect' => isset($this->descriptor()->dialect) ? $this->descriptor()->dialect : null,
        ], (array) $dataSourceOptions);

        return new TabularDataStream($this->normalizeDataSource($dataSource, $this->basePath), $dataSourceOptions);
    }
770754
final function FetchFromReader(DBInterfaces\IDatabaseReader $reader)
    {
        $objects = array();
        while($reader->Read())
        {
            $object = $this->CreateInstance($reader->ByName($this->KeyField()));
            $object->InitFromReader($reader);
            $objects[] = $object;
        }
        $reader->Close();
        return $objects;
    }
953681
private function getTemplates(DataSourceViewInterface $dataSource)
    {
        $templates = [];

        if (isset($this->themes[$dataSource->getName()])) {
            $templates[] = $this->themes[$dataSource->getName()];
        }

        $templates[] = $this->themes[self::DEFAULT_THEME];

        return $templates;
    }
198173
private function getKeyValue(array $dataItem): array
    {
        $result = [];
        $keyId = null;

        foreach ($this->mappingList as $mapKey => $mapItem) {
            $name = $mapItem[FieldsInterface::ARRAY_NAME];
            $type = $mapItem[FieldsInterface::ARRAY_TYPE] ?? FieldsInterface::TYPE_STRING;

            if (!key_exists($mapKey, $dataItem)) {
                $msg = vsprintf('Item "%s" not found in %s', [$mapKey, var_export($dataItem, true),]);
                throw new DbException($msg, DbException::WRONG_MAPPING);
            }

            $result[$name] = $this->convert($dataItem[$mapKey], $type);

            if (key_exists(FieldsInterface::ARRAY_KEY_PK, $mapItem)) {
                $keyId = $result[$name];
            }
        }

        return [$keyId, $result];
    }
1274398
public function getResourcesBySourceName($sourceName)
    {
        // Getting source object first
        $source = $this->getSourceByName($sourceName);

        // Getting the data
        if ($source instanceof SourceInterface) {
            // Getting result iterator
            try {
                return $source->getContentIterator();
            } catch (\Exception $e) {
                throw new Exception\SourceGetDataException(
                    sprintf(
                        'Exception caught while getting the content for the following source object: %s',
                        $source->toString()
                    )
                );
            }
        }
        return null;
    }
867940
public function setDataSource($dataSource)
    {
        if (!$dataSource instanceof DataSourceInterface) {
            $dataSource = $this->getServiceLocator()->get('DataGrid\Factory\DataSource')->get($dataSource);
        }
        $this->dataSource = $dataSource;
        return $this;
    }
831688
public function retrieveAll()
    {
        $adapterCollection = new MetaDataSourceCollection();

        foreach ($this->fileManager->glob(Installer::BASE_PATH . self::SOURCE_PATH . '*' . self::EXTENSION) as $file) {
            // Decode
            $config = $this->transtyper->decode($this->fileManager->fileGetContent($file));
            // Validate
            try {
                $this->arrayValidator->isValid('CrudGenerator\Metadata\MetaDataSource', $config);
            } catch (ValidationException $e) {
                continue; // Do nothing
            }

            // Hydrate
            $adapter = $this->metaDataSourceHydrator->adapterNameToMetaDataSource(
                $config[MetaDataSource::METADATA_DAO_FACTORY]
            );

            $adapter->setMetadataDaoFactory($config[MetaDataSource::METADATA_DAO_FACTORY]);
            $adapter->setMetadataDao($config[MetaDataSource::METADATA_DAO]);

            // Test if have a config
            if (isset($config[MetaDataSource::CONFIG]) === true) {
                $adapter->setConfig($this->driverHydrator->arrayToDto($config[MetaDataSource::CONFIG]));
            }

            $adapterCollection->append($adapter);
        }

        return $adapterCollection;
    }
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;
    }
100632
public function getEncryptedArray(array $dataSubArray, $password): array
    {
        $plainText = $this->getFactory()->createComputopApiMapper()->getDataPlainText($dataSubArray);
        $length = mb_strlen($plainText);

        $encryptedArray[ComputopApiConfig::DATA] = $this->getBlowfishEncryptedValue(
            $plainText,
            $length,
            $password
        );

        $encryptedArray[ComputopApiConfig::LENGTH] = $length;

        return $encryptedArray;
    }
1205279
protected function readValues($data, array $paths)
    {
        $extracted = [];

        foreach ($paths as $index => $path) {
            $index = (string)$index;

            if (is_array($path)) {
                try {
                    $array = $this->accessor->getValue($data, $index);

                    if (!is_array($array) && !$array instanceof Traversable) {
                        $array = [$array];
                    }
                } catch (ExceptionInterface $e) {
                    $array = [];
                }

                $results = [];

                foreach ($array as $value) {
                    if ($path) {
                        $results[] = $this->readValues($value, $path);
                    } else {
                        if ($value = $this->convert($value)) {
                            $results[] = $value;
                        }
                    }
                }

                $extracted[$index] = $results;
            } else {
                $extracted[$index] = $this->readString($data, $path);
            }
        }

        return $extracted;
    }