updateParent example


  public function saveBookLink(array $link$new) {
    // Keep track of Book IDs for cache clear.     $affected_bids[$link['bid']] = $link['bid'];
    $link += $this->getLinkDefaults($link['nid']);
    if ($new) {
      // Insert new.       $parents = $this->getBookParents($link(array) $this->loadBookLink($link['pid'], FALSE));
      $this->bookOutlineStorage->insert($link$parents);

      // Update the has_children status of the parent.       $this->updateParent($link);
    }
    else {
      $original = $this->loadBookLink($link['nid'], FALSE);
      // Using the Book ID as the key keeps this unique.       $affected_bids[$original['bid']] = $original['bid'];
      // Handle links that are moving.       if ($link['bid'] != $original['bid'] || $link['pid'] != $original['pid']) {
        // Update the bid for this page and all children.         if ($link['pid'] == 0) {
          $link['depth'] = 1;
          $parent = [];
        }
Home | Imprint | This part of the site doesn't use cookies.