Getting error: CodeIgniterDatabaseBaseResult::getResult in CodeIgniter



PHP Snippet 1:

class UsuariosModel extends Model
{
    
    protected $table = 'users';
    protected $primaryKey = 'user_id';
    
    protected $returnType = 'array';

    protected $allowedFields = ['user_login', 'user_psw', 'user_full_name', 'user_email', 'user_telef', 'user_image', 'user_date_of_birth', 'user_gender', "user_created_at", "user_updated_at", "user_deleted_at"];

    protected $useTimestamps = true;
    protected $useSoftDeletes = true;

    protected $createdField  = 'user_created_at';
    protected $updatedField  = 'user_updated_at';
    protected $deletedField  = 'user_deleted_at';
}

PHP Snippet 2:

use App\Models\UsuariosModel;

$myObject = new UsuariosModel()
$query  = $myObject->findAll();

echo '<pre>';
print_r($query);
exit;

PHP Snippet 3:

public function __construct() 
{
    parent::__construct();

    //other constructor code here
}