Example #1
0
 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();
         }
     }
 }