@@ 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 |
@@ 92-104 (lines=13) @@ | ||
89 | * @param mixed $identifier |
|
90 | * @return bool |
|
91 | */ |
|
92 | public function setIdentifier($object, $identifier = null) |
|
93 | { |
|
94 | $identifier = ! empty($identifier) ? $identifier : spl_object_hash($object); |
|
95 | $this->rewind(); |
|
96 | while ($this->valid()) { |
|
97 | if ($object === $this->current()) { |
|
98 | $this->setInfo($identifier); |
|
99 | $this->rewind(); |
|
100 | return true; |
|
101 | } |
|
102 | $this->next(); |
|
103 | } |
|
104 | return false; |
|
105 | } |
|
106 | ||
107 |