简体   繁体   中英

How can i make one to many relation in parse using PHP

i have search alot but didn't find how to make relation in parse using php, even on parse php guide no examples are available , can you help me please

if you can show any example that would help many peoples who are looking for parse relation one to many

The best way to make a one-to-many relation is to use Pointer.

Here is an example from Parse's document :

Let's say we have a game app. The game keeps track of the player's score and achievements every time she chooses to play. In Parse, we can store this data in a single Game object. If the game becomes incredibly successful, each player will store thousands of Game objects in the system. For circumstances like this, where the number of relationships can be arbitrarily large, Pointers are the best option.

Suppose in this game app, we want to make sure that every Game object is associated with a Parse User. We can implement this like so:

$game = ParseObject::create("Game");
$game->set("createdBy", ParseUser::getCurrentUser());

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM