@@ 29-44 (lines=16) @@ | ||
26 | * |
|
27 | * @return bool |
|
28 | */ |
|
29 | protected function removeObject($objectName) |
|
30 | { |
|
31 | if ($objectName instanceof BaseObject) { |
|
32 | $objectName = $objectName->getName(); |
|
33 | } |
|
34 | ||
35 | foreach ($this->objects as $objectIndex => $object) { |
|
36 | if ($object->getName() === $objectName) { |
|
37 | unset($this->objects[$objectIndex]); |
|
38 | ||
39 | return true; |
|
40 | } |
|
41 | } |
|
42 | ||
43 | return false; |
|
44 | } |
|
45 | ||
46 | /** |
|
47 | * @return array|BaseObject[] |
|
@@ 82-95 (lines=14) @@ | ||
79 | * |
|
80 | * @return null|BaseObject |
|
81 | */ |
|
82 | protected function getObject($objectName) |
|
83 | { |
|
84 | if ($objectName instanceof BaseObject) { |
|
85 | $objectName = $objectName->getName(); |
|
86 | } |
|
87 | ||
88 | foreach ($this->objects as $object) { |
|
89 | if ($object->getName() === $objectName) { |
|
90 | return $object; |
|
91 | } |
|
92 | } |
|
93 | ||
94 | return null; |
|
95 | } |
|
96 | ||
97 | /** |
|
98 | * @return array |