Dear Backendless,
I don’t know if it’s me but the code generated for PHP just doesn’t work. I had to debug CodeRunner just to get something running but there are too many things for me to even debug my own code.
For a start, PHP classes are generated with the wrong capitalisation. For instance, I have a table named ‘latest_post’ but the PHP class is called ‘Latest_post’, with a capital L. So I had to go and fix the code in ClassManager in order to be able to load the classes at runtime. Ok, this works. But then when I create a new entity and try to save it It get an error like so:
[ERROR] In Backendless SDK occurred error with message: "Backendless API return error: Wrong entity name character case for: Latest_post. Use existing table latest_post. Error code:2024"
So I went and changed the name of the classes in the generated code, as well as the name used as a parameter like so:
class Latest_post
=>
class latest_post
And:
return Backendless::$Data->of( 'Latest_post' )->save( $this )->getAsClass();
=>
return Backendless::$Data->of( 'latest_post' )->save( $this )->getAsClass();
After successfully saved a new object, I get the following error:
Fatal error: Call to undefined method com\backendless\blogme\models\latest_post::getAsClass() in /Volumes/Data/iPhone/Backendless/BlogMe/ServerCode/classes/com/backendless/blogme/models/Latest_post.php on line 95
Can you please indicate me a fix quickly so that I can get it to work? Is it OK to get rid of that getAsClass() call?
Thanks!