| @@ 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 | { |
|
| @@ 49-65 (lines=17) @@ | ||
| 46 | * |
|
| 47 | * @return array|false |
|
| 48 | */ |
|
| 49 | public function getPostByType($type, $type_id) |
|
| 50 | { |
|
| 51 | $query = " |
|
| 52 | SELECT * |
|
| 53 | FROM `jpemeric_stream`.`post` |
|
| 54 | WHERE `type` = :type && `type_id` = :type_id |
|
| 55 | LIMIT 1"; |
|
| 56 | $bindings = [ |
|
| 57 | 'type' => $type, |
|
| 58 | 'type_id' => $type_id, |
|
| 59 | ]; |
|
| 60 | ||
| 61 | return $this |
|
| 62 | ->connections |
|
| 63 | ->getRead() |
|
| 64 | ->fetchOne($query, $bindings); |
|
| 65 | } |
|
| 66 | ||
| 67 | /** |
|
| 68 | * @param integer $limit |
|