CristalTeam/php-api-wrapper

Creating without Saving

derekrprice opened this issue · 1 comments

I have API Objects that appear to work just fine, but in my tests I am trying to create models without saving. When I do so, I am unable to get the model properties. For instance:

$o = new APIModel([
    'a' => 1,
    'b' => 2
]);
Log::debug($o->a);

Echoes nothing. When I inspect $o->a with the debugger, I get "null". Similarly, relationships that work just fine when loading via the API fail when accessed on a new model object. Am I missing something or is this a bug?

Nevermind. When I actually rewrite the code this way, it passes. It must be some artifact of my test harness. Sorry to bother you.