| @@ -85,11 +85,11 @@ | ||
| 85 | 85 | |
| 86 | 86 | public function getPostTreeMap(): array |
| 87 | 87 | { |
| 88 | 88 | if ($this->postTreeMap === null) { |
| 89 | - $query = "SELECT ID AS id, post_parent AS parentId, post_type AS type | |
| 90 | - FROM {$this->database->getPostsTable()} | |
| 91 | - WHERE post_parent != 0 AND post_type != 'revision'"; | |
| 89 | + $query = "SELECT `ID` AS `id`, `post_parent` AS `parentId`, `post_type` AS `type` | |
| 90 | + FROM `{$this->database->getPostsTable()}` | |
| 91 | + WHERE `post_parent` != 0 AND `post_type` != 'revision'"; | |
| 92 | 92 | |
| 93 | 93 | $this->postTreeMap = $this->getCachedTreeMap( |
| 94 | 94 | self::POST_TREE_MAP_CACHE_KEY, |
| 95 | 95 | ObjectHandler::GENERAL_POST_OBJECT_TYPE, |
| @@ -102,11 +102,11 @@ | ||
| 102 | 102 | |
| 103 | 103 | public function getTermTreeMap(): array |
| 104 | 104 | { |
| 105 | 105 | if ($this->termTreeMap === null) { |
| 106 | - $query = "SELECT term_id AS id, parent AS parentId, taxonomy AS type | |
| 107 | - FROM {$this->database->getTermTaxonomyTable()} | |
| 108 | - WHERE parent != 0"; | |
| 106 | + $query = "SELECT `term_id` AS `id`, `parent` AS `parentId`, `taxonomy` AS `type` | |
| 107 | + FROM `{$this->database->getTermTaxonomyTable()}` | |
| 108 | + WHERE `parent` != 0"; | |
| 109 | 109 | |
| 110 | 110 | $this->termTreeMap = $this->getCachedTreeMap( |
| 111 | 111 | self::TERM_TREE_MAP_CACHE_KEY, |
| 112 | 112 | ObjectHandler::GENERAL_TERM_OBJECT_TYPE, |
| @@ -138,14 +138,14 @@ | ||
| 138 | 138 | public function getTermPostMap(): array |
| 139 | 139 | { |
| 140 | 140 | if ($this->termPostMap === null) { |
| 141 | 141 | $select = " |
| 142 | - SELECT tr.object_id AS objectId, tt.term_id AS parentId, p.post_type AS type | |
| 143 | - FROM {$this->database->getTermRelationshipsTable()} AS tr | |
| 144 | - LEFT JOIN {$this->database->getPostsTable()} AS p | |
| 145 | - ON (tr.object_id = p.ID) | |
| 146 | - LEFT JOIN {$this->database->getTermTaxonomyTable()} AS tt | |
| 147 | - ON (tr.term_taxonomy_id = tt.term_taxonomy_id)"; | |
| 142 | + SELECT `tr`.`object_id` AS `objectId`, `tt`.`term_id` AS `parentId`, `p`.`post_type` AS `type` | |
| 143 | + FROM `{$this->database->getTermRelationshipsTable()}` AS `tr` | |
| 144 | + LEFT JOIN `{$this->database->getPostsTable()}` AS `p` | |
| 145 | + ON (`tr`.`object_id` = `p`.`ID`) | |
| 146 | + LEFT JOIN `{$this->database->getTermTaxonomyTable()}` AS `tt` | |
| 147 | + ON (`tr`.`term_taxonomy_id` = `tt`.`term_taxonomy_id`)"; | |
| 148 | 148 | |
| 149 | 149 | $this->termPostMap = $this->getCachedMap(self::TERM_POST_MAP_CACHE_KEY, $select); |
| 150 | 150 | } |
| 151 | 151 | |
| @@ -155,12 +155,12 @@ | ||
| 155 | 155 | public function getPostTermMap(): array |
| 156 | 156 | { |
| 157 | 157 | if ($this->postTermMap === null) { |
| 158 | 158 | $select = " |
| 159 | - SELECT tr.object_id AS parentId, tt.term_id AS objectId, tt.taxonomy AS type | |
| 160 | - FROM {$this->database->getTermRelationshipsTable()} AS tr | |
| 161 | - LEFT JOIN {$this->database->getTermTaxonomyTable()} AS tt | |
| 162 | - ON (tr.term_taxonomy_id = tt.term_taxonomy_id)"; | |
| 159 | + SELECT `tr`.`object_id` AS `parentId`, `tt`.`term_id` AS `objectId`, `tt`.`taxonomy` AS `type` | |
| 160 | + FROM `{$this->database->getTermRelationshipsTable()}` AS `tr` | |
| 161 | + LEFT JOIN `{$this->database->getTermTaxonomyTable()}` AS `tt` | |
| 162 | + ON (`tr`.`term_taxonomy_id` = `tt`.`term_taxonomy_id`)"; | |
| 163 | 163 | |
| 164 | 164 | $this->postTermMap = $this->getCachedMap(self::POST_TERM_MAP_CACHE_KEY, $select); |
| 165 | 165 | } |
| 166 | 166 | |