@@ 63-75 (lines=13) @@ | ||
60 | * @param mixed $info |
|
61 | * @return bool |
|
62 | */ |
|
63 | public function set_info( $object, $info = null ) { |
|
64 | $info = ! empty( $info ) ? $info : spl_object_hash( $object ); |
|
65 | $this->rewind(); |
|
66 | while ( $this->valid() ) { |
|
67 | if ( $object == $this->current() ) { |
|
68 | $this->setInfo( $info ); |
|
69 | $this->rewind(); |
|
70 | return true; |
|
71 | } |
|
72 | $this->next(); |
|
73 | } |
|
74 | return false; |
|
75 | } |
|
76 | ||
77 | ||
78 |
@@ 95-107 (lines=13) @@ | ||
92 | * @param mixed $identifier |
|
93 | * @return bool |
|
94 | */ |
|
95 | public function setIdentifier( $object, $identifier = null ) { |
|
96 | $identifier = ! empty( $identifier ) ? $identifier : spl_object_hash( $object ); |
|
97 | $this->rewind(); |
|
98 | while ( $this->valid() ) { |
|
99 | if ( $object === $this->current() ) { |
|
100 | $this->setInfo( $identifier ); |
|
101 | $this->rewind(); |
|
102 | return true; |
|
103 | } |
|
104 | $this->next(); |
|
105 | } |
|
106 | return false; |
|
107 | } |
|
108 | ||
109 | ||
110 |