Commit 1c730d50 authored by Telenkov Ruslan's avatar Telenkov Ruslan

all done, new functions, one queue

parent 2550e5d1
......@@ -111,6 +111,16 @@ class MyService
$node = $this->loadNode($type, $id); // получаю ноду из базы для того, чтобы в дальнейшем создать связи для нее
// проверяю, если у ноды есть связанная сущность
$array_of_related_fields = ['species','films', 'starships', 'vehicles' , 'characters' , 'planets' , 'pilots' , 'people', 'residents' ];
//foreach ($row_item as $key => $value){
foreach ($array_of_related_fields as $related_field){
if (!empty($row_item->related_field)){
$array = $row_item->$related_field;
$current_field = $related_field;
$this->createRelation($node,$array,$current_field);
}
}
// }
if ($row_item->films!=[]) {
$array = $row_item->films; // получаю список ссылок связанных сущностей
$current_field = 'films';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment