Just checking to see if this is how CI4 is supposed to work. I'm searching in a table for a specific address and the find is returning all rows in the table when the key is null.
Here is the line of code that returns all rows. I'm expecting nothing to be returned.
$address = $this->addressModel->find($venue->address_obj_id);
Here's the model:
<?php
namespace App\Models;
use CodeIgniter\Model;
use App\Entities\Address;
class AddressModel extends Model {
protected $table = 'Address';
protected $primaryKey = 'address_obj_id';
protected $useAutoIncrement = true;
protected $allowedFields = [
'customer_obj_id',
'address_type_obj_id',
'address1',
'address2',
'city',
'state',
'zip',
'default_address'
];
protected $returnType = 'App\Entities\Address';