Wants to call external class

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

You seem to be missing a line in the file. I gues the issue is the Site class is not correctly imported (even though there us a use statement).

Try and post the full exception, it should tell the issue

Class “Acme\Charity\Command\Acme\Charity\Basic\Site” not found

Type: Error
File: C:\xampp\htdocs\tutorial\Data\Temporary\Development\Cache\Code\Flow_Object_
Classes\Acme_Charity_Command_CsvCommandController.php
Line: 48

hmm the namespace is added relative somehow… (your above code should work)

try
new \Acme\Charity\Basic\Site()

I had already done this:
new \Acme\Charity\Basic\Site()
but it still doesn’t work :frowning:

how does the proxy class look like? thats the of flow generated class inside
C:\xampp\htdocs\tutorial\Data\Temporary\Development\Cache\Code\Flow_Object_ Classes\Acme_Charity_Command_CodesCommandController.php

I have now solved it in such a way that I no longer call my class. That’s a pity, but otherwise I can’t get the program to run.

FYI: The category “Creating Neos & Flow” is meant for core development. I moved your topic to “Using Neos & Flow”. This also allows you to mark the issue resolved

We tried to debug this but it works now :wink: