3 namespace Drupal\forum;
5 use Drupal\node\NodeInterface;
9 * Handles CRUD operations to {forum_index} table.
11 interface ForumIndexStorageInterface {
14 * Returns the forum term id associated with an existing forum node.
16 * @param \Drupal\node\NodeInterface $node
17 * The existing forum node.
20 * The forum term id currently associated with the node.
22 public function getOriginalTermId(NodeInterface $node);
25 * Creates a record in {forum} table for the given node.
27 * @param \Drupal\node\NodeInterface $node
28 * The node for which the record is to be created.
30 public function create(NodeInterface $node);
33 * Reads an array of {forum} records for the given revision ids.
36 * An array of node revision ids.
38 * @return \Drupal\Core\Database\StatementInterface
39 * The records from {forum} for the given vids.
41 public function read(array $vids);
44 * Updates the {forum} table for the given node.
46 * @param \Drupal\node\NodeInterface $node
47 * The node for which the record is to be updated.
49 public function update(NodeInterface $node);
52 * Deletes the records in {forum} table for the given node.
54 * @param \Drupal\node\NodeInterface $node
55 * The node for which the records are to be deleted.
57 public function delete(NodeInterface $node);
60 * Deletes the records in {forum} table for a given node revision.
62 * @param \Drupal\node\NodeInterface $node
63 * The node revision for which the records are to be deleted.
65 public function deleteRevision(NodeInterface $node);
68 * Creates a {forum_index} entry for the given node.
70 * @param \Drupal\node\NodeInterface $node
71 * The node for which the index records are to be created.
73 public function createIndex(NodeInterface $node);
76 * Updates the {forum_index} records for a given node.
78 * @param \Drupal\node\NodeInterface $node
79 * The node for which the index records are to be updated.
81 public function updateIndex(NodeInterface $node);
84 * Deletes the {forum_index} records for a given node.
86 * @param \Drupal\node\NodeInterface $node
87 * The node for which the index records are to be deleted.
89 public function deleteIndex(NodeInterface $node);