@@ -96,7 +96,7 @@ Now that all of the pieces are in place, you would work with the Entity class as
9696 $userModel->save($user);
9797
9898 // Create
99- $user = new App\Entities\User();
99+ $user = new \ App\Entities\User();
100100 $user->username = 'foo';
101101 $user->email = 'foo@example.com';
102102 $userModel->save($user);
@@ -122,7 +122,7 @@ on your entities without worrying much about stray fields getting saved incorrec
122122
123123 $data = $this->request->getPost();
124124
125- $user = new App\Entities\User();
125+ $user = new \ App\Entities\User();
126126 $user->fill($data);
127127 $userModel->save($user);
128128
@@ -132,7 +132,7 @@ You can also pass the data in the constructor and the data will be passed throug
132132
133133 $data = $this->request->getPost();
134134
135- $user = new App\Entities\User($data);
135+ $user = new \ App\Entities\User($data);
136136 $userModel->save($user);
137137
138138Handling Business Logic
@@ -291,7 +291,7 @@ You can define which properties are automatically converted by adding the name t
291291Now, when any of those properties are set, they will be converted to a Time instance, using the application's
292292current timezone, as set in **app/Config/App.php **::
293293
294- $user = new App\Entities\User();
294+ $user = new \ App\Entities\User();
295295
296296 // Converted to Time instance
297297 $user->created_at = 'April 15, 2017 10:30:00';
0 commit comments