You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a failure with my GQL usage rather than php-gds I think, but I'm getting the error:
"__key__ filter value must be a Key" in my php logs when I do the following query:
$user_obj = $obj_store->query("SELECT * FROM Users WHERE __key__ = @userid", ['userid' => $userid])->fetchOne();
where $userid is the Datastore-assigned numeric key for that particular user from an earlier GQL query which I obtain with getKeyId() and is then stored in the PHP $_SESSION.
I tried changing the query to:
$user_obj = $obj_store->query("SELECT * FROM Users WHERE __key__ = KEY(Users, ".$userid.")");
but got the error:
"Argument 1 passed to GDS\Gateway::putMulti() must be of the type array, object given"
Any suggestions much appreciated!
Also, I'm not clear on when I should use (in a WHERE clause): __key__ = KEY(Store, item-to-match) vs. __key__ = @param", ['param'] => $item-to-match
Many thanks!
The text was updated successfully, but these errors were encountered:
OK, after quite a bit more rooting around in the source code and examples I discovered I should actually be using $user_obj = $obj_store->fetchById($userid);
So just wanted to clarify my 2nd Q if poss! I'm not clear on when I should use (in a WHERE clause): __key__ = KEY(Store, item-to-match) vs. __key__ = @param", ['param'] => $item-to-match
This is a failure with my GQL usage rather than php-gds I think, but I'm getting the error:
"
__key__ filter value must be a Key
" in my php logs when I do the following query:$user_obj = $obj_store->query("SELECT * FROM Users WHERE __key__ = @userid", ['userid' => $userid])->fetchOne();
where $userid is the Datastore-assigned numeric key for that particular user from an earlier GQL query which I obtain with getKeyId() and is then stored in the PHP $_SESSION.
I tried changing the query to:
$user_obj = $obj_store->query("SELECT * FROM Users WHERE __key__ = KEY(Users, ".$userid.")");
but got the error:
"
Argument 1 passed to GDS\Gateway::putMulti() must be of the type array, object given
"Any suggestions much appreciated!
Also, I'm not clear on when I should use (in a WHERE clause):
__key__ = KEY(Store, item-to-match)
vs.__key__ = @param", ['param'] => $item-to-match
Many thanks!
The text was updated successfully, but these errors were encountered: