@@ -19,11 +19,11 @@ |
||
19 | 19 | { |
20 | 20 | return EventQuery::create() |
21 | 21 | ->useEventPersonQuery() |
22 | - ->useUserRoleQuery() |
|
22 | + ->useUserRoleQuery() |
|
23 | 23 | ->useRoleQuery() |
24 | - ->filterByGroup($this) |
|
24 | + ->filterByGroup($this) |
|
25 | + ->endUse() |
|
25 | 26 | ->endUse() |
26 | - ->endUse() |
|
27 | 27 | ->endUse() |
28 | 28 | ->orderByDate('desc') |
29 | 29 | ->findOne(); |
@@ -7,18 +7,18 @@ discard block |
||
7 | 7 | $serviceContainer->setAdapterClass('default', 'mysql'); |
8 | 8 | $manager = new \Propel\Runtime\Connection\ConnectionManagerSingle(); |
9 | 9 | $manager->setConfiguration([ |
10 | - 'classname' => 'Propel\\Runtime\\Connection\\ConnectionWrapper', |
|
11 | - 'dsn' => 'mysql:host='.$config['db']['host'].';dbname='.$config['db']['dbname'], |
|
12 | - 'user' => $config['db']['user'], |
|
13 | - 'password' => $config['db']['pass'], |
|
14 | - 'attributes' => [ |
|
10 | + 'classname' => 'Propel\\Runtime\\Connection\\ConnectionWrapper', |
|
11 | + 'dsn' => 'mysql:host='.$config['db']['host'].';dbname='.$config['db']['dbname'], |
|
12 | + 'user' => $config['db']['user'], |
|
13 | + 'password' => $config['db']['pass'], |
|
14 | + 'attributes' => [ |
|
15 | 15 | 'ATTR_EMULATE_PREPARES' => false, |
16 | 16 | 'ATTR_TIMEOUT' => 30, |
17 | - ], |
|
18 | - 'model_paths' => [ |
|
17 | + ], |
|
18 | + 'model_paths' => [ |
|
19 | 19 | 0 => 'src', |
20 | 20 | 1 => 'vendor', |
21 | - ], |
|
21 | + ], |
|
22 | 22 | ]); |
23 | 23 | $manager->setName('default'); |
24 | 24 | $serviceContainer->setConnectionManager('default', $manager); |
@@ -26,16 +26,16 @@ discard block |
||
26 | 26 | $serviceContainer->setAdapterClass('test', 'sqlite'); |
27 | 27 | $manager = new \Propel\Runtime\Connection\ConnectionManagerSingle(); |
28 | 28 | $manager->setConfiguration([ |
29 | - 'classname' => 'Propel\\Runtime\\Connection\\ConnectionWrapper', |
|
30 | - 'dsn' => 'sqlite:/var/tmp/test.db', |
|
31 | - 'attributes' => [ |
|
29 | + 'classname' => 'Propel\\Runtime\\Connection\\ConnectionWrapper', |
|
30 | + 'dsn' => 'sqlite:/var/tmp/test.db', |
|
31 | + 'attributes' => [ |
|
32 | 32 | 'ATTR_EMULATE_PREPARES' => false, |
33 | 33 | 'ATTR_TIMEOUT' => 30, |
34 | - ], |
|
35 | - 'model_paths' => [ |
|
34 | + ], |
|
35 | + 'model_paths' => [ |
|
36 | 36 | 0 => 'src', |
37 | 37 | 1 => 'vendor', |
38 | - ], |
|
38 | + ], |
|
39 | 39 | ]); |
40 | 40 | $manager->setName('test'); |
41 | 41 | $serviceContainer->setConnectionManager('test', $manager); |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include __DIR__.'/../config/database.php'; |
|
3 | +include __DIR__ . '/../config/database.php'; |
|
4 | 4 | $serviceContainer = \Propel\Runtime\Propel::getServiceContainer(); |
5 | 5 | $serviceContainer->checkVersion('2.0.0-dev'); |
6 | 6 | |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | $manager = new \Propel\Runtime\Connection\ConnectionManagerSingle(); |
9 | 9 | $manager->setConfiguration([ |
10 | 10 | 'classname' => 'Propel\\Runtime\\Connection\\ConnectionWrapper', |
11 | - 'dsn' => 'mysql:host='.$config['db']['host'].';dbname='.$config['db']['dbname'], |
|
11 | + 'dsn' => 'mysql:host=' . $config['db']['host'] . ';dbname=' . $config['db']['dbname'], |
|
12 | 12 | 'user' => $config['db']['user'], |
13 | 13 | 'password' => $config['db']['pass'], |
14 | 14 | 'attributes' => [ |
@@ -28,13 +28,13 @@ |
||
28 | 28 | $currentTimestamp = $date = strftime('%F %T', time()); |
29 | 29 | |
30 | 30 | $data = [ |
31 | - ['field' => 'name', 'type' => 'string', 'value' => $this->name], |
|
32 | - ['field' => 'date', 'type' => 'string', 'value' => $this->datetime], |
|
33 | - ['field' => 'eventGroup', 'type' => 'int', 'value' => $this->series->getId()], |
|
34 | - ['field' => 'type', 'type' => 'int', 'value' => $this->type->getId()], |
|
35 | - ['field' => 'subType', 'type' => 'int', 'value' => $this->sub_type->getId()], |
|
36 | - ['field' => 'location', 'type' => 'int', 'value' => $this->location->getId()], |
|
37 | - ['field' => 'created', 'type' => 'datetime', 'value' => $currentTimestamp], |
|
31 | + ['field' => 'name', 'type' => 'string', 'value' => $this->name], |
|
32 | + ['field' => 'date', 'type' => 'string', 'value' => $this->datetime], |
|
33 | + ['field' => 'eventGroup', 'type' => 'int', 'value' => $this->series->getId()], |
|
34 | + ['field' => 'type', 'type' => 'int', 'value' => $this->type->getId()], |
|
35 | + ['field' => 'subType', 'type' => 'int', 'value' => $this->sub_type->getId()], |
|
36 | + ['field' => 'location', 'type' => 'int', 'value' => $this->location->getId()], |
|
37 | + ['field' => 'created', 'type' => 'datetime', 'value' => $currentTimestamp], |
|
38 | 38 | ]; |
39 | 39 | |
40 | 40 | if (isset($this->notes)) { |
@@ -24,12 +24,12 @@ |
||
24 | 24 | public function createInDb(Database $db) |
25 | 25 | { |
26 | 26 | if (empty($this->name) || empty($this->datetime) || empty($this->series) || empty($this->type) || empty($this->sub_type) || empty($this->location)) { |
27 | - $message = 'Series name ('.$this->name.')'; |
|
28 | - $message .= ' or date ('.$this->datetime.')'; |
|
29 | - $message .= ' or series ('.$this->series.')'; |
|
30 | - $message .= ' or type ('.$this->type.')'; |
|
31 | - $message .= ' or sub_type ('.$this->sub_type.')'; |
|
32 | - $message .= ' or location ('.$this->location.')'; |
|
27 | + $message = 'Series name (' . $this->name . ')'; |
|
28 | + $message .= ' or date (' . $this->datetime . ')'; |
|
29 | + $message .= ' or series (' . $this->series . ')'; |
|
30 | + $message .= ' or type (' . $this->type . ')'; |
|
31 | + $message .= ' or sub_type (' . $this->sub_type . ')'; |
|
32 | + $message .= ' or location (' . $this->location . ')'; |
|
33 | 33 | $message .= ' cannot be empty.'; |
34 | 34 | |
35 | 35 | throw new Exception($message); |
@@ -38,14 +38,14 @@ |
||
38 | 38 | |
39 | 39 | $id = urlencode($id); |
40 | 40 | |
41 | -$url = 'http://localhost/api/v1/series/'.$id; |
|
41 | +$url = 'http://localhost/api/v1/series/' . $id; |
|
42 | 42 | $response = file_get_contents($url); |
43 | 43 | |
44 | -echo 'URL: '.$url; |
|
44 | +echo 'URL: ' . $url; |
|
45 | 45 | |
46 | 46 | $responseData = json_decode($response, true); |
47 | 47 | $data = $responseData['data']; |
48 | 48 | |
49 | 49 | echo var_dump($responseData); |
50 | 50 | |
51 | -echo 'series '.$id.': id = '.$data['id'].', name = '.$data['name'].', description = '.$data['description']; |
|
51 | +echo 'series ' . $id . ': id = ' . $data['id'] . ', name = ' . $data['name'] . ', description = ' . $data['description']; |
@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | } |
21 | 21 | |
22 | 22 | $data = [ |
23 | - ['field' => 'name', 'type' => 'string', 'value' => $this->name], |
|
24 | - ['field' => 'description', 'type' => 'string', 'value' => $this->description], |
|
23 | + ['field' => 'name', 'type' => 'string', 'value' => $this->name], |
|
24 | + ['field' => 'description', 'type' => 'string', 'value' => $this->description], |
|
25 | 25 | ]; |
26 | 26 | |
27 | 27 | $db->insert($this->db_table, $data); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | $whereCondition = 'id = '.$id; |
41 | 41 | $where = [ |
42 | - $whereCondition, |
|
42 | + $whereCondition, |
|
43 | 43 | ]; |
44 | 44 | |
45 | 45 | if ($db->delete($this->db_table, $where)) { |
@@ -59,14 +59,14 @@ discard block |
||
59 | 59 | } |
60 | 60 | |
61 | 61 | $columns = [ |
62 | - 'id', |
|
63 | - 'name', |
|
64 | - 'description', |
|
62 | + 'id', |
|
63 | + 'name', |
|
64 | + 'description', |
|
65 | 65 | ]; |
66 | 66 | |
67 | 67 | $whereCondition = 'id = '.$id; |
68 | 68 | $where = [ |
69 | - $whereCondition, |
|
69 | + $whereCondition, |
|
70 | 70 | ]; |
71 | 71 | |
72 | 72 | $result = $db->selectSingle('Type', $this->db_table, $columns, $where); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | public function createInDb(Database $db) |
17 | 17 | { |
18 | 18 | if (empty($this->name) || empty($this->description)) { |
19 | - throw new Exception('Series name ('.$this->name.') or description ('.$this->description.') cannot be empty.'); |
|
19 | + throw new Exception('Series name (' . $this->name . ') or description (' . $this->description . ') cannot be empty.'); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | $data = [ |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $id = $this->id; |
38 | 38 | } |
39 | 39 | |
40 | - $whereCondition = 'id = '.$id; |
|
40 | + $whereCondition = 'id = ' . $id; |
|
41 | 41 | $where = [ |
42 | 42 | $whereCondition, |
43 | 43 | ]; |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | 'description', |
65 | 65 | ]; |
66 | 66 | |
67 | - $whereCondition = 'id = '.$id; |
|
67 | + $whereCondition = 'id = ' . $id; |
|
68 | 68 | $where = [ |
69 | 69 | $whereCondition, |
70 | 70 | ]; |
@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | } |
21 | 21 | |
22 | 22 | $data = [ |
23 | - ['field' => 'name', 'type' => 'string', 'value' => $this->name], |
|
24 | - ['field' => 'description', 'type' => 'string', 'value' => $this->description], |
|
23 | + ['field' => 'name', 'type' => 'string', 'value' => $this->name], |
|
24 | + ['field' => 'description', 'type' => 'string', 'value' => $this->description], |
|
25 | 25 | ]; |
26 | 26 | |
27 | 27 | $db->insert($this->db_table, $data); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | $whereCondition = 'id = '.$id; |
44 | 44 | $where = [ |
45 | - $whereCondition, |
|
45 | + $whereCondition, |
|
46 | 46 | ]; |
47 | 47 | |
48 | 48 | if ($db->delete($this->db_table, $where)) { |
@@ -62,14 +62,14 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | $columns = [ |
65 | - 'id', |
|
66 | - 'name', |
|
67 | - 'description', |
|
65 | + 'id', |
|
66 | + 'name', |
|
67 | + 'description', |
|
68 | 68 | ]; |
69 | 69 | |
70 | 70 | $whereCondition = 'id = '.$id; |
71 | 71 | $where = [ |
72 | - $whereCondition, |
|
72 | + $whereCondition, |
|
73 | 73 | ]; |
74 | 74 | |
75 | 75 | $result = $db->selectSingle('SubType', $this->db_table, $columns, $where); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | public function createInDb(Database $db) |
17 | 17 | { |
18 | 18 | if (empty($this->name) || empty($this->description)) { |
19 | - throw new Exception('Series name ('.$this->name.') or description ('.$this->description.') cannot be empty.'); |
|
19 | + throw new Exception('Series name (' . $this->name . ') or description (' . $this->description . ') cannot be empty.'); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | $data = [ |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | throw new Exception('Sub Type id cannot be null'); |
41 | 41 | } |
42 | 42 | |
43 | - $whereCondition = 'id = '.$id; |
|
43 | + $whereCondition = 'id = ' . $id; |
|
44 | 44 | $where = [ |
45 | 45 | $whereCondition, |
46 | 46 | ]; |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | 'description', |
68 | 68 | ]; |
69 | 69 | |
70 | - $whereCondition = 'id = '.$id; |
|
70 | + $whereCondition = 'id = ' . $id; |
|
71 | 71 | $where = [ |
72 | 72 | $whereCondition, |
73 | 73 | ]; |
@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | } |
21 | 21 | |
22 | 22 | $data = [ |
23 | - ['field' => 'name', 'type' => 'string', 'value' => $this->name], |
|
24 | - ['field' => 'address', 'type' => 'string', 'value' => $this->address], |
|
23 | + ['field' => 'name', 'type' => 'string', 'value' => $this->name], |
|
24 | + ['field' => 'address', 'type' => 'string', 'value' => $this->address], |
|
25 | 25 | ]; |
26 | 26 | |
27 | 27 | $db->insert($this->db_table, $data); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | $whereCondition = 'id = '.$id; |
41 | 41 | $where = [ |
42 | - $whereCondition, |
|
42 | + $whereCondition, |
|
43 | 43 | ]; |
44 | 44 | |
45 | 45 | if ($db->delete($this->db_table, $where)) { |
@@ -59,14 +59,14 @@ discard block |
||
59 | 59 | } |
60 | 60 | |
61 | 61 | $columns = [ |
62 | - 'id', |
|
63 | - 'name', |
|
64 | - 'address', |
|
62 | + 'id', |
|
63 | + 'name', |
|
64 | + 'address', |
|
65 | 65 | ]; |
66 | 66 | |
67 | 67 | $whereCondition = 'id = '.$id; |
68 | 68 | $where = [ |
69 | - $whereCondition, |
|
69 | + $whereCondition, |
|
70 | 70 | ]; |
71 | 71 | |
72 | 72 | $result = $db->selectSingle('Location', $this->db_table, $columns, $where); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | public function createInDb(Database $db) |
17 | 17 | { |
18 | 18 | if (empty($this->name)) { |
19 | - throw new Exception('Series name ('.$this->name.') cannot be empty.'); |
|
19 | + throw new Exception('Series name (' . $this->name . ') cannot be empty.'); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | $data = [ |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $id = $this->id; |
38 | 38 | } |
39 | 39 | |
40 | - $whereCondition = 'id = '.$id; |
|
40 | + $whereCondition = 'id = ' . $id; |
|
41 | 41 | $where = [ |
42 | 42 | $whereCondition, |
43 | 43 | ]; |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | 'address', |
65 | 65 | ]; |
66 | 66 | |
67 | - $whereCondition = 'id = '.$id; |
|
67 | + $whereCondition = 'id = ' . $id; |
|
68 | 68 | $where = [ |
69 | 69 | $whereCondition, |
70 | 70 | ]; |
@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | $data = [ |
39 | - ['field' => 'name', 'type' => 'string', 'value' => $this->name], |
|
40 | - ['field' => 'description', 'type' => 'string', 'value' => $this->description], |
|
39 | + ['field' => 'name', 'type' => 'string', 'value' => $this->name], |
|
40 | + ['field' => 'description', 'type' => 'string', 'value' => $this->description], |
|
41 | 41 | ]; |
42 | 42 | |
43 | 43 | $db->insert($this->db_table, $data); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | $whereCondition = 'id = '.$id; |
57 | 57 | $where = [ |
58 | - $whereCondition, |
|
58 | + $whereCondition, |
|
59 | 59 | ]; |
60 | 60 | |
61 | 61 | if ($db->delete($this->db_table, $where)) { |
@@ -75,14 +75,14 @@ discard block |
||
75 | 75 | } |
76 | 76 | |
77 | 77 | $columns = [ |
78 | - 'id', |
|
79 | - 'name', |
|
80 | - 'description', |
|
78 | + 'id', |
|
79 | + 'name', |
|
80 | + 'description', |
|
81 | 81 | ]; |
82 | 82 | |
83 | 83 | $whereCondition = 'id = '.$id; |
84 | 84 | $where = [ |
85 | - $whereCondition, |
|
85 | + $whereCondition, |
|
86 | 86 | ]; |
87 | 87 | |
88 | 88 | $result = $db->selectSingle('Series', $this->db_table, $columns, $where); |
@@ -105,14 +105,14 @@ discard block |
||
105 | 105 | } |
106 | 106 | |
107 | 107 | $columns = [ |
108 | - 'id', |
|
109 | - 'name', |
|
110 | - 'description', |
|
108 | + 'id', |
|
109 | + 'name', |
|
110 | + 'description', |
|
111 | 111 | ]; |
112 | 112 | |
113 | 113 | $whereCondition = 'name = '.$db->addQuotes($name); |
114 | 114 | $where = [ |
115 | - $whereCondition, |
|
115 | + $whereCondition, |
|
116 | 116 | ]; |
117 | 117 | |
118 | 118 | $result = $db->selectSingle('Series', $this->db_table, $columns, $where); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | public function createInDb(Database $db) |
33 | 33 | { |
34 | 34 | if (empty($this->name) || empty($this->description)) { |
35 | - throw new Exception('Series name ('.$this->name.') or description ('.$this->description.') cannot be empty.'); |
|
35 | + throw new Exception('Series name (' . $this->name . ') or description (' . $this->description . ') cannot be empty.'); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | $data = [ |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $id = $this->id; |
54 | 54 | } |
55 | 55 | |
56 | - $whereCondition = 'id = '.$id; |
|
56 | + $whereCondition = 'id = ' . $id; |
|
57 | 57 | $where = [ |
58 | 58 | $whereCondition, |
59 | 59 | ]; |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | 'description', |
81 | 81 | ]; |
82 | 82 | |
83 | - $whereCondition = 'id = '.$id; |
|
83 | + $whereCondition = 'id = ' . $id; |
|
84 | 84 | $where = [ |
85 | 85 | $whereCondition, |
86 | 86 | ]; |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | 'description', |
111 | 111 | ]; |
112 | 112 | |
113 | - $whereCondition = 'name = '.$db->addQuotes($name); |
|
113 | + $whereCondition = 'name = ' . $db->addQuotes($name); |
|
114 | 114 | $where = [ |
115 | 115 | $whereCondition, |
116 | 116 | ]; |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require __DIR__.'/../config/database.php'; |
|
4 | -require __DIR__.'/../config/auth.php'; |
|
5 | -require __DIR__.'/../config/email.php'; |
|
6 | -require __DIR__.'/../config/recording.php'; |
|
3 | +require __DIR__ . '/../config/database.php'; |
|
4 | +require __DIR__ . '/../config/auth.php'; |
|
5 | +require __DIR__ . '/../config/email.php'; |
|
6 | +require __DIR__ . '/../config/recording.php'; |
|
7 | 7 | |
8 | 8 | function getConfig() |
9 | 9 | { |