Using Entity with model, return empty Object |
Hello there,
Hope you are safe and healthy. PROBLEM: PHP Code: $user = $userModel->where('user_email', $email)->first(); Controller Code: PHP Code: public function doLogin() Model Code: PHP Code: <?php namespace App\Models; User Entity Code: PHP Code: <?php namespace App\Entities; If I Update the return type of model to OBJECT everything works fine but if i keep the return type as entity, it returns empty object. What is it that I am doing wrong?
If no records are found, you will get null.
Replace where statement with ID to test, e.g. PHP Code: $user = $userModel->where('user_id', 1)->first(); Otherwise nothing obvious which I can help with. |
Welcome Guest, Not a member yet? Register Sign In |