/** * Update * * @param UserOrg $uo * @param array $data */ protected function air_update(UserOrg $uo, $data) { if (isset($data['uo_ar_id'])) { $uo->uo_ar_id = $data['uo_ar_id']; $uo->refreshRelated('AdminRole'); } }
/** * Determine if an Organization has room for more Users in it. A negative * org_max_users indicates that it can hold unlimited Users. * * @return boolean */ public function is_full() { if ($this->org_max_users < 0) { return false; // < 0 == no user limit } $n = UserOrg::get_user_count($this->org_id); return $n >= $this->org_max_users; }