function ValidacionNuevoProducto($campo, $valor, &$fallo) { $oProducto = new producto(); if (!$campo) { return false; } switch ($campo) { case "CodigoBarras": if (!$campo or strlen($campo) < 3) { return false; } $oProducto->set("CodigoBarras", $valor, FORCE); $res = $oProducto->IntegridadCodigoBarrasClon(); if (!$res) { //$fallo = $oProducto->getFallo(); return false; } break; case "Nombre": if (!$campo or strlen($campo) < 3) { return false; } $oProducto->set("Nombre", $valor, FORCE); $res = $oProducto->IntegridadNombre(); if (!$res) { //$fallo = $oProducto->getFallo(); return false; } break; } return true; }