You are here

function _book_copy_tree in Book Copy 7

Same name and namespace in other branches
  1. 6 book_copy.module \_book_copy_tree()

Copy the data tree that's been passed in.

1 call to _book_copy_tree()
_book_copy_get_book_history in ./book_copy.module
Render the data tree for display on the book history page.

File

./book_copy.module, line 279

Code

function _book_copy_tree($bid) {
  $result = db_select('book_copy_history', 'bch')
    ->fields('bch', array())
    ->condition('bch.sbid', $bid)
    ->execute();
  $children = array();
  foreach ($result as $row) {
    $bid = $row->bid;
    $children[$bid] = array(
      'copied' => $row->copied,
      'children' => _book_copy_tree($row->bid),
    );
  }
  return $children;
}