SetInitialValues(); } /** * Sets up some default values * * @access private * @return void */ function SetInitialValues() { $this->id = -1; $this->name = ''; $this->active = false; } /** * Persists the group to the database. * * @return boolean true if the save was successful, false if not. */ function Save() { $result = false; $groupops = cmsms()->GetGroupOperations(); if ($this->id > -1) { $result = $groupops->UpdateGroup($this); } else { $newid = $groupops->InsertGroup($this); if ($newid > -1) { $this->id = $newid; $result = true; } } return $result; } /** * Deletes the group from the database * * @return boolean True if the delete was successful, false if not. */ function Delete() { $result = false; if ($this->id > -1) { $groupops = cmsms()->GetGroupOperations(); $result = $groupops->DeleteGroupByID($this->id); if ($result) { $this->SetInitialValues(); } } return $result; } } # vim:ts=4 sw=4 noet ?>