Skip to content

Commit 866ebae

Browse files
authored
Added info about magic methods.
1 parent 085eaf1 commit 866ebae

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,24 @@ Clear all data:
145145

146146
$data->clear();
147147

148+
### Magic methods
149+
150+
Magic methods can be used to handle single level data (without dot notation).
151+
152+
Set value
153+
154+
$data->name = 'John';
155+
156+
Get value
157+
158+
echo $data->name;
159+
160+
Check if value exists
161+
162+
if (isset($data->name)) {
163+
// Do something...
164+
}
165+
166+
Delete value
167+
168+
unset($data->name);

0 commit comments

Comments
 (0)