@@ -4,5 +4,5 @@ |
||
| 4 | 4 | |
| 5 | 5 | interface IntroductionRepository |
| 6 | 6 | { |
| 7 | - public function findByType($type, $value = ''); |
|
| 7 | + public function findByType($type, $value = ''); |
|
| 8 | 8 | } |
@@ -7,38 +7,38 @@ |
||
| 7 | 7 | class MysqlIntroductionRepository implements IntroductionRepository |
| 8 | 8 | { |
| 9 | 9 | |
| 10 | - /** @var Aura\Sql\ConnectionLocator */ |
|
| 11 | - protected $connections; |
|
| 10 | + /** @var Aura\Sql\ConnectionLocator */ |
|
| 11 | + protected $connections; |
|
| 12 | 12 | |
| 13 | - /** |
|
| 14 | - * @param Aura\Sql\ConnectionLocator |
|
| 15 | - */ |
|
| 16 | - public function __construct(ConnectionLocator $connections) |
|
| 17 | - { |
|
| 18 | - $this->connections = $connections; |
|
| 19 | - } |
|
| 13 | + /** |
|
| 14 | + * @param Aura\Sql\ConnectionLocator |
|
| 15 | + */ |
|
| 16 | + public function __construct(ConnectionLocator $connections) |
|
| 17 | + { |
|
| 18 | + $this->connections = $connections; |
|
| 19 | + } |
|
| 20 | 20 | |
| 21 | - /** |
|
| 22 | - * @param string $type |
|
| 23 | - * @param string $value |
|
| 24 | - * |
|
| 25 | - * @return array|false |
|
| 26 | - */ |
|
| 27 | - public function findByType($type, $value = '') |
|
| 28 | - { |
|
| 29 | - $query = " |
|
| 21 | + /** |
|
| 22 | + * @param string $type |
|
| 23 | + * @param string $value |
|
| 24 | + * |
|
| 25 | + * @return array|false |
|
| 26 | + */ |
|
| 27 | + public function findByType($type, $value = '') |
|
| 28 | + { |
|
| 29 | + $query = " |
|
| 30 | 30 | SELECT `title`, `content`, `image` |
| 31 | 31 | FROM `jpemeric_blog`.`introduction` |
| 32 | 32 | WHERE `type` = :type AND `value` = :value |
| 33 | 33 | LIMIT 1"; |
| 34 | - $bindings = [ |
|
| 35 | - 'type' => $type, |
|
| 36 | - 'value' => $value, |
|
| 37 | - ]; |
|
| 34 | + $bindings = [ |
|
| 35 | + 'type' => $type, |
|
| 36 | + 'value' => $value, |
|
| 37 | + ]; |
|
| 38 | 38 | |
| 39 | - return $this |
|
| 40 | - ->connections |
|
| 41 | - ->getRead() |
|
| 42 | - ->fetchOne($query, $bindings); |
|
| 43 | - } |
|
| 39 | + return $this |
|
| 40 | + ->connections |
|
| 41 | + ->getRead() |
|
| 42 | + ->fetchOne($query, $bindings); |
|
| 43 | + } |
|
| 44 | 44 | } |
@@ -43,9 +43,9 @@ |
||
| 43 | 43 | |
| 44 | 44 | private function get_recent_posts() |
| 45 | 45 | { |
| 46 | - global $container; |
|
| 47 | - $postRepository = new MysqlPostRepository($container['db_connection_locator']); |
|
| 48 | - $recentPosts = $postRepository->getActivePosts(3); |
|
| 46 | + global $container; |
|
| 47 | + $postRepository = new MysqlPostRepository($container['db_connection_locator']); |
|
| 48 | + $recentPosts = $postRepository->getActivePosts(3); |
|
| 49 | 49 | |
| 50 | 50 | $recent_post_array = array(); |
| 51 | 51 | foreach($recentPosts as $postResult) |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | $recentPosts = $postRepository->getActivePosts(3); |
| 49 | 49 | |
| 50 | 50 | $recent_post_array = array(); |
| 51 | - foreach($recentPosts as $postResult) |
|
| 51 | + foreach ($recentPosts as $postResult) |
|
| 52 | 52 | { |
| 53 | 53 | $post = new stdclass(); |
| 54 | 54 | $post->title = $postResult['title']; |