knightzac19 / PHP-ArkData

This is a port of the C# ArkData library to PHP.
GNU General Public License v3.0
3 stars 1 forks source link

Recursive Player/Tribe Data #1

Open knightzac19 opened 8 years ago

knightzac19 commented 8 years ago

There is current a bug in the relationships between data that is causing PHP to do a recursive error on the object arrays. This causes issues if someone was to output the object array for a JSON request or if the player was the owner of their own tribe. Looking into a safe way to remove that recursiveness and still have the relationship.

knightzac19 commented 8 years ago

A workaround for this bug is to do use unset() to unset the Tribe->Players and Tribe->Owner of the player object when you're using the data on the frontend.

Example:

.....
$arkdata = $arkdata->getArkData();
foreach($arkdata[0] as $key => $value)
{
unset($value->Tribe->Players);
unset($value->Tribe->Owner);
//Do your other things here.
}
.....