public function InviteType::save in Invite 7.4
Permanently saves the entity.
Overrides Entity::save
See also
File
- includes/
invite.controller.inc, line 283
Class
- InviteType
- Invite Type class.
Code
public function save() {
parent::save();
$controllers = array();
// Remove old controller entries.
db_delete('invite_sending_controller')
->condition('type', $this->type)
->execute();
// Add controllers.
foreach ($this->invite_sending_controller as $controller_name) {
$module = !empty($this->module) ? $this->module : '';
if (!in_array($controller_name, $controllers)) {
$controllers[] = $controller_name;
db_insert('invite_sending_controller')
->fields(array(
'type' => $this->type,
'module' => $module,
'name' => $controller_name,
))
->execute();
}
}
}