Method inside the controller receives wrong data type(bool instead of int) CakePHP3.x

I have next method inside of the controller:

class JobsController extends AppController
{
    public function view($id)
    {

        $job = $this->Job->findById($id);
        $this->set('job', $job);
    }   
}

And i send $id like this:

http://localhost/jobsfind/jobs/view/1

And instead of receiving integer and store it inside of $id it receives boolean and throws me this error:

Error: Call to a member function findById() on boolean

What am I doing wrong? Maybe this magic findById got depricated, or changed the call logic?


Source: New Questions

Leave a Reply