Drupal 8  8.0.2
BookOutlineStorage Class Reference
Inheritance diagram for BookOutlineStorage:

Public Member Functions

 __construct (Connection $connection)
 
 getBooks ()
 
 hasBooks ()
 
 loadMultiple ($nids, $access=TRUE)
 
 getChildRelativeDepth ($book_link, $max_depth)
 
 delete ($nid)
 
 loadBookChildren ($pid)
 
 getBookMenuTree ($bid, $parameters, $min_depth, $max_depth)
 
 insert ($link, $parents)
 
 update ($nid, $fields)
 
 updateMovedChildren ($bid, $original, $expressions, $shift)
 
 countOriginalLinkChildren ($original)
 
 getBookSubtree ($link, $max_depth)
 

Protected Attributes

 $connection
 

Detailed Description

Defines a storage class for books outline.

Constructor & Destructor Documentation

__construct ( Connection  $connection)

Constructs a BookOutlineStorage object.

Member Function Documentation

countOriginalLinkChildren (   $original)

{Count the number of original link children.

Parameters
array$originalThe book link array.
Returns
int Number of children.
}

Implements BookOutlineStorageInterface.

delete (   $nid)

{Deletes a book entry.

Parameters
int$nidDeletes a book entry.
Returns
mixed Number of deleted book entries.
}

Implements BookOutlineStorageInterface.

getBookMenuTree (   $bid,
  $parameters,
  $min_depth,
  $max_depth 
)

{Builds tree data used for the menu tree.

Parameters
int$bidThe ID of the book that we are building the tree for.
array$parametersAn associative array of build parameters. For info about individual parameters see BookManager::bookTreeBuild().
int$min_depthThe minimum depth of book links in the resulting tree.
int$max_depthThe maximum supported depth of the book tree.
Returns
array Array of loaded book links.
}

Implements BookOutlineStorageInterface.

getBooks ( )

{Gets books (the highest positioned book links).

Returns
array An array of book IDs.
}

Implements BookOutlineStorageInterface.

getBookSubtree (   $link,
  $max_depth 
)

{Get book subtree.

Parameters
array$linkA fully loaded book link.
int$max_depthThe maximum supported depth of the book tree.
Returns
array Array of unordered subtree book items.
}

Implements BookOutlineStorageInterface.

References db_select().

Here is the call graph for this function:

getChildRelativeDepth (   $book_link,
  $max_depth 
)

{Gets child relative depth.

Parameters
array$book_linkThe book link.
int$max_depthThe maximum supported depth of the book tree.
Returns
int The depth of the searched book.
}

Implements BookOutlineStorageInterface.

hasBooks ( )

{Checks if there are any books.

Returns
bool TRUE if there are books, FALSE if not.
}

Implements BookOutlineStorageInterface.

insert (   $link,
  $parents 
)

{Inserts a book link.

Parameters
array$linkThe link array to be inserted in the database.
array$parentsThe array of parent ids for the link to be inserted.
Returns
mixed The last insert ID of the query, if one exists.
}

Implements BookOutlineStorageInterface.

loadBookChildren (   $pid)

{Loads book's children using it's parent ID.

Parameters
int$pidThe book's parent ID.
Returns
array Array of loaded book items.
}

Implements BookOutlineStorageInterface.

loadMultiple (   $nids,
  $access = TRUE 
)

{Loads books.Each book entry consists of the following keys:

  • bid: The node ID of the main book.
  • nid: The node ID of the book entry itself.
  • pid: The parent node ID of the book.
  • has_children: A boolean to indicate whether the book has children.
  • weight: The weight of the book entry to order siblings.
  • depth: The depth in the menu hierarchy the entry is placed into.
Parameters
array$nidsAn array of node IDs.
bool$accessWhether access checking should be taken into account.
Returns
array Array of loaded book items.
}

Implements BookOutlineStorageInterface.

update (   $nid,
  $fields 
)

{Updates book reference for links that were moved between books.

Parameters
int$nidThe nid of the book entry to be updated.
array$fieldsThe array of fields to be updated.
Returns
mixed The number of rows matched by the update query.
}

Implements BookOutlineStorageInterface.

updateMovedChildren (   $bid,
  $original,
  $expressions,
  $shift 
)

{Update the book ID of the book link that it's being moved.

Parameters
int$bidThe ID of the book whose children we move.
array$originalThe original parent of the book link.
array$expressionsArray of expressions to be added to the query.
int$shiftThe difference in depth between the old and the new position of the element being moved.
Returns
mixed The number of rows matched by the update query.
}

Implements BookOutlineStorageInterface.


The documentation for this class was generated from the following file: