| @@ 27-43 (lines=17) @@ | ||
| 24 | * |
|
| 25 | * @return array|false |
|
| 26 | */ |
|
| 27 | public function findByType($type, $value = '') |
|
| 28 | { |
|
| 29 | $query = " |
|
| 30 | SELECT `title`, `content`, `image` |
|
| 31 | FROM `jpemeric_blog`.`introduction` |
|
| 32 | WHERE `type` = :type AND `value` = :value |
|
| 33 | LIMIT 1"; |
|
| 34 | $bindings = [ |
|
| 35 | 'type' => $type, |
|
| 36 | 'value' => $value, |
|
| 37 | ]; |
|
| 38 | ||
| 39 | return $this |
|
| 40 | ->connections |
|
| 41 | ->getRead() |
|
| 42 | ->fetchOne($query, $bindings); |
|
| 43 | } |
|
| 44 | } |
|
| 45 | ||
| @@ 26-41 (lines=16) @@ | ||
| 23 | * |
|
| 24 | * @return array|false |
|
| 25 | */ |
|
| 26 | public function findTagByTitle($title) |
|
| 27 | { |
|
| 28 | $query = " |
|
| 29 | SELECT * |
|
| 30 | FROM `jpemeric_blog`.`tag` |
|
| 31 | WHERE `tag` = :title |
|
| 32 | LIMIT 1"; |
|
| 33 | $bindings = [ |
|
| 34 | 'title' => $title, |
|
| 35 | ]; |
|
| 36 | ||
| 37 | return $this |
|
| 38 | ->connections |
|
| 39 | ->getRead() |
|
| 40 | ->fetchOne($query, $bindings); |
|
| 41 | } |
|
| 42 | ||
| 43 | public function getAllTags() |
|
| 44 | { |
|