Esempio n. 1
0
 /**
  * @param $role
  * @param $from_date
  * @param $to_date
  * @return boolean
  */
 public function updateRole($role, $from_date, $to_date)
 {
     if (!($role = $this->makeSureItsRule($role))) {
         return false;
     }
     return $this->roles()->join('le_users', 'le_users.id', '=', 'le_user_role.user_id')->where('le_roles.id', $role->getKey())->update(Helper::instance()->toSqlDates(compact('from_date', 'to_date'), true));
 }
Esempio n. 2
0
 /**
  * Use to clean all attributes from xss attack
  *
  * @return $this
  */
 public function cleanXSS()
 {
     // Clean model attributes
     Helper::instance()->cleanXSS($this->attributes);
     // Clean language attributes
     foreach ($this->languages as $language) {
         is_array($language) && Helper::instance()->cleanXSS($language);
     }
     return $this;
 }