3 namespace Drupal\forum;
5 use Drupal\node\NodeInterface;
8 * Handles CRUD operations to {forum_index} table.
10 interface ForumIndexStorageInterface {
13 * Returns the forum term id associated with an existing forum node.
15 * @param \Drupal\node\NodeInterface $node
16 * The existing forum node.
19 * The forum term id currently associated with the node.
21 public function getOriginalTermId(NodeInterface $node);
24 * Creates a record in {forum} table for the given node.
26 * @param \Drupal\node\NodeInterface $node
27 * The node for which the record is to be created.
29 public function create(NodeInterface $node);
32 * Reads an array of {forum} records for the given revision ids.
35 * An array of node revision ids.
37 * @return \Drupal\Core\Database\StatementInterface
38 * The records from {forum} for the given vids.
40 public function read(array $vids);
43 * Updates the {forum} table for the given node.
45 * @param \Drupal\node\NodeInterface $node
46 * The node for which the record is to be updated.
48 public function update(NodeInterface $node);
51 * Deletes the records in {forum} table for the given node.
53 * @param \Drupal\node\NodeInterface $node
54 * The node for which the records are to be deleted.
56 public function delete(NodeInterface $node);
59 * Deletes the records in {forum} table for a given node revision.
61 * @param \Drupal\node\NodeInterface $node
62 * The node revision for which the records are to be deleted.
64 public function deleteRevision(NodeInterface $node);
67 * Creates a {forum_index} entry for the given node.
69 * @param \Drupal\node\NodeInterface $node
70 * The node for which the index records are to be created.
72 public function createIndex(NodeInterface $node);
75 * Updates the {forum_index} records for a given node.
77 * @param \Drupal\node\NodeInterface $node
78 * The node for which the index records are to be updated.
80 public function updateIndex(NodeInterface $node);
83 * Deletes the {forum_index} records for a given node.
85 * @param \Drupal\node\NodeInterface $node
86 * The node for which the index records are to be deleted.
88 public function deleteIndex(NodeInterface $node);