@@ -4,8 +4,8 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | use Aura\Sql\ConnectionLocator; |
| 6 | 6 | |
| 7 | -class MysqlActivityRepository implements ActivityRepositoryInterface |
|
| 8 | -{ |
|
| 7 | +class MysqlActivityRepository implements ActivityRepositoryInterface |
|
| 8 | +{
|
|
| 9 | 9 | |
| 10 | 10 | /** @var ConnectionLocator */ |
| 11 | 11 | protected $connections; |
@@ -13,8 +13,8 @@ discard block |
||
| 13 | 13 | /** |
| 14 | 14 | * @param ConnectonLocator $connections |
| 15 | 15 | */ |
| 16 | - public function __construct(ConnectionLocator $connections) |
|
| 17 | - { |
|
| 16 | + public function __construct(ConnectionLocator $connections) |
|
| 17 | + {
|
|
| 18 | 18 | $this->connections = $connections; |
| 19 | 19 | } |
| 20 | 20 | |
@@ -23,8 +23,8 @@ discard block |
||
| 23 | 23 | * |
| 24 | 24 | * @return array|false |
| 25 | 25 | */ |
| 26 | - public function getActivityById($id) |
|
| 27 | - { |
|
| 26 | + public function getActivityById($id) |
|
| 27 | + {
|
|
| 28 | 28 | $query = " |
| 29 | 29 | SELECT * |
| 30 | 30 | FROM `jpemeric_stream`.`activity` |
@@ -46,8 +46,8 @@ discard block |
||
| 46 | 46 | * |
| 47 | 47 | * @return array|false |
| 48 | 48 | */ |
| 49 | - public function getActivities($limit = null, $offset = 0) |
|
| 50 | - { |
|
| 49 | + public function getActivities($limit = null, $offset = 0) |
|
| 50 | + {
|
|
| 51 | 51 | $query = " |
| 52 | 52 | SELECT * |
| 53 | 53 | FROM `jpemeric_stream`.`activity` |
@@ -63,8 +63,8 @@ discard block |
||
| 63 | 63 | ->fetchAll($query); |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - public function getActivitiesCount() |
|
| 67 | - { |
|
| 66 | + public function getActivitiesCount() |
|
| 67 | + {
|
|
| 68 | 68 | $query = " |
| 69 | 69 | SELECT COUNT(1) AS `count` |
| 70 | 70 | FROM `jpemeric_stream`.`activity`"; |
@@ -75,8 +75,8 @@ discard block |
||
| 75 | 75 | ->fetchValue($query); |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - public function getActivitiesByType($type, $limit = null, $offset = 0) |
|
| 79 | - { |
|
| 78 | + public function getActivitiesByType($type, $limit = null, $offset = 0) |
|
| 79 | + {
|
|
| 80 | 80 | $query = " |
| 81 | 81 | SELECT * |
| 82 | 82 | FROM `jpemeric_stream`.`activity` |
@@ -96,8 +96,8 @@ discard block |
||
| 96 | 96 | ->fetchAll($query, $bindings); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - public function getActivitiesByTypeCount($type) |
|
| 100 | - { |
|
| 99 | + public function getActivitiesByTypeCount($type) |
|
| 100 | + {
|
|
| 101 | 101 | $query = " |
| 102 | 102 | SELECT COUNT(1) AS `count` |
| 103 | 103 | FROM `jpemeric_stream`.`activity` |
@@ -4,8 +4,8 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | use Aura\Sql\ConnectionLocator; |
| 6 | 6 | |
| 7 | -class MysqlWatercourseRepository implements WatercourseRepositoryInterface |
|
| 8 | -{ |
|
| 7 | +class MysqlWatercourseRepository implements WatercourseRepositoryInterface |
|
| 8 | +{
|
|
| 9 | 9 | |
| 10 | 10 | /** @var Aura\Sql\ConnectionLocator */ |
| 11 | 11 | protected $connections; |
@@ -13,14 +13,14 @@ discard block |
||
| 13 | 13 | /** |
| 14 | 14 | * @param Aura\Sql\ConnectionLocator $connections |
| 15 | 15 | */ |
| 16 | - public function __construct(ConnectionLocator $connections) |
|
| 17 | - { |
|
| 16 | + public function __construct(ConnectionLocator $connections) |
|
| 17 | + {
|
|
| 18 | 18 | $this->connections = $connections; |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | // todo wot are you even serious |
| 22 | - public function getWatercourseList() |
|
| 23 | - { |
|
| 22 | + public function getWatercourseList() |
|
| 23 | + {
|
|
| 24 | 24 | $query = " |
| 25 | 25 | SELECT `sum_table`.`name`, `sum_table`.`alias`, SUM(`count`) AS `count` |
| 26 | 26 | FROM (( |
@@ -4,8 +4,8 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | use Aura\Sql\ConnectionLocator; |
| 6 | 6 | |
| 7 | -class MysqlCountyRepository implements CountyRepositoryInterface |
|
| 8 | -{ |
|
| 7 | +class MysqlCountyRepository implements CountyRepositoryInterface |
|
| 8 | +{
|
|
| 9 | 9 | |
| 10 | 10 | /** @var Aura\Sql\ConnectionLocator */ |
| 11 | 11 | protected $connections; |
@@ -13,13 +13,13 @@ discard block |
||
| 13 | 13 | /** |
| 14 | 14 | * @param Aura\Sql\ConnectionLocator $connections |
| 15 | 15 | */ |
| 16 | - public function __construct(ConnectionLocator $connections) |
|
| 17 | - { |
|
| 16 | + public function __construct(ConnectionLocator $connections) |
|
| 17 | + {
|
|
| 18 | 18 | $this->connections = $connections; |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | - public function getCountyList() |
|
| 22 | - { |
|
| 21 | + public function getCountyList() |
|
| 22 | + {
|
|
| 23 | 23 | $query = " |
| 24 | 24 | SELECT `county`.`name`, `county`.`alias`, COUNT(1) AS `count` |
| 25 | 25 | FROM `jpemeric_waterfall`.`county` |
@@ -4,8 +4,8 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | use Aura\Sql\ConnectionLocator; |
| 6 | 6 | |
| 7 | -class MysqlPeriodRepository implements PeriodRepositoryInterface |
|
| 8 | -{ |
|
| 7 | +class MysqlPeriodRepository implements PeriodRepositoryInterface |
|
| 8 | +{
|
|
| 9 | 9 | |
| 10 | 10 | /** @var Aura\Sql\ConnectionLocator */ |
| 11 | 11 | protected $connections; |
@@ -13,13 +13,13 @@ discard block |
||
| 13 | 13 | /** |
| 14 | 14 | * @param Aura\Sql\ConnectionLocator $connections |
| 15 | 15 | */ |
| 16 | - public function __construct(ConnectionLocator $connections) |
|
| 17 | - { |
|
| 16 | + public function __construct(ConnectionLocator $connections) |
|
| 17 | + {
|
|
| 18 | 18 | $this->connections = $connections; |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | - public function getPeriodList() |
|
| 22 | - { |
|
| 21 | + public function getPeriodList() |
|
| 22 | + {
|
|
| 23 | 23 | $query = " |
| 24 | 24 | SELECT `period`.`name`, `period`.`alias`, COUNT(1) AS `count` |
| 25 | 25 | FROM `jpemeric_waterfall`.`period` |
@@ -4,8 +4,8 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | use Aura\Sql\ConnectionLocator; |
| 6 | 6 | |
| 7 | -class MysqlCompanionRepository implements CompanionRepositoryInterface |
|
| 8 | -{ |
|
| 7 | +class MysqlCompanionRepository implements CompanionRepositoryInterface |
|
| 8 | +{
|
|
| 9 | 9 | |
| 10 | 10 | /** @var Aura\Sql\ConnectionLocator */ |
| 11 | 11 | protected $connections; |
@@ -13,13 +13,13 @@ discard block |
||
| 13 | 13 | /** |
| 14 | 14 | * @param Aura\Sql\ConnectionLocator $connections |
| 15 | 15 | */ |
| 16 | - public function __construct(ConnectionLocator $connections) |
|
| 17 | - { |
|
| 16 | + public function __construct(ConnectionLocator $connections) |
|
| 17 | + {
|
|
| 18 | 18 | $this->connections = $connections; |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | - public function getCompanionList() |
|
| 22 | - { |
|
| 21 | + public function getCompanionList() |
|
| 22 | + {
|
|
| 23 | 23 | $query = " |
| 24 | 24 | SELECT `companion`.`name`, `companion`.`alias`, COUNT(1) AS `count` |
| 25 | 25 | FROM `jpemeric_waterfall`.`companion` |
@@ -4,8 +4,8 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | use Aura\Sql\ConnectionLocator; |
| 6 | 6 | |
| 7 | -class MysqlWaterfallRepository implements WaterfallRepositoryInterface |
|
| 8 | -{ |
|
| 7 | +class MysqlWaterfallRepository implements WaterfallRepositoryInterface |
|
| 8 | +{
|
|
| 9 | 9 | |
| 10 | 10 | /** @var Aura\Sql\ConnectionLocator */ |
| 11 | 11 | protected $connections; |
@@ -13,13 +13,13 @@ discard block |
||
| 13 | 13 | /** |
| 14 | 14 | * @param Aura\Sql\ConnectionLocator $connections |
| 15 | 15 | */ |
| 16 | - public function __construct(ConnectionLocator $connections) |
|
| 17 | - { |
|
| 16 | + public function __construct(ConnectionLocator $connections) |
|
| 17 | + {
|
|
| 18 | 18 | $this->connections = $connections; |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | - public function getWaterfalls($limit = null, $offset = 0) |
|
| 22 | - { |
|
| 21 | + public function getWaterfalls($limit = null, $offset = 0) |
|
| 22 | + {
|
|
| 23 | 23 | $query = " |
| 24 | 24 | SELECT `waterfall`.`id`, `waterfall`.`name`, `waterfall`.`alias`, |
| 25 | 25 | `watercourse`.`name` AS `watercourse`, `watercourse`.`alias` AS `watercourse_alias` |
@@ -4,8 +4,8 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | use Aura\Sql\ConnectionLocator; |
| 6 | 6 | |
| 7 | -class MysqlLogRepository implements LogRepositoryInterface |
|
| 8 | -{ |
|
| 7 | +class MysqlLogRepository implements LogRepositoryInterface |
|
| 8 | +{
|
|
| 9 | 9 | |
| 10 | 10 | /** @var Aura\Sql\ConnectionLocator */ |
| 11 | 11 | protected $connections; |
@@ -13,13 +13,13 @@ discard block |
||
| 13 | 13 | /** |
| 14 | 14 | * @param Aura\Sql\ConnectionLocator $connections |
| 15 | 15 | */ |
| 16 | - public function __construct(ConnectionLocator $connections) |
|
| 17 | - { |
|
| 16 | + public function __construct(ConnectionLocator $connections) |
|
| 17 | + {
|
|
| 18 | 18 | $this->connections = $connections; |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | - public function getActiveLogs($limit = null, $offset = 0) |
|
| 22 | - { |
|
| 21 | + public function getActiveLogs($limit = null, $offset = 0) |
|
| 22 | + {
|
|
| 23 | 23 | $query = " |
| 24 | 24 | SELECT `id`, `title`, `alias`, `date`, `publish_date`, `introduction` |
| 25 | 25 | FROM `jpemeric_waterfall`.`log` |
@@ -2,31 +2,31 @@ |
||
| 2 | 2 | |
| 3 | 3 | Loader::loadInstance('utility', 'Database'); |
| 4 | 4 | |
| 5 | -abstract class Collector |
|
| 6 | -{ |
|
| 5 | +abstract class Collector |
|
| 6 | +{
|
|
| 7 | 7 | |
| 8 | - protected static function run_query($query) |
|
| 9 | - { |
|
| 8 | + protected static function run_query($query) |
|
| 9 | + {
|
|
| 10 | 10 | return Database::select($query); |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | - protected static function run_row_query($query) |
|
| 14 | - { |
|
| 13 | + protected static function run_row_query($query) |
|
| 14 | + {
|
|
| 15 | 15 | return Database::selectRow($query); |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | - protected static function get_count($query) |
|
| 19 | - { |
|
| 18 | + protected static function get_count($query) |
|
| 19 | + {
|
|
| 20 | 20 | return Database::selectRow($query)->count; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - protected static function check_exists($query) |
|
| 24 | - { |
|
| 23 | + protected static function check_exists($query) |
|
| 24 | + {
|
|
| 25 | 25 | return Database::selectRow($query) !== null; |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - protected static function escape($string) |
|
| 29 | - { |
|
| 28 | + protected static function escape($string) |
|
| 29 | + {
|
|
| 30 | 30 | return Database::escape($string); |
| 31 | 31 | } |
| 32 | 32 | |
@@ -2,11 +2,11 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | Loader::load('collector', 'Collector'); |
| 4 | 4 | |
| 5 | -final class PhotoCollector extends Collector |
|
| 6 | -{ |
|
| 5 | +final class PhotoCollector extends Collector |
|
| 6 | +{
|
|
| 7 | 7 | |
| 8 | - public static function fetchRow($category, $photo) |
|
| 9 | - { |
|
| 8 | + public static function fetchRow($category, $photo) |
|
| 9 | + {
|
|
| 10 | 10 | $query = " |
| 11 | 11 | SELECT |
| 12 | 12 | `photo`.`name`, |
@@ -27,8 +27,8 @@ discard block |
||
| 27 | 27 | return self::run_row_query($query); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - public static function getRow($id) |
|
| 31 | - { |
|
| 30 | + public static function getRow($id) |
|
| 31 | + {
|
|
| 32 | 32 | $query = " |
| 33 | 33 | SELECT |
| 34 | 34 | `photo`.`name`, |