@@ -225,14 +225,14 @@ discard block |
||
225 | 225 | break; |
226 | 226 | } |
227 | 227 | |
228 | - if ( $dbobject->id > 0 |
|
228 | + if ($dbobject->id > 0 |
|
229 | 229 | && $dbobject->metadata->revised >= $object->metadata->revised) |
230 | 230 | { |
231 | 231 | midgard_connection::get_instance()->set_error(exception::OBJECT_IMPORTED); |
232 | 232 | return false; |
233 | 233 | } |
234 | 234 | |
235 | - if ( $dbobject->metadata->deleted |
|
235 | + if ($dbobject->metadata->deleted |
|
236 | 236 | && !$object->metadata->deleted) |
237 | 237 | { |
238 | 238 | if (!midgard_object_class::undelete($dbobject->guid)) |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | } |
242 | 242 | $dbobject->metadata_deleted = false; |
243 | 243 | } |
244 | - else if ( !$dbobject->metadata->deleted |
|
244 | + else if (!$dbobject->metadata->deleted |
|
245 | 245 | && $object->metadata->deleted) |
246 | 246 | { |
247 | 247 | return $dbobject->delete(); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | return is_object($this->config); |
85 | 85 | } |
86 | 86 | |
87 | - public function connect($signal, $callback, $userdata = '???' ) |
|
87 | + public function connect($signal, $callback, $userdata = '???') |
|
88 | 88 | { |
89 | 89 | |
90 | 90 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | return connection::get_user(); |
124 | 124 | } |
125 | 125 | |
126 | - public function set_loglevel($level, $callback = '???' ) |
|
126 | + public function set_loglevel($level, $callback = '???') |
|
127 | 127 | { |
128 | 128 | if (!in_array($level, $this->available_loglevels)) |
129 | 129 | { |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $parsed = $this->parse_constraint_name($property); |
71 | 71 | |
72 | 72 | // for properties like up.name |
73 | - if ( strpos($property, ".") !== false |
|
73 | + if (strpos($property, ".") !== false |
|
74 | 74 | && !(strpos($property, "metadata") === 0)) |
75 | 75 | { |
76 | 76 | return $parsed['name'] . " as " . str_replace(".", "_", $property); |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | */ |
155 | 155 | public function get($key) |
156 | 156 | { |
157 | - if ( !$this->_has_results() |
|
157 | + if (!$this->_has_results() |
|
158 | 158 | || !isset($this->_results[$key])) |
159 | 159 | { |
160 | 160 | return false; |
@@ -37,7 +37,7 @@ |
||
37 | 37 | { |
38 | 38 | throw exception::object_purged(); |
39 | 39 | } |
40 | - if ( !$include_deleted |
|
40 | + if (!$include_deleted |
|
41 | 41 | && $result["object_action"] == subscriber::ACTION_DELETE) |
42 | 42 | { |
43 | 43 | throw exception::object_deleted(); |
@@ -9,7 +9,7 @@ |
||
9 | 9 | use midgard\portable\mgdschema\translator; |
10 | 10 | use midgard\portable\api\error\exception; |
11 | 11 | |
12 | -if ( extension_loaded('midgard') |
|
12 | +if (extension_loaded('midgard') |
|
13 | 13 | || extension_loaded('midgard2')) |
14 | 14 | { |
15 | 15 | //TODO: Print some error? |
@@ -19,8 +19,7 @@ |
||
19 | 19 | const TYPE_TIMESTAMP = 139645924049440; |
20 | 20 | const TYPE_GUID = 139645923896704; |
21 | 21 | |
22 | - private static $typemap = array |
|
23 | - ( |
|
22 | + private static $typemap = array( |
|
24 | 23 | 'unsigned integer' => self::TYPE_UINT, |
25 | 24 | 'integer' => self::TYPE_INT, |
26 | 25 | 'boolean' => self::TYPE_BOOLEAN, |
@@ -80,7 +80,7 @@ |
||
80 | 80 | $fqcn = $this->namespace . '\\' . $fqcn; |
81 | 81 | } |
82 | 82 | |
83 | - if ( array_key_exists($fqcn, $this->types) |
|
83 | + if (array_key_exists($fqcn, $this->types) |
|
84 | 84 | || $property->link['target'] === $property->get_parent()->name) |
85 | 85 | { |
86 | 86 | $target_class = $property->link['target']; |
@@ -76,7 +76,7 @@ |
||
76 | 76 | if ($property->parentfield) |
77 | 77 | { |
78 | 78 | $this->parentfield = $property->name; |
79 | - if ( empty($this->parent) |
|
79 | + if (empty($this->parent) |
|
80 | 80 | && $property->link) |
81 | 81 | { |
82 | 82 | $this->parent = $property->link['target']; |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | |
66 | 66 | private function load_by_properties(array $properties) |
67 | 67 | { |
68 | - if ( !array_key_exists('authtype', $properties) |
|
68 | + if (!array_key_exists('authtype', $properties) |
|
69 | 69 | || !array_key_exists('login', $properties)) |
70 | 70 | { |
71 | 71 | throw exception::invalid_property_value(); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | |
118 | 118 | public function &get_person() |
119 | 119 | { |
120 | - if ( $this->person_object === null |
|
120 | + if ($this->person_object === null |
|
121 | 121 | && $this->person !== null) |
122 | 122 | { |
123 | 123 | $this->person_object = connection::get_em()->getRepository('midgard:midgard_person')->findOneBy(array('guid' => $this->person)); |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | |
128 | 128 | public function create() |
129 | 129 | { |
130 | - if ( empty($this->authtype) |
|
130 | + if (empty($this->authtype) |
|
131 | 131 | || !empty($this->id)) |
132 | 132 | { |
133 | 133 | exception::invalid_property_value(); |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | |
206 | 206 | protected function is_unique() |
207 | 207 | { |
208 | - if ( empty($this->login) |
|
208 | + if (empty($this->login) |
|
209 | 209 | || empty($this->authtype)) |
210 | 210 | { |
211 | 211 | return true; |
@@ -214,8 +214,7 @@ discard block |
||
214 | 214 | $qb = connection::get_em()->createQueryBuilder(); |
215 | 215 | $qb->from(get_class($this), 'c'); |
216 | 216 | $conditions = $qb->expr()->andX(); |
217 | - $parameters = array |
|
218 | - ( |
|
217 | + $parameters = array( |
|
219 | 218 | 'login' => $this->login, |
220 | 219 | 'authtype' => $this->authtype |
221 | 220 | ); |