@@ 63-75 (lines=13) @@ | ||
60 | * @param mixed $info |
|
61 | * @return bool |
|
62 | */ |
|
63 | public function set_info($object, $info = null) |
|
64 | { |
|
65 | $info = ! empty($info) ? $info : spl_object_hash($object); |
|
66 | $this->rewind(); |
|
67 | while ($this->valid()) { |
|
68 | if ($object == $this->current()) { |
|
69 | $this->setInfo($info); |
|
70 | $this->rewind(); |
|
71 | return true; |
|
72 | } |
|
73 | $this->next(); |
|
74 | } |
|
75 | return false; |
|
76 | } |
|
77 | ||
78 |
@@ 134-146 (lines=13) @@ | ||
131 | * @param mixed $identifier |
|
132 | * @return bool |
|
133 | */ |
|
134 | public function setIdentifier($object, $identifier = null) |
|
135 | { |
|
136 | $identifier = ! empty($identifier) |
|
137 | ? $identifier |
|
138 | : spl_object_hash($object); |
|
139 | $this->rewind(); |
|
140 | while ($this->valid()) { |
|
141 | if ($object === $this->current()) { |
|
142 | $this->setInfo($identifier); |
|
143 | $this->rewind(); |
|
144 | return true; |
|
145 | } |
|
146 | $this->next(); |
|
147 | } |
|
148 | return false; |
|
149 | } |