I want to read a csv file and make the values available to the system. Reading the csv file also works.
Here is my code and folder directory:
<?php
namespace Acme\Charity\Command;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Cli\CommandController;
use Neos\Flow\Mvc\Controller\ActionController;
use Acme\Charity\Domain\Model\Post;
use Acme\Charity\Basic\Site;
class CodesCommandController extends CommandController
{
protected $csvRepository;
/**
* @return mixed
*/
public function getCsvRepository()
{
return $this->csvRepository;
}
/**
* @param mixed $csvRepository
*/
public function setCsvRepository($csvRepository): void
{
$this->csvRepository = $csvRepository;
}
/**
* show the csv data
*
* This command imports the CSV files into the system
*
*/
public function importCommand()
{
$template = file_get_contents(
'resource://Acme.Charity/Private/Templates/data/codes.csv'
);
$this->setCsvRepository($template);
$site = new Site();
$site->getCsv();
}
}
Only when I then want to call another class do I get the error:
Type: Error
File: C:\xampp\htdocs\tutorial\Data\Temporary\Development\Cache\Code\Flow_Object_
Classes\Acme_Charity_Command_CodesCommandController.php
line: 48
Thank you for a support
LG Mark