|
|
@ -29,15 +29,6 @@ use Config\Aauth as AauthConfig; |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
class GroupModel extends Model |
|
|
|
class GroupModel extends Model |
|
|
|
{ |
|
|
|
{ |
|
|
|
/** |
|
|
|
|
|
|
|
* If this model should use "softDeletes" and |
|
|
|
|
|
|
|
* simply set a flag when rows are deleted, or |
|
|
|
|
|
|
|
* do hard deletes. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @var boolean |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
protected $useSoftDeletes = true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* If true, will set created_at, and updated_at |
|
|
|
* If true, will set created_at, and updated_at |
|
|
|
* values during insert and update routines. |
|
|
|
* values during insert and update routines. |
|
|
@ -60,12 +51,19 @@ class GroupModel extends Model |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Constructor |
|
|
|
* Constructor |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function __construct() |
|
|
|
public function __construct($db = null, $validation = null, $config = null) |
|
|
|
{ |
|
|
|
{ |
|
|
|
parent::__construct(); |
|
|
|
parent::__construct(); |
|
|
|
$this->config = new AauthConfig(); |
|
|
|
|
|
|
|
$this->table = $this->config->dbTableGroups; |
|
|
|
if (is_null($config)) |
|
|
|
$this->DBGroup = $this->config->dbProfile; |
|
|
|
{ |
|
|
|
|
|
|
|
$config = new AauthConfig(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->config = $config; |
|
|
|
|
|
|
|
$this->table = $this->config->dbTableGroups; |
|
|
|
|
|
|
|
$this->DBGroup = $this->config->dbProfile; |
|
|
|
|
|
|
|
$this->tempUseSoftDeletes = $this->config->dbSoftDeleteGroups; |
|
|
|
|
|
|
|
|
|
|
|
$this->validationRules['name'] = 'required|is_unique[' . $this->table . '.name,id,{id}]'; |
|
|
|
$this->validationRules['name'] = 'required|is_unique[' . $this->table . '.name,id,{id}]'; |
|
|
|
|
|
|
|
|
|
|
|