Русское сообщество разработки на PHP-фреймворке Laravel.
Ты не вошёл. Вход тут.
Страницы 1
В строке $friendship->friendship создаются свойство и меняся далее в коде, однако свойство $friendship->user_fields не меняет свои значения
$friendships->map(function ($friendship, $id) use ($userId, &$array) {
$friendship->friendship = 'null';
$friendship->online = $friendship->user_session ? true : false;
if ($friendship->confirm) {
$friendship->friendship = 'confirm';
if ($friendship->online) {
$array['friends']['online']['objects'] [$id] = $friendship;
$array['friends']['online']['keys'] [] = $id;
}
$array['friends']['all']['objects'] [$id] = $friendship;
$array['friends']['all']['keys'] [] = $id;
} else {
if ($friendship->user_id == $userId) {
\Debugbar::info((string)$friendship);
$friendship->user_fields = '';
$friendship->user_session = '';
\Debugbar::info((string)$friendship);
$array['friendsRequests']['outgoing']['objects'] [$id] = $friendship;
$array['friendsRequests']['outgoing']['keys'] [] = $id;
} elseif ($friendship->friend_id == $userId) {
$array['friendsRequests']['incoming']['objects'] [$id] = $friendship;
$array['friendsRequests']['incoming']['keys'] [] = $id;
}
}
return $friendship;
});
строка 16
{"id":2,"user_id":3,"friend_id":1,"confirm":0,"created_at":"2019-07-11 15:59:53","updated_at":"2019-07-11 15:59:53","friendship":"null","online":true,"user_fields":[{"id":5,"user_id":3,"fields_id":35,"value":"\u0410\u043d\u043e\u043d\u0438\u043c"},{"id":6,"user_id":3,"fields_id":36,"value":"\u0410\u043d\u043e\u043d\u0438\u043c\u0443\u0441"}],"user_session":{"id":"rz6CwEuU8qwhZIzWphuhjxAkmRmAPEjahuQEWV1y","last_activity":1563716292,"user_id":3},"friend_fields":[{"id":1,"user_id":1,"fields_id":35,"value":"\u041b\u0435\u0433\u043e\u043b\u0430\u0441"},{"id":2,"user_id":1,"fields_id":36,"value":"\u042f\u043a\u043e\u0432\u043b\u0435\u0432\u0438\u0447"}],"friend_session":null}строка 19
info
{"id":2,"user_id":3,"friend_id":1,"confirm":0,"created_at":"2019-07-11 15:59:53","updated_at":"2019-07-11 15:59:53","friendship":"null","online":true,"user_fields":[{"id":5,"user_id":3,"fields_id":35,"value":"\u0410\u043d\u043e\u043d\u0438\u043c"},{"id":6,"user_id":3,"fields_id":36,"value":"\u0410\u043d\u043e\u043d\u0438\u043c\u0443\u0441"}],"user_session":{"id":"rz6CwEuU8qwhZIzWphuhjxAkmRmAPEjahuQEWV1y","last_activity":1563716292,"user_id":3},"friend_fields":[{"id":1,"user_id":1,"fields_id":35,"value":"\u041b\u0435\u0433\u043e\u043b\u0430\u0441"},{"id":2,"user_id":1,"fields_id":36,"value":"\u042f\u043a\u043e\u0432\u043b\u0435\u0432\u0438\u0447"}],"friend_session":null}
Связь со мной:
Скайп(с аватаркой) - shyraks
Телеграм - @Mramoris или +7 999 260 13 20
Не в сети
Пока ток убедился, что все значения свойств меняются кроме тех, у которых в значении коллекция или массив.
Связь со мной:
Скайп(с аватаркой) - shyraks
Телеграм - @Mramoris или +7 999 260 13 20
Не в сети
Страницы 1