Welcome Guest, Not a member yet? Register   Sign In
Problem with Model()->find() and Model()->findAll()
#4

(This post was last modified: 10-06-2019, 01:25 PM by dave friend.)

Tell us about BaseModel. Does it extend CodeIgniter\Model? What are your namespace statements?

(10-06-2019, 01:01 PM)ciadmin Wrote: Model already has $table and $primaryKey properties. Shouldn't your model have a constructor, where it sets those?

Code:
public function __construct() {
  parent::__construct();
  $this->table = 'users';
}

You don't initialize the $DBGroup property, which might affect your outcome.

The docs show assignments to those and other Model properties in the class definition. Since the values are not typically used in a dynamic way there is no reason not to do it that way.
Reply


Messages In This Thread
RE: Problem with Model()->find() and Model()->findAll() - by dave friend - 10-06-2019, 01:22 PM



Theme © iAndrew 2016 - Forum software by © MyBB