public function saveRolePermissionBackupList($con = null) { if (!$this->isValid()) { throw $this->getErrorSchema(); } if (!isset($this->widgetSchema['role_permission_backup_list'])) { // somebody has unset this widget return; } if (is_null($con)) { $con = $this->getConnection(); } $c = new Criteria(); $c->add(RolePermissionBackupPeer::ROLE_ID, $this->object->getPrimaryKey()); RolePermissionBackupPeer::doDelete($c, $con); $values = $this->getValue('role_permission_backup_list'); if (is_array($values)) { foreach ($values as $value) { $obj = new RolePermissionBackup(); $obj->setRoleId($this->object->getPrimaryKey()); $obj->setPermissionId($value); $obj->save(); } } }