-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating a new class #72
Comments
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. |
Yes the file-path is correct.
|
Try removing the try statement (no pun intended). You cannot use 'try' without 'catch' or 'finally'. |
I know, I have a catch statement in place, this is just part of my code. So that is not the problem. |
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:
|
Hmm, strange. When I copy/paste your code into my project, it just works fine. Have no clue what goes wrong in your project. |
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); |
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. |
I have created a new class 'ReportingBalance.php' using the code below. However, creating an instance of this class does not work.
Im trying to create the new instance using:
$RepBal = new \Picqer\Financials\Exact\ReportingBalance($connection);
And I have created the new class using:
Am I missing something in the creation of the class?
The text was updated successfully, but these errors were encountered: