comparison core/modules/node/src/NodeStorage.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 4c8ae668cc8c
children
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
17 /** 17 /**
18 * {@inheritdoc} 18 * {@inheritdoc}
19 */ 19 */
20 public function revisionIds(NodeInterface $node) { 20 public function revisionIds(NodeInterface $node) {
21 return $this->database->query( 21 return $this->database->query(
22 'SELECT vid FROM {node_revision} WHERE nid=:nid ORDER BY vid', 22 'SELECT vid FROM {' . $this->getRevisionTable() . '} WHERE nid=:nid ORDER BY vid',
23 [':nid' => $node->id()] 23 [':nid' => $node->id()]
24 )->fetchCol(); 24 )->fetchCol();
25 } 25 }
26 26
27 /** 27 /**
28 * {@inheritdoc} 28 * {@inheritdoc}
29 */ 29 */
30 public function userRevisionIds(AccountInterface $account) { 30 public function userRevisionIds(AccountInterface $account) {
31 return $this->database->query( 31 return $this->database->query(
32 'SELECT vid FROM {node_field_revision} WHERE uid = :uid ORDER BY vid', 32 'SELECT vid FROM {' . $this->getRevisionDataTable() . '} WHERE uid = :uid ORDER BY vid',
33 [':uid' => $account->id()] 33 [':uid' => $account->id()]
34 )->fetchCol(); 34 )->fetchCol();
35 } 35 }
36 36
37 /** 37 /**
38 * {@inheritdoc} 38 * {@inheritdoc}
39 */ 39 */
40 public function countDefaultLanguageRevisions(NodeInterface $node) { 40 public function countDefaultLanguageRevisions(NodeInterface $node) {
41 return $this->database->query('SELECT COUNT(*) FROM {node_field_revision} WHERE nid = :nid AND default_langcode = 1', [':nid' => $node->id()])->fetchField(); 41 return $this->database->query('SELECT COUNT(*) FROM {' . $this->getRevisionDataTable() . '} WHERE nid = :nid AND default_langcode = 1', [':nid' => $node->id()])->fetchField();
42 } 42 }
43 43
44 /** 44 /**
45 * {@inheritdoc} 45 * {@inheritdoc}
46 */ 46 */
47 public function updateType($old_type, $new_type) { 47 public function updateType($old_type, $new_type) {
48 return $this->database->update('node') 48 return $this->database->update($this->getBaseTable())
49 ->fields(['type' => $new_type]) 49 ->fields(['type' => $new_type])
50 ->condition('type', $old_type) 50 ->condition('type', $old_type)
51 ->execute(); 51 ->execute();
52 } 52 }
53 53
54 /** 54 /**
55 * {@inheritdoc} 55 * {@inheritdoc}
56 */ 56 */
57 public function clearRevisionsLanguage(LanguageInterface $language) { 57 public function clearRevisionsLanguage(LanguageInterface $language) {
58 return $this->database->update('node_revision') 58 return $this->database->update($this->getRevisionTable())
59 ->fields(['langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED]) 59 ->fields(['langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED])
60 ->condition('langcode', $language->getId()) 60 ->condition('langcode', $language->getId())
61 ->execute(); 61 ->execute();
62 } 62 }
63 63