BookOutlineStorage::insert

public BookOutlineStorage::insert($link, $parents)

Inserts a book link.

Parameters

array $link: The link array to be inserted in the database.

array $parents: The array of parent ids for the link to be inserted.

Return value

mixed The last insert ID of the query, if one exists.

Overrides BookOutlineStorageInterface::insert

File

core/modules/book/src/BookOutlineStorage.php, line 128

Class

BookOutlineStorage
Defines a storage class for books outline.

Namespace

Drupal\book

Code

public function insert($link, $parents) {
  return $this->connection
    ->insert('book')
    ->fields(array(
      'nid' => $link['nid'],
      'bid' => $link['bid'],
      'pid' => $link['pid'],
      'weight' => $link['weight'],
    ) + $parents
    )
    ->execute();
}
doc_Drupal
2016-10-29 08:48:25
Comments
Leave a Comment

Please login to continue.