Check if record exists in CakePHP3.5
The Following Code returns only a error :Record not found in table "users" if($this->Users->get($uid)->isEmpty()) { //do something } Because the Table is empty, i want to customize this if the table is empty, and call a new page in browser Table::get() will immediately evaluate the query and return an entity, or throw an exception if the record with the given primary key doesn't exist, ie it doesn't return a query, you cannot call isEmpty() on the result. If you are using Table::get() you can catch the RecordNotFoundException : try { $user = $this->Users->get($uid); // ... } catch (\Cake