public function saveUsuarioRolList($con = null) { if (!$this->isValid()) { throw $this->getErrorSchema(); } if (!isset($this->widgetSchema['usuario_rol_list'])) { // somebody has unset this widget return; } if (is_null($con)) { $con = $this->getConnection(); } $c = new Criteria(); $c->add(UsuarioRolPeer::FK_ROL_ID, $this->object->getPrimaryKey()); UsuarioRolPeer::doDelete($c, $con); $values = $this->getValue('usuario_rol_list'); if (is_array($values)) { foreach ($values as $value) { $obj = new UsuarioRol(); $obj->setFkRolId($this->object->getPrimaryKey()); $obj->setFkUsuarioId($value); $obj->save(); } } }
public function delete(PropelPDO $con = null) { if ($this->isDeleted()) { throw new PropelException("This object has already been deleted."); } if ($con === null) { $con = Propel::getConnection(UsuarioRolPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); } $con->beginTransaction(); try { UsuarioRolPeer::doDelete($this, $con); $this->setDeleted(true); $con->commit(); } catch (PropelException $e) { $con->rollBack(); throw $e; } }