@@ -103,6 +103,9 @@ |
||
103 | 103 | $type->add_property($property); |
104 | 104 | } |
105 | 105 | |
106 | + /** |
|
107 | + * @param string $name |
|
108 | + */ |
|
106 | 109 | private function add_mixin($name, type $type) |
107 | 110 | { |
108 | 111 | if (empty($this->mixins[$name])) |
@@ -111,8 +111,7 @@ |
||
111 | 111 | { |
112 | 112 | $mapping = $this->cm->getFieldMapping($property); |
113 | 113 | return $mapping['midgard:midgard_type']; |
114 | - } |
|
115 | - else if ($this->cm->hasAssociation($property)) |
|
114 | + } else if ($this->cm->hasAssociation($property)) |
|
116 | 115 | { |
117 | 116 | // for now, only PK fields are supported, which are always IDs, so.. |
118 | 117 | return translator::TYPE_UINT; |
@@ -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? |
@@ -43,8 +43,7 @@ discard block |
||
43 | 43 | if (file_exists(OPENPSA_PROJECT_BASEDIR . 'config/midgard-portable.inc.php')) |
44 | 44 | { |
45 | 45 | $path = OPENPSA_PROJECT_BASEDIR . 'config/midgard-portable.inc.php'; |
46 | - } |
|
47 | - else |
|
46 | + } else |
|
48 | 47 | { |
49 | 48 | $dialog = $this->getHelper('question'); |
50 | 49 | $path = $dialog->ask($input, $output, new Question('<question>Enter path to config file</question>')); |
@@ -96,8 +95,7 @@ discard block |
||
96 | 95 | if (!$em->getConnection()->getSchemaManager()->tablesExist(array($cm->getTableName()))) |
97 | 96 | { |
98 | 97 | $to_create[] = $cm; |
99 | - } |
|
100 | - else |
|
98 | + } else |
|
101 | 99 | { |
102 | 100 | $to_update[] = $cm; |
103 | 101 | } |
@@ -110,14 +108,12 @@ discard block |
||
110 | 108 | try |
111 | 109 | { |
112 | 110 | $tool->createSchema($to_create); |
113 | - } |
|
114 | - catch (\Exception $e) |
|
111 | + } catch (\Exception $e) |
|
115 | 112 | { |
116 | 113 | if (!$force) |
117 | 114 | { |
118 | 115 | throw $e; |
119 | - } |
|
120 | - else |
|
116 | + } else |
|
121 | 117 | { |
122 | 118 | $output->writeln('<error>' . $e->getMessage() . '</error>'); |
123 | 119 | } |
@@ -187,14 +183,12 @@ discard block |
||
187 | 183 | try |
188 | 184 | { |
189 | 185 | $conn->executeQuery($sql_line); |
190 | - } |
|
191 | - catch (\Exception $e) |
|
186 | + } catch (\Exception $e) |
|
192 | 187 | { |
193 | 188 | if (!$force) |
194 | 189 | { |
195 | 190 | throw $e; |
196 | - } |
|
197 | - else |
|
191 | + } else |
|
198 | 192 | { |
199 | 193 | $output->writeln('<error>' . $e->getMessage() . '</error>'); |
200 | 194 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | $mgd_config = midgard_connection::get_instance()->config; |
62 | 62 | $mgdobjects_file = $mgd_config->vardir . '/midgard_objects.php'; |
63 | - if ( file_exists($mgdobjects_file) |
|
63 | + if (file_exists($mgdobjects_file) |
|
64 | 64 | && !unlink($mgdobjects_file)) |
65 | 65 | { |
66 | 66 | throw new \RuntimeException('Could not unlink ' . $mgdobjects_file); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $cms = $em->getMetadataFactory()->getAllMetadata(); |
81 | 81 | |
82 | 82 | // create storage |
83 | - if ( !midgard_storage::create_base_storage() |
|
83 | + if (!midgard_storage::create_base_storage() |
|
84 | 84 | && midgard_connection::get_instance()->get_error_string() != 'MGD_ERR_OK') |
85 | 85 | { |
86 | 86 | throw new \Exception("Failed to create base database structures" . midgard_connection::get_instance()->get_error_string()); |
@@ -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']; |
@@ -84,8 +84,7 @@ discard block |
||
84 | 84 | || $property->link['target'] === $property->get_parent()->name) |
85 | 85 | { |
86 | 86 | $target_class = $property->link['target']; |
87 | - } |
|
88 | - else |
|
87 | + } else |
|
89 | 88 | { |
90 | 89 | if (!array_key_exists($property->link['target'], $this->merged_types)) |
91 | 90 | { |
@@ -233,8 +232,7 @@ discard block |
||
233 | 232 | if (array_key_exists($fqcn, $this->types)) |
234 | 233 | { |
235 | 234 | return $this->types[$fqcn]; |
236 | - } |
|
237 | - else if (array_key_exists($classname, $this->merged_types)) |
|
235 | + } else if (array_key_exists($classname, $this->merged_types)) |
|
238 | 236 | { |
239 | 237 | $fqcn = $this->merged_types[$classname]; |
240 | 238 | if (!empty($this->namespace)) |
@@ -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']; |
@@ -52,8 +52,7 @@ discard block |
||
52 | 52 | if ($name == 'metadata') |
53 | 53 | { |
54 | 54 | $this->has_metadata = ($value === 'true'); |
55 | - } |
|
56 | - else |
|
55 | + } else |
|
57 | 56 | { |
58 | 57 | $this->$name = (string) $value; |
59 | 58 | } |
@@ -70,8 +69,7 @@ discard block |
||
70 | 69 | if ($property instanceof mixin) |
71 | 70 | { |
72 | 71 | $this->mixins[$name] = $property; |
73 | - } |
|
74 | - else |
|
72 | + } else |
|
75 | 73 | { |
76 | 74 | if ($property->parentfield) |
77 | 75 | { |
@@ -86,8 +84,7 @@ discard block |
||
86 | 84 | { |
87 | 85 | $this->properties[$name] = $property; |
88 | 86 | $this->dbfields[$property->field] = $property->name; |
89 | - } |
|
90 | - else if (!array_key_exists($property->name, $this->properties)) |
|
87 | + } else if (!array_key_exists($property->name, $this->properties)) |
|
91 | 88 | { |
92 | 89 | $this->field_aliases[$property->name] = $this->dbfields[$property->field]; |
93 | 90 | } |
@@ -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 | ); |
@@ -143,8 +143,7 @@ discard block |
||
143 | 143 | { |
144 | 144 | $om = new objectmanager(connection::get_em()); |
145 | 145 | $om->create($this); |
146 | - } |
|
147 | - catch (\Exception $e) |
|
146 | + } catch (\Exception $e) |
|
148 | 147 | { |
149 | 148 | exception::internal($e); |
150 | 149 | return false; |
@@ -170,8 +169,7 @@ discard block |
||
170 | 169 | { |
171 | 170 | $om = new objectmanager(connection::get_em()); |
172 | 171 | $om->update($this); |
173 | - } |
|
174 | - catch (\Exception $e) |
|
172 | + } catch (\Exception $e) |
|
175 | 173 | { |
176 | 174 | exception::internal($e); |
177 | 175 | return false; |
@@ -192,8 +190,7 @@ discard block |
||
192 | 190 | { |
193 | 191 | $om = new objectmanager(connection::get_em()); |
194 | 192 | $om->purge($this); |
195 | - } |
|
196 | - catch (\Exception $e) |
|
193 | + } catch (\Exception $e) |
|
197 | 194 | { |
198 | 195 | exception::internal($e); |
199 | 196 | return false; |
@@ -883,7 +883,7 @@ |
||
883 | 883 | |
884 | 884 | public function approve() |
885 | 885 | { |
886 | - return $this->manage_meta_property("approve", true); |
|
886 | + return $this->manage_meta_property("approve", true); |
|
887 | 887 | } |
888 | 888 | |
889 | 889 | public function is_approved() |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | |
67 | 67 | public function __get($field) |
68 | 68 | { |
69 | - if ( $field === 'metadata' |
|
69 | + if ($field === 'metadata' |
|
70 | 70 | && property_exists($this, 'metadata') |
71 | 71 | && $this->metadata === null) |
72 | 72 | { |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | if ($this->$candidate !== null) |
93 | 93 | { |
94 | 94 | //Proxies become stale if the object itself is detached, so we have to re-fetch |
95 | - if ( $this->$candidate instanceof \Doctrine\ORM\Proxy\Proxy |
|
95 | + if ($this->$candidate instanceof \Doctrine\ORM\Proxy\Proxy |
|
96 | 96 | && $this->$candidate->__isInitialized()) |
97 | 97 | { |
98 | 98 | try |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | } |
122 | 122 | // According to Doctrine documentation, proxies should be transparent, but in practice, |
123 | 123 | // there will be problems if we don't force-load |
124 | - if ( $entity instanceof \Doctrine\ORM\Proxy\Proxy |
|
124 | + if ($entity instanceof \Doctrine\ORM\Proxy\Proxy |
|
125 | 125 | && !$entity->__isInitialized()) |
126 | 126 | { |
127 | 127 | try |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | exception::duplicate(); |
177 | 177 | return false; |
178 | 178 | } |
179 | - if ( !$this->is_unique() |
|
179 | + if (!$this->is_unique() |
|
180 | 180 | || !$this->check_parent()) |
181 | 181 | { |
182 | 182 | return false; |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | midgard_connection::get_instance()->set_error(MGD_ERR_INVALID_PROPERTY_VALUE); |
239 | 239 | return false; |
240 | 240 | } |
241 | - if ( $check_dependencies |
|
241 | + if ($check_dependencies |
|
242 | 242 | && $this->has_dependents()) |
243 | 243 | { |
244 | 244 | exception::has_dependants(); |
@@ -282,8 +282,7 @@ discard block |
||
282 | 282 | $conditions = $qb->expr()->andX(); |
283 | 283 | if ($this->id) |
284 | 284 | { |
285 | - $parameters = array |
|
286 | - ( |
|
285 | + $parameters = array( |
|
287 | 286 | 'id' => $this->id |
288 | 287 | ); |
289 | 288 | $conditions->add($qb->expr()->neq('c.id', ':id')); |
@@ -337,7 +336,7 @@ discard block |
||
337 | 336 | { |
338 | 337 | $this->initialize(); |
339 | 338 | |
340 | - if ( empty($this->cm->midgard['parentfield']) |
|
339 | + if (empty($this->cm->midgard['parentfield']) |
|
341 | 340 | || empty($this->cm->midgard['parent'])) |
342 | 341 | { |
343 | 342 | return true; |
@@ -357,7 +356,7 @@ discard block |
||
357 | 356 | |
358 | 357 | foreach ($this->cm->fieldMappings as $name => $field) |
359 | 358 | { |
360 | - if ( $field['midgard:midgard_type'] == translator::TYPE_GUID |
|
359 | + if ($field['midgard:midgard_type'] == translator::TYPE_GUID |
|
361 | 360 | && !empty($this->$name) |
362 | 361 | && !mgd_is_guid($this->$name)) |
363 | 362 | { |
@@ -395,7 +394,7 @@ discard block |
||
395 | 394 | $stat = ($results > 0); |
396 | 395 | } |
397 | 396 | |
398 | - if ( !$stat |
|
397 | + if (!$stat |
|
399 | 398 | && !empty($this->cm->midgard['childtypes'])) |
400 | 399 | { |
401 | 400 | foreach ($this->cm->midgard['childtypes'] as $typename => $parentfield) |
@@ -534,8 +533,7 @@ discard block |
||
534 | 533 | $qb->from($classname, 'c'); |
535 | 534 | $conditions = $qb->expr()->andX(); |
536 | 535 | $conditions->add($qb->expr()->eq('c.' . $field, ':' . $field)); |
537 | - $parameters = array |
|
538 | - ( |
|
536 | + $parameters = array( |
|
539 | 537 | $field => $part |
540 | 538 | ); |
541 | 539 | |
@@ -621,10 +619,9 @@ discard block |
||
621 | 619 | |
622 | 620 | public function set_parameter($domain, $name, $value) |
623 | 621 | { |
624 | - $constraints = array |
|
625 | - ( |
|
626 | - array ('domain', '=', $domain), |
|
627 | - array ('name', '=', $name), |
|
622 | + $constraints = array( |
|
623 | + array('domain', '=', $domain), |
|
624 | + array('name', '=', $name), |
|
628 | 625 | ); |
629 | 626 | $params = $this->get_collection('midgard_parameter')->find($this->guid, $constraints); |
630 | 627 | |
@@ -765,7 +762,7 @@ discard block |
||
765 | 762 | exception::not_exists(); |
766 | 763 | return false; |
767 | 764 | } |
768 | - if ( $check_dependencies |
|
765 | + if ($check_dependencies |
|
769 | 766 | && $this->has_dependents()) |
770 | 767 | { |
771 | 768 | exception::has_dependants(); |
@@ -33,8 +33,7 @@ discard block |
||
33 | 33 | if (is_int($id)) |
34 | 34 | { |
35 | 35 | $this->get_by_id($id); |
36 | - } |
|
37 | - else if (is_string($id)) |
|
36 | + } else if (is_string($id)) |
|
38 | 37 | { |
39 | 38 | $this->get_by_guid($id); |
40 | 39 | } |
@@ -98,8 +97,7 @@ discard block |
||
98 | 97 | try |
99 | 98 | { |
100 | 99 | $this->$candidate->get_by_id($this->$candidate->id); |
101 | - } |
|
102 | - catch (exception $e) |
|
100 | + } catch (exception $e) |
|
103 | 101 | { |
104 | 102 | connection::log()->error('Failed to refresh parent from proxy: ' . $e->getMessage()); |
105 | 103 | return null; |
@@ -127,8 +125,7 @@ discard block |
||
127 | 125 | try |
128 | 126 | { |
129 | 127 | $entity->__load(); |
130 | - } |
|
131 | - catch (\Doctrine\ORM\EntityNotFoundException $e) |
|
128 | + } catch (\Doctrine\ORM\EntityNotFoundException $e) |
|
132 | 129 | { |
133 | 130 | throw exception::object_purged(); |
134 | 131 | } |
@@ -189,8 +186,7 @@ discard block |
||
189 | 186 | { |
190 | 187 | $om = new objectmanager(connection::get_em()); |
191 | 188 | $om->create($this); |
192 | - } |
|
193 | - catch (\Exception $e) |
|
189 | + } catch (\Exception $e) |
|
194 | 190 | { |
195 | 191 | exception::internal($e); |
196 | 192 | return false; |
@@ -216,8 +212,7 @@ discard block |
||
216 | 212 | { |
217 | 213 | $om = new objectmanager(connection::get_em()); |
218 | 214 | $om->update($this); |
219 | - } |
|
220 | - catch (\Exception $e) |
|
215 | + } catch (\Exception $e) |
|
221 | 216 | { |
222 | 217 | exception::internal($e); |
223 | 218 | return false; |
@@ -257,8 +252,7 @@ discard block |
||
257 | 252 | { |
258 | 253 | $om = new objectmanager(connection::get_em()); |
259 | 254 | $om->delete($this); |
260 | - } |
|
261 | - catch (\Exception $e) |
|
255 | + } catch (\Exception $e) |
|
262 | 256 | { |
263 | 257 | exception::internal($e); |
264 | 258 | return false; |
@@ -312,8 +306,7 @@ discard block |
||
312 | 306 | if ($this->{$this->cm->midgard['upfield']} === null) |
313 | 307 | { |
314 | 308 | $conditions->add($qb->expr()->isNull('c.' . $this->cm->midgard['upfield'])); |
315 | - } |
|
316 | - else |
|
309 | + } else |
|
317 | 310 | { |
318 | 311 | $conditions->add($qb->expr()->eq('c.' . $this->cm->midgard['upfield'], ':' . $this->cm->midgard['upfield'])); |
319 | 312 | $parameters[$this->cm->midgard['upfield']] = $this->{$this->cm->midgard['upfield']}; |
@@ -480,14 +473,12 @@ discard block |
||
480 | 473 | $parentclass = $this->cm->fullyQualifiedClassName($this->cm->midgard['parent']); |
481 | 474 | $parentfield = $parent_cm->midgard['upfield']; |
482 | 475 | $upfield = $this->cm->midgard['parentfield']; |
483 | - } |
|
484 | - else if (!empty($this->cm->midgard['upfield'])) |
|
476 | + } else if (!empty($this->cm->midgard['upfield'])) |
|
485 | 477 | { |
486 | 478 | $parentclass = get_class($this); |
487 | 479 | $upfield = $this->cm->midgard['upfield']; |
488 | 480 | $parentfield = $upfield; |
489 | - } |
|
490 | - else |
|
481 | + } else |
|
491 | 482 | { |
492 | 483 | return false; |
493 | 484 | } |
@@ -546,8 +537,7 @@ discard block |
||
546 | 537 | ->add($qb->expr()->isNull('c.' . $upfield)) |
547 | 538 | ->add($qb->expr()->eq('c.' . $upfield, '0')); |
548 | 539 | $conditions->add($empty_conditions); |
549 | - } |
|
550 | - else |
|
540 | + } else |
|
551 | 541 | { |
552 | 542 | $conditions->add($qb->expr()->eq('c.' . $upfield, ':' . $upfield)); |
553 | 543 | $parameters[$upfield] = $up; |
@@ -612,8 +602,7 @@ discard block |
||
612 | 602 | try |
613 | 603 | { |
614 | 604 | return $qb->getQuery()->getOneOrNullResult(Query::HYDRATE_SINGLE_SCALAR); |
615 | - } |
|
616 | - catch (\Doctrine\ORM\NoResultException $e) |
|
605 | + } catch (\Doctrine\ORM\NoResultException $e) |
|
617 | 606 | { |
618 | 607 | return null; |
619 | 608 | } |
@@ -665,8 +654,7 @@ discard block |
||
665 | 654 | } |
666 | 655 | midgard_connection::get_instance()->set_error(MGD_ERR_OK); |
667 | 656 | return true; |
668 | - } |
|
669 | - catch (\Exception $e) |
|
657 | + } catch (\Exception $e) |
|
670 | 658 | { |
671 | 659 | exception::internal($e); |
672 | 660 | return false; |
@@ -737,8 +725,7 @@ discard block |
||
737 | 725 | $om->create($att); |
738 | 726 | midgard_connection::get_instance()->set_error(MGD_ERR_OK); |
739 | 727 | return $att; |
740 | - } |
|
741 | - catch (\Exception $e) |
|
728 | + } catch (\Exception $e) |
|
742 | 729 | { |
743 | 730 | exception::internal($e); |
744 | 731 | return null; |
@@ -773,13 +760,11 @@ discard block |
||
773 | 760 | { |
774 | 761 | $om = new objectmanager(connection::get_em()); |
775 | 762 | $om->purge($this); |
776 | - } |
|
777 | - catch (\Doctrine\ORM\EntityNotFoundException $e) |
|
763 | + } catch (\Doctrine\ORM\EntityNotFoundException $e) |
|
778 | 764 | { |
779 | 765 | exception::not_exists(); |
780 | 766 | return false; |
781 | - } |
|
782 | - catch (\Exception $e) |
|
767 | + } catch (\Exception $e) |
|
783 | 768 | { |
784 | 769 | exception::internal($e); |
785 | 770 | return false; |
@@ -842,12 +827,10 @@ discard block |
||
842 | 827 | if ($action == 'lock') |
843 | 828 | { |
844 | 829 | $flag = 'islocked'; |
845 | - } |
|
846 | - else if ($action == 'approve') |
|
830 | + } else if ($action == 'approve') |
|
847 | 831 | { |
848 | 832 | $flag = 'isapproved'; |
849 | - } |
|
850 | - else |
|
833 | + } else |
|
851 | 834 | { |
852 | 835 | throw new exception('Unsupported action ' . $action); |
853 | 836 | } |
@@ -867,8 +850,7 @@ discard block |
||
867 | 850 | { |
868 | 851 | $om = new objectmanager(connection::get_em()); |
869 | 852 | $om->{$action}($this); |
870 | - } |
|
871 | - catch (\Exception $e) |
|
853 | + } catch (\Exception $e) |
|
872 | 854 | { |
873 | 855 | exception::internal($e); |
874 | 856 | return false; |
@@ -131,6 +131,9 @@ discard block |
||
131 | 131 | return null; |
132 | 132 | } |
133 | 133 | |
134 | + /** |
|
135 | + * @param integer $id |
|
136 | + */ |
|
134 | 137 | public function get_by_id($id) |
135 | 138 | { |
136 | 139 | $entity = connection::get_em()->find(get_class($this), $id); |
@@ -171,6 +174,9 @@ discard block |
||
171 | 174 | return true; |
172 | 175 | } |
173 | 176 | |
177 | + /** |
|
178 | + * @param string $guid |
|
179 | + */ |
|
174 | 180 | public function get_by_guid($guid) |
175 | 181 | { |
176 | 182 | if (!mgd_is_guid($guid)) |
@@ -546,7 +552,8 @@ discard block |
||
546 | 552 | } |
547 | 553 | |
548 | 554 | /** |
549 | - * @return int |
|
555 | + * @param integer $up |
|
556 | + * @return \Doctrine\ORM\QueryBuilder |
|
550 | 557 | */ |
551 | 558 | protected function get_uniquefield_query($classname, $field, $part, $upfield, $up) |
552 | 559 | { |
@@ -639,6 +646,9 @@ discard block |
||
639 | 646 | } |
640 | 647 | } |
641 | 648 | |
649 | + /** |
|
650 | + * @param string $value |
|
651 | + */ |
|
642 | 652 | public function set_parameter($domain, $name, $value) |
643 | 653 | { |
644 | 654 | $constraints = array |
@@ -729,7 +739,7 @@ discard block |
||
729 | 739 | * |
730 | 740 | * @param array $constraints |
731 | 741 | * @param boolean $delete_blob |
732 | - * @return boolean False if one or more attachments couldn't be deleted |
|
742 | + * @return integer False if one or more attachments couldn't be deleted |
|
733 | 743 | * @todo Implement delete_blob & return value |
734 | 744 | */ |
735 | 745 | public function purge_attachments(array $constraints = array(), $delete_blob = true) |
@@ -834,6 +844,9 @@ discard block |
||
834 | 844 | return new \midgard_reflection_property(get_called_class()); |
835 | 845 | } |
836 | 846 | |
847 | + /** |
|
848 | + * @param string $guid |
|
849 | + */ |
|
837 | 850 | public function set_guid($guid) |
838 | 851 | { |
839 | 852 | parent::__set('guid', $guid); |