I want to set these dynamically upon initialization of the model:
Code:
<?php namespace App\Models;
use CodeIgniter\Model;
class UserModel extends Model
{
protected $table = 'users';
protected $primaryKey = 'id';
protected $useAutoIncrement = true;
protected $returnType = 'array';
protected $useSoftDeletes = true;
protected $allowedFields = ['name', 'email'];
protected $useTimestamps = false;
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
protected $deletedField = 'deleted_at';
protected $validationRules = [];
protected $validationMessages = [];
protected $skipValidation = false;
}
How can I pass in these values as parameters to the model?
I'd like to do something like this:
Code:
$this->model = new MyModel($config);
But the model obviously expect a ConnectionsInterface and a ValidationInterfave upon construction ...