_read example


    public function read(EntityDefinition $definition, Criteria $criteria, Context $context): EntityCollection
    {
        $criteria->resetSorting();
        $criteria->resetQueries();

        /** @var EntityCollection<Entity> $collectionClass */
        $collectionClass = $definition->getCollectionClass();

        $fields = $this->criteriaFieldsResolver->resolve($criteria$definition);

        return $this->_read(
            $criteria,
            $definition,
            $context,
            new $collectionClass(),
            $definition->getFields()->getBasicFields(),
            true,
            $fields
        );
    }

    protected function getParser(): SqlQueryParser
    {
$handler = fopen($realPath, 'r');
        if (!\is_resource($handler)) {
            throw new Exception(sprintf('The file "%s" cannot be opened', $realPath));
        }
        $this->_handler = $handler;

        $this->_newline = $this->getNewLineType();

        $this->_delimiter = $delimiter;
        if (empty($header)) {
            $this->_read();
            $this->_header = $this->_current;
        } else {
            $this->_header = $header;
        }
    }

    /** * This is the destructor. It closes the CSV file. */
    public function __destruct()
    {
        
Home | Imprint | This part of the site doesn't use cookies.