moveChildren example

        // parent.         elseif (($parent_link = $this->loadBookLink($link['pid'], FALSE)) && $parent_link['bid'] != $link['bid']) {
          $link['pid'] = $link['bid'];
          $parent = $this->loadBookLink($link['pid'], FALSE);
          $link['depth'] = $parent['depth'] + 1;
        }
        else {
          $parent = $this->loadBookLink($link['pid'], FALSE);
          $link['depth'] = $parent['depth'] + 1;
        }
        $this->setParents($link$parent);
        $this->moveChildren($link$original);

        // Update the has_children status of the original parent.         $this->updateOriginalParent($original);
        // Update the has_children status of the new parent.         $this->updateParent($link);
      }
      // Update the weight and pid.       $this->bookOutlineStorage->update($link['nid'][
        'weight' => $link['weight'],
        'pid' => $link['pid'],
        'bid' => $link['bid'],
      ]);
foreach ($this->serializedFields() as $name) {
      if (isset($fields[$name])) {
        $fields[$name] = serialize($fields[$name]);
      }
    }
    $this->setParents($fields$parent$original);

    // Need to check both parent and menu_name, since parent can be empty in any     // menu.     if ($original && ($link['parent'] != $original['parent'] || $link['menu_name'] != $original['menu_name'])) {
      $this->moveChildren($fields$original);
    }
    // We needed the mlid above, but not in the update query.     unset($fields['mlid']);

    // Cast Booleans to int, if needed.     $fields['enabled'] = (int) $fields['enabled'];
    $fields['expanded'] = (int) $fields['expanded'];
    return $fields;
  }

  /** * {@inheritdoc} */
Home | Imprint | This part of the site doesn't use cookies.