@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | |
61 | 61 | protected function get_recent_activity() |
62 | 62 | { |
63 | - global $container; |
|
64 | - $activityRepository = new Jacobemerick\Web\Domain\Stream\Post\MysqlPostRepository($container['db_connection_locator']); |
|
65 | - $post_result = $activityRepository->getPosts(5); |
|
63 | + global $container; |
|
64 | + $activityRepository = new Jacobemerick\Web\Domain\Stream\Post\MysqlPostRepository($container['db_connection_locator']); |
|
65 | + $post_result = $activityRepository->getPosts(5); |
|
66 | 66 | |
67 | 67 | $post_array = array(); |
68 | 68 | foreach($post_result as $row) |
@@ -77,13 +77,13 @@ discard block |
||
77 | 77 | { |
78 | 78 | Loader::load('utility', 'Content'); |
79 | 79 | |
80 | - global $container; |
|
81 | - $blogRepository = new Jacobemerick\Web\Domain\Stream\Blog\MysqlBlogRepository($container['db_connection_locator']); |
|
82 | - $bookRepository = new Jacobemerick\Web\Domain\Stream\Book\MysqlBookRepository($container['db_connection_locator']); |
|
83 | - $distanceRepository = new Jacobemerick\Web\Domain\Stream\Distance\MysqlDistanceRepository($container['db_connection_locator']); |
|
84 | - $huluRepository = new Jacobemerick\Web\Domain\Stream\Hulu\MysqlHuluRepository($container['db_connection_locator']); |
|
85 | - $twitterRepository = new Jacobemerick\Web\Domain\Stream\Twitter\MysqlTwitterRepository($container['db_connection_locator']); |
|
86 | - $youtubeRepository = new Jacobemerick\Web\Domain\Stream\YouTube\MysqlYouTubeRepository($container['db_connection_locator']); |
|
80 | + global $container; |
|
81 | + $blogRepository = new Jacobemerick\Web\Domain\Stream\Blog\MysqlBlogRepository($container['db_connection_locator']); |
|
82 | + $bookRepository = new Jacobemerick\Web\Domain\Stream\Book\MysqlBookRepository($container['db_connection_locator']); |
|
83 | + $distanceRepository = new Jacobemerick\Web\Domain\Stream\Distance\MysqlDistanceRepository($container['db_connection_locator']); |
|
84 | + $huluRepository = new Jacobemerick\Web\Domain\Stream\Hulu\MysqlHuluRepository($container['db_connection_locator']); |
|
85 | + $twitterRepository = new Jacobemerick\Web\Domain\Stream\Twitter\MysqlTwitterRepository($container['db_connection_locator']); |
|
86 | + $youtubeRepository = new Jacobemerick\Web\Domain\Stream\YouTube\MysqlYouTubeRepository($container['db_connection_locator']); |
|
87 | 87 | |
88 | 88 | $post = new stdclass(); |
89 | 89 | |
@@ -126,9 +126,9 @@ discard block |
||
126 | 126 | if(strlen($row['title']) > 0) |
127 | 127 | $post->title .= " I was hiking up around the {$row['title']} area."; |
128 | 128 | } |
129 | - else if ($row['type'] == 'walking') { |
|
130 | - $post->title = "Walked {$row['distance']} miles and felt {$row['felt']}."; |
|
131 | - } |
|
129 | + else if ($row['type'] == 'walking') { |
|
130 | + $post->title = "Walked {$row['distance']} miles and felt {$row['felt']}."; |
|
131 | + } |
|
132 | 132 | break; |
133 | 133 | case 'hulu' : |
134 | 134 | $row = $huluRepository->getHuluById($raw_post['type_id']); |
@@ -195,11 +195,11 @@ discard block |
||
195 | 195 | Loader::load('view', URLDecode::getSite() . '/' . $view, $this->data_array['body']); |
196 | 196 | } |
197 | 197 | |
198 | - if (URLDecode::getSite() == 'waterfalls') { |
|
199 | - Loader::load('view', '/WaterfallFoot'); |
|
200 | - } else { |
|
201 | - Loader::load('view', '/Foot', array('tracking_code' => self::$TRACKING_CODE)); |
|
202 | - } |
|
198 | + if (URLDecode::getSite() == 'waterfalls') { |
|
199 | + Loader::load('view', '/WaterfallFoot'); |
|
200 | + } else { |
|
201 | + Loader::load('view', '/Foot', array('tracking_code' => self::$TRACKING_CODE)); |
|
202 | + } |
|
203 | 203 | |
204 | 204 | if($view == '/404' || $view == '/503') |
205 | 205 | exit; |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | 'date' => date('Y'))); |
41 | 41 | |
42 | 42 | Loader::loadInstance('utility', 'Database'); |
43 | - if(Database::isConnected() === false) |
|
43 | + if (Database::isConnected() === false) |
|
44 | 44 | $this->unavailable(); |
45 | 45 | } |
46 | 46 | |
@@ -65,9 +65,9 @@ discard block |
||
65 | 65 | $post_result = $activityRepository->getPosts(5); |
66 | 66 | |
67 | 67 | $post_array = array(); |
68 | - foreach($post_result as $row) |
|
68 | + foreach ($post_result as $row) |
|
69 | 69 | { |
70 | - $post_array[] = $this->expand_post($row);; |
|
70 | + $post_array[] = $this->expand_post($row); ; |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | return $post_array; |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | $post = new stdclass(); |
89 | 89 | |
90 | - switch($raw_post['type']) |
|
90 | + switch ($raw_post['type']) |
|
91 | 91 | { |
92 | 92 | case 'blog' : |
93 | 93 | $row = $blogRepository->getBlogById($raw_post['type_id']); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $post->title = "Blogged about {$category}: <a href=\"{$row['url']}\">{$row['title']}</a>."; |
99 | 99 | $post->comments = $row['comments']; |
100 | 100 | |
101 | - if($format == 'full') |
|
101 | + if ($format == 'full') |
|
102 | 102 | $post->image = Content::instance('FetchFirstPhoto', $row['body'])->activate(false, 'standard'); |
103 | 103 | break; |
104 | 104 | case 'book' : |
@@ -107,23 +107,23 @@ discard block |
||
107 | 107 | $post->type = 'book'; |
108 | 108 | $post->title = "Just finished reading {$row['title']} by {$row['author']}."; |
109 | 109 | |
110 | - if($format == 'full') |
|
110 | + if ($format == 'full') |
|
111 | 111 | $post->image = "<img alt=\"{$row['title']} by {$row['author']}\" src=\"{$row['image']}\" />"; |
112 | 112 | break; |
113 | 113 | case 'distance' : |
114 | 114 | $row = $distanceRepository->getDistanceById($raw_post['type_id']); |
115 | 115 | |
116 | 116 | $post->type = 'distance'; |
117 | - if($row['type'] == 'running') |
|
117 | + if ($row['type'] == 'running') |
|
118 | 118 | { |
119 | 119 | $post->title = "Ran {$row['distance']} miles and felt {$row['felt']}."; |
120 | - if(strlen($row['message']) > 0) |
|
120 | + if (strlen($row['message']) > 0) |
|
121 | 121 | $post->title .= " Afterwards, I was all like '{$row['message']}'."; |
122 | 122 | } |
123 | - else if($row['type'] == 'hiking') |
|
123 | + else if ($row['type'] == 'hiking') |
|
124 | 124 | { |
125 | 125 | $post->title = "Hiked {$row['distance']} miles and felt {$row['felt']}."; |
126 | - if(strlen($row['title']) > 0) |
|
126 | + if (strlen($row['title']) > 0) |
|
127 | 127 | $post->title .= " I was hiking up around the {$row['title']} area."; |
128 | 128 | } |
129 | 129 | else if ($row['type'] == 'walking') { |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | |
142 | 142 | $post->type = 'twitter'; |
143 | 143 | |
144 | - if($format == 'full') |
|
144 | + if ($format == 'full') |
|
145 | 145 | $post->title = $row['text_formatted_full']; |
146 | 146 | else |
147 | 147 | $post->title = $row['text_formatted']; |
@@ -154,12 +154,12 @@ discard block |
||
154 | 154 | |
155 | 155 | $post->type = 'youtube'; |
156 | 156 | |
157 | - if($format == 'full') |
|
157 | + if ($format == 'full') |
|
158 | 158 | $post->title = "Favorited {$row['title']} by {$row['author']} on YouTube."; |
159 | 159 | else |
160 | 160 | $post->title = "Favorited <a href=\"http://www.youtube.com/watch?feature=player_embedded&v={$row['video_id']}\" rel=\"nofollow\" target=\"_blank\" title=\"{$row['content']}\">{$row['title']}</a> by {$row['author']} on YouTube."; |
161 | 161 | |
162 | - if($format == 'full') |
|
162 | + if ($format == 'full') |
|
163 | 163 | $post->embed_code = "<iframe src=\"http://www.youtube.com/embed/{$row['video_id']}?rel=0\" frameborder=\"0\" allowfullscreen></iframe>"; |
164 | 164 | break; |
165 | 165 | } |
@@ -187,9 +187,9 @@ discard block |
||
187 | 187 | $headers = $this->headers; |
188 | 188 | Header::$headers(); |
189 | 189 | Loader::load('view', '/Head', $this->data_array['head']); |
190 | - foreach($this->body_view_array as $view) |
|
190 | + foreach ($this->body_view_array as $view) |
|
191 | 191 | { |
192 | - if(substr($view, 0, 1) == '/') |
|
192 | + if (substr($view, 0, 1) == '/') |
|
193 | 193 | Loader::load('view', $view, $this->data_array['body']); |
194 | 194 | else |
195 | 195 | Loader::load('view', URLDecode::getSite() . '/' . $view, $this->data_array['body']); |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | Loader::load('view', '/Foot', array('tracking_code' => self::$TRACKING_CODE)); |
202 | 202 | } |
203 | 203 | |
204 | - if($view == '/404' || $view == '/503') |
|
204 | + if ($view == '/404' || $view == '/503') |
|
205 | 205 | exit; |
206 | 206 | } |
207 | 207 | |
@@ -262,10 +262,10 @@ discard block |
||
262 | 262 | |
263 | 263 | $js_array = array(); |
264 | 264 | |
265 | - if(count($this->js_array) > 0) |
|
265 | + if (count($this->js_array) > 0) |
|
266 | 266 | $js_array = array_merge($js_array, $this->js_array); |
267 | 267 | |
268 | - if(count($js_array) > 0) |
|
268 | + if (count($js_array) > 0) |
|
269 | 269 | $js_array = Asset::getJS($js_array); |
270 | 270 | |
271 | 271 | $this->set_head('css_link_array', $css_array); |
@@ -279,26 +279,26 @@ discard block |
||
279 | 279 | |
280 | 280 | protected function eject() |
281 | 281 | { |
282 | - if(get_class($this) !== 'Error404Controller') |
|
282 | + if (get_class($this) !== 'Error404Controller') |
|
283 | 283 | Loader::loadNew('controller', '/Error404Controller')->activate(); |
284 | 284 | } |
285 | 285 | |
286 | 286 | protected function unavailable() |
287 | 287 | { |
288 | - if(get_class($this) !== 'Error503Controller') |
|
288 | + if (get_class($this) !== 'Error503Controller') |
|
289 | 289 | Loader::loadNew('controller', '/Error503Controller')->activate(); |
290 | 290 | } |
291 | 291 | |
292 | 292 | protected function redirect($uri, $method = 301) |
293 | 293 | { |
294 | - switch($method) |
|
294 | + switch ($method) |
|
295 | 295 | { |
296 | 296 | case 301 : |
297 | - if(get_class($this) !== 'Error301Controller') |
|
297 | + if (get_class($this) !== 'Error301Controller') |
|
298 | 298 | Loader::loadNew('controller', '/Error301Controller', array($uri))->activate(); |
299 | 299 | break; |
300 | 300 | case 303 : |
301 | - if(get_class($this) !== 'Error303Controller') |
|
301 | + if (get_class($this) !== 'Error303Controller') |
|
302 | 302 | Loader::loadNew('controller', '/Error303Controller', array($uri))->activate(); |
303 | 303 | break; |
304 | 304 | } |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | private $comment_errors; |
319 | 319 | protected function handle_comment_submit($site_id, $path, $redirect_url, $page_title) |
320 | 320 | { |
321 | - if(Request::hasPost() && Request::getPost('submit') == 'Submit Comment') |
|
321 | + if (Request::hasPost() && Request::getPost('submit') == 'Submit Comment') |
|
322 | 322 | { |
323 | 323 | $parameters = array($site_id, $path, $redirect_url, $page_title); |
324 | 324 | $this->comment_errors = Loader::loadNew('module', 'form/CommentSubmitModule', $parameters)->activate(); |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | $comment_array = array(); |
337 | 337 | $comment_result = CommentCollector::getCommentsForURL($site, $path, $commenter->id); |
338 | 338 | |
339 | - foreach($comment_result as $comment) |
|
339 | + foreach ($comment_result as $comment) |
|
340 | 340 | { |
341 | 341 | $comment_object = new stdclass(); |
342 | 342 | $comment_object->id = $comment->id; |
@@ -346,12 +346,12 @@ discard block |
||
346 | 346 | $comment_object->url = $comment->url; |
347 | 347 | $comment_object->trusted = $comment->trusted; |
348 | 348 | |
349 | - if($comment->reply == 0 && Request::getPost('type') == $comment->id) |
|
349 | + if ($comment->reply == 0 && Request::getPost('type') == $comment->id) |
|
350 | 350 | $comment_object->errors = $this->comment_errors; |
351 | 351 | else |
352 | 352 | $comment_object->errors = array(); |
353 | 353 | |
354 | - if($comment->reply == 0) |
|
354 | + if ($comment->reply == 0) |
|
355 | 355 | { |
356 | 356 | $comment_object->replies = array(); |
357 | 357 | $comment_array[$comment->id] = $comment_object; |
@@ -382,21 +382,21 @@ discard block |
||
382 | 382 | $commenter->website = ''; |
383 | 383 | |
384 | 384 | $commenter_cookie = Cookie::instance('Commenter'); |
385 | - if(!$commenter_cookie->exists()) |
|
385 | + if (!$commenter_cookie->exists()) |
|
386 | 386 | return $commenter; |
387 | 387 | |
388 | 388 | $commenter_cookie_value = $commenter_cookie->getValue(); |
389 | 389 | $commenter_cookie_value = json_decode($commenter_cookie_value); |
390 | 390 | |
391 | - if($commenter_cookie_value === NULL) |
|
391 | + if ($commenter_cookie_value === NULL) |
|
392 | 392 | return $commenter; |
393 | 393 | |
394 | - if(!isset($commenter_cookie_value->name) || !isset($commenter_cookie_value->email)) |
|
394 | + if (!isset($commenter_cookie_value->name) || !isset($commenter_cookie_value->email)) |
|
395 | 395 | return $commenter; |
396 | 396 | |
397 | 397 | $commenter_object = CommentCollector::getCommenterByFields($commenter_cookie_value->name, $commenter_cookie_value->email, (isset($commenter_cookie_value->website) ? $commenter_cookie_value->website : '')); |
398 | 398 | |
399 | - if($commenter_object === NULL) |
|
399 | + if ($commenter_object === NULL) |
|
400 | 400 | return $commenter; |
401 | 401 | |
402 | 402 | $commenter->id = $commenter_object->id; |
@@ -10,10 +10,10 @@ |
||
10 | 10 | |
11 | 11 | public function __construct() |
12 | 12 | { |
13 | - parent::__construct(); |
|
13 | + parent::__construct(); |
|
14 | 14 | |
15 | - global $container; |
|
16 | - $this->postRepository = new Jacobemerick\Web\Domain\Stream\Post\MysqlPostRepository($container['db_connection_locator']); |
|
15 | + global $container; |
|
16 | + $this->postRepository = new Jacobemerick\Web\Domain\Stream\Post\MysqlPostRepository($container['db_connection_locator']); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | protected function set_head_data() |
@@ -45,7 +45,7 @@ |
||
45 | 45 | |
46 | 46 | protected function get_list_results() |
47 | 47 | { |
48 | - return $this->postRepository->getPosts(self::$POSTS_PER_PAGE, $this->offset); |
|
48 | + return $this->postRepository->getPosts(self::$POSTS_PER_PAGE, $this->offset); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | protected function get_list_description() |
@@ -20,14 +20,14 @@ discard block |
||
20 | 20 | parent::__construct(); |
21 | 21 | |
22 | 22 | $id = URLDecode::getPiece(2); |
23 | - if(!$id || !is_numeric($id)) |
|
23 | + if (!$id || !is_numeric($id)) |
|
24 | 24 | $this->eject(); |
25 | 25 | |
26 | 26 | $post = $this->postRepository->getPostById($id); |
27 | - if(!$post) |
|
27 | + if (!$post) |
|
28 | 28 | $this->eject(); |
29 | 29 | |
30 | - if(URLDecode::getPiece(1) != $post['type']) |
|
30 | + if (URLDecode::getPiece(1) != $post['type']) |
|
31 | 31 | $this->eject(); |
32 | 32 | |
33 | 33 | $this->post = $post; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | private function get_title() |
61 | 61 | { |
62 | - switch($this->post['type']) |
|
62 | + switch ($this->post['type']) |
|
63 | 63 | { |
64 | 64 | case 'blog' : |
65 | 65 | return 'Jacob blogged'; |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | private function get_description() |
86 | 86 | { |
87 | - switch($this->post['type']) |
|
87 | + switch ($this->post['type']) |
|
88 | 88 | { |
89 | 89 | case 'blog' : |
90 | 90 | return 'Another awesome blog post from Jacob. Did I mention it was awesome?'; |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | interface BlogRepositoryInterface |
6 | 6 | { |
7 | - public function getBlogById($id); |
|
8 | - public function getBlogByTitle($title); |
|
9 | - public function getUnmappedBlogs(); |
|
7 | + public function getBlogById($id); |
|
8 | + public function getBlogByTitle($title); |
|
9 | + public function getUnmappedBlogs(); |
|
10 | 10 | } |
@@ -7,75 +7,75 @@ |
||
7 | 7 | class MysqlBlogRepository implements BlogRepositoryInterface |
8 | 8 | { |
9 | 9 | |
10 | - /** @var ConnectionLocator */ |
|
11 | - protected $connections; |
|
10 | + /** @var ConnectionLocator */ |
|
11 | + protected $connections; |
|
12 | 12 | |
13 | - /** |
|
14 | - * @param ConnectonLocator $connections |
|
15 | - */ |
|
16 | - public function __construct(ConnectionLocator $connections) |
|
17 | - { |
|
18 | - $this->connections = $connections; |
|
19 | - } |
|
13 | + /** |
|
14 | + * @param ConnectonLocator $connections |
|
15 | + */ |
|
16 | + public function __construct(ConnectionLocator $connections) |
|
17 | + { |
|
18 | + $this->connections = $connections; |
|
19 | + } |
|
20 | 20 | |
21 | - /** |
|
22 | - * @param integer $id |
|
23 | - * |
|
24 | - * @return array|false |
|
25 | - */ |
|
26 | - public function getBlogById($id) |
|
27 | - { |
|
28 | - $query = " |
|
21 | + /** |
|
22 | + * @param integer $id |
|
23 | + * |
|
24 | + * @return array|false |
|
25 | + */ |
|
26 | + public function getBlogById($id) |
|
27 | + { |
|
28 | + $query = " |
|
29 | 29 | SELECT * |
30 | 30 | FROM `jpemeric_stream`.`blog` |
31 | 31 | WHERE `id` = :id |
32 | 32 | LIMIT 1"; |
33 | - $bindings = [ |
|
34 | - 'id' => $id, |
|
35 | - ]; |
|
33 | + $bindings = [ |
|
34 | + 'id' => $id, |
|
35 | + ]; |
|
36 | 36 | |
37 | - return $this |
|
38 | - ->connections |
|
39 | - ->getRead() |
|
40 | - ->fetchOne($query, $bindings); |
|
41 | - } |
|
37 | + return $this |
|
38 | + ->connections |
|
39 | + ->getRead() |
|
40 | + ->fetchOne($query, $bindings); |
|
41 | + } |
|
42 | 42 | |
43 | - /** |
|
44 | - * @param string $title |
|
45 | - * |
|
46 | - * @return array|false |
|
47 | - */ |
|
48 | - public function getBlogByTitle($title) |
|
49 | - { |
|
50 | - $query = " |
|
43 | + /** |
|
44 | + * @param string $title |
|
45 | + * |
|
46 | + * @return array|false |
|
47 | + */ |
|
48 | + public function getBlogByTitle($title) |
|
49 | + { |
|
50 | + $query = " |
|
51 | 51 | SELECT * |
52 | 52 | FROM `jpemeric_stream`.`blog` |
53 | 53 | WHERE `title` = :title |
54 | 54 | LIMIT 1"; |
55 | - $bindings = [ |
|
56 | - 'title' => $title, |
|
57 | - ]; |
|
55 | + $bindings = [ |
|
56 | + 'title' => $title, |
|
57 | + ]; |
|
58 | 58 | |
59 | - return $this |
|
60 | - ->connections |
|
61 | - ->getRead() |
|
62 | - ->fetchOne($query, $bindings); |
|
63 | - } |
|
59 | + return $this |
|
60 | + ->connections |
|
61 | + ->getRead() |
|
62 | + ->fetchOne($query, $bindings); |
|
63 | + } |
|
64 | 64 | |
65 | - /** |
|
66 | - * @return array|false |
|
67 | - */ |
|
68 | - public function getUnmappedBlogs() |
|
69 | - { |
|
70 | - $query = " |
|
65 | + /** |
|
66 | + * @return array|false |
|
67 | + */ |
|
68 | + public function getUnmappedBlogs() |
|
69 | + { |
|
70 | + $query = " |
|
71 | 71 | SELECT `id`, `date` |
72 | 72 | FROM `jpemeric_stream`.`blog` |
73 | 73 | LEFT JOIN `jpemeric_stream`.`post` |
74 | 74 | ON `post`.`type_id` = `blog`.`id` AND `post`.`id` IS NULL"; |
75 | 75 | |
76 | - return $this |
|
77 | - ->connections |
|
78 | - ->getRead() |
|
79 | - ->fetchAll($query); |
|
80 | - } |
|
76 | + return $this |
|
77 | + ->connections |
|
78 | + ->getRead() |
|
79 | + ->fetchAll($query); |
|
80 | + } |
|
81 | 81 | } |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | interface BookRepositoryInterface |
6 | 6 | { |
7 | - public function getBookById($id); |
|
8 | - public function getBookByFields($title, $author); |
|
9 | - public function getUnmappedBooks(); |
|
7 | + public function getBookById($id); |
|
8 | + public function getBookByFields($title, $author); |
|
9 | + public function getUnmappedBooks(); |
|
10 | 10 | } |
@@ -7,77 +7,77 @@ |
||
7 | 7 | class MysqlBookRepository implements BookRepositoryInterface |
8 | 8 | { |
9 | 9 | |
10 | - /** @var ConnectionLocator */ |
|
11 | - protected $connections; |
|
10 | + /** @var ConnectionLocator */ |
|
11 | + protected $connections; |
|
12 | 12 | |
13 | - /** |
|
14 | - * @param ConnectonLocator $connections |
|
15 | - */ |
|
16 | - public function __construct(ConnectionLocator $connections) |
|
17 | - { |
|
18 | - $this->connections = $connections; |
|
19 | - } |
|
13 | + /** |
|
14 | + * @param ConnectonLocator $connections |
|
15 | + */ |
|
16 | + public function __construct(ConnectionLocator $connections) |
|
17 | + { |
|
18 | + $this->connections = $connections; |
|
19 | + } |
|
20 | 20 | |
21 | - /** |
|
22 | - * @param integer $id |
|
23 | - * |
|
24 | - * @return array|false |
|
25 | - */ |
|
26 | - public function getBookById($id) |
|
27 | - { |
|
28 | - $query = " |
|
21 | + /** |
|
22 | + * @param integer $id |
|
23 | + * |
|
24 | + * @return array|false |
|
25 | + */ |
|
26 | + public function getBookById($id) |
|
27 | + { |
|
28 | + $query = " |
|
29 | 29 | SELECT `id`, `title`, `author`, `image`, `date_read` AS `date` |
30 | 30 | FROM `jpemeric_stream`.`book` |
31 | 31 | WHERE `id` = :id |
32 | 32 | LIMIT 1"; |
33 | - $bindings = [ |
|
34 | - 'id' => $id, |
|
35 | - ]; |
|
33 | + $bindings = [ |
|
34 | + 'id' => $id, |
|
35 | + ]; |
|
36 | 36 | |
37 | - return $this |
|
38 | - ->connections |
|
39 | - ->getRead() |
|
40 | - ->fetchOne($query, $bindings); |
|
41 | - } |
|
37 | + return $this |
|
38 | + ->connections |
|
39 | + ->getRead() |
|
40 | + ->fetchOne($query, $bindings); |
|
41 | + } |
|
42 | 42 | |
43 | - /** |
|
44 | - * @param string $title |
|
45 | - * @param string $author |
|
46 | - * |
|
47 | - * @return array|false |
|
48 | - */ |
|
49 | - public function getBookByFields($title, $author) |
|
50 | - { |
|
51 | - $query = " |
|
43 | + /** |
|
44 | + * @param string $title |
|
45 | + * @param string $author |
|
46 | + * |
|
47 | + * @return array|false |
|
48 | + */ |
|
49 | + public function getBookByFields($title, $author) |
|
50 | + { |
|
51 | + $query = " |
|
52 | 52 | SELECT * |
53 | 53 | FROM `jpemeric_stream`.`book` |
54 | 54 | WHERE `title` = :title AND `author` = :author |
55 | 55 | LIMIT 1"; |
56 | - $bindings = [ |
|
57 | - 'title' => $title, |
|
58 | - 'author' => $author, |
|
59 | - ]; |
|
56 | + $bindings = [ |
|
57 | + 'title' => $title, |
|
58 | + 'author' => $author, |
|
59 | + ]; |
|
60 | 60 | |
61 | - return $this |
|
62 | - ->connections |
|
63 | - ->getRead() |
|
64 | - ->fetchOne($query, $bindings); |
|
65 | - } |
|
61 | + return $this |
|
62 | + ->connections |
|
63 | + ->getRead() |
|
64 | + ->fetchOne($query, $bindings); |
|
65 | + } |
|
66 | 66 | |
67 | - /** |
|
68 | - * @return array|false |
|
69 | - */ |
|
70 | - public function getUnmappedBooks() |
|
71 | - { |
|
72 | - $query = " |
|
67 | + /** |
|
68 | + * @return array|false |
|
69 | + */ |
|
70 | + public function getUnmappedBooks() |
|
71 | + { |
|
72 | + $query = " |
|
73 | 73 | SELECT `id`, `date` |
74 | 74 | FROM `jpemeric_stream`.`book` |
75 | 75 | LEFT JOIN `jpemeric_stream`.`post` |
76 | 76 | ON `post`.`type_id` = `book`.`id` AND `post`.`id` IS NULL"; |
77 | 77 | |
78 | - return $this |
|
79 | - ->connections |
|
80 | - ->getRead() |
|
81 | - ->fetchAll($query); |
|
82 | - } |
|
78 | + return $this |
|
79 | + ->connections |
|
80 | + ->getRead() |
|
81 | + ->fetchAll($query); |
|
82 | + } |
|
83 | 83 | } |
@@ -6,7 +6,7 @@ |
||
6 | 6 | |
7 | 7 | interface DistanceRepositoryInterface |
8 | 8 | { |
9 | - public function getDistanceById($id); |
|
10 | - public function getDistanceByFields(DateTimeInterface $date, $type, $mileage); |
|
11 | - public function getUnmappedDistances(); |
|
9 | + public function getDistanceById($id); |
|
10 | + public function getDistanceByFields(DateTimeInterface $date, $type, $mileage); |
|
11 | + public function getUnmappedDistances(); |
|
12 | 12 | } |