Giter VIP home page Giter VIP logo

Comments (8)

Vartapep avatar Vartapep commented on July 17, 2024 1

My mistake, I did not include the class in my index.php. I was thinking it would be handled by autoload.php but this is not the case.

Thanks for looking into my problem and your tips.

from exact-php-client.

yohancreemers avatar yohancreemers commented on July 17, 2024

What do you mean by 'creating an instance of this class does not work'. Do you get an error message? All code looks fine to me, I had no problem running it.

Does the file-path match the name of the Namespace/Class (Picqer/Financials/Exact/ReportingBalance.php)? Otherwise the autoload function can't find the file.

from exact-php-client.

Vartapep avatar Vartapep commented on July 17, 2024

Yes the file-path is correct.
I do not get an error message. I have added some echo's for debugging purposes (See below). The '1' obviously is echoed, but the '2' does not echo. Also var_dump($RepBal) does not show anything.

try {
    echo '1';
    $RepBal = new \Picqer\Financials\Exact\ReportingBalance($connection);
    echo '2';        
}

from exact-php-client.

yohancreemers avatar yohancreemers commented on July 17, 2024

Try removing the try statement (no pun intended). You cannot use 'try' without 'catch' or 'finally'.

from exact-php-client.

Vartapep avatar Vartapep commented on July 17, 2024

I know, I have a catch statement in place, this is just part of my code. So that is not the problem.

from exact-php-client.

Vartapep avatar Vartapep commented on July 17, 2024

I started using this SDK today, I have successfully retrieved my userID. But trying the same tactic for the ReportingBalance does not work. This is both try statements:

//Get UserID
try {
    $UserInfo = new \Picqer\Financials\Exact\Me($connection);
    $UserID = $UserInfo->find()->UserID;
    echo $UserID;
} catch (\Exception $e) {
    echo get_class($e) . ' : ' . $e->getMessage();
}


try {
    echo '1';
    $RepBal = new \Picqer\Financials\Exact\ReportingBalance($connection);
    var_dump($RepBal);


} catch (\Exception $e) {
    echo get_class($e) . ' : ' . $e->getMessage();
}

from exact-php-client.

yohancreemers avatar yohancreemers commented on July 17, 2024

Hmm, strange. When I copy/paste your code into my project, it just works fine. Have no clue what goes wrong in your project.

from exact-php-client.

stephangroen avatar stephangroen commented on July 17, 2024

If you can see the '1' and not the '2' there has to be some kind of error that's happening. I also c/p your code into the client and it works fine :)

    $reportingBalance = new \Picqer\Financials\Exact\ReportingBalance($connection);
    $balances = $reportingBalance->filter('', '', '', ['$top' => 1]);

    var_dump($balances);

from exact-php-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.