ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilTypeCheck Class Reference

Type checking functions. More...

+ Collaboration diagram for ilTypeCheck:

Public Member Functions

 check ($a_type, $a_value, $a_required=false, $a_min="", $a_max="")
 Check input.

Detailed Description

Type checking functions.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 31 of file class.ilTypeCheck.php.

Member Function Documentation

ilTypeCheck::check (   $a_type,
  $a_value,
  $a_required = false,
  $a_min = "",
  $a_max = "" 
)

Check input.

Parameters
stringtype
mixedvalue
booleanrequired

Definition at line 40 of file class.ilTypeCheck.php.

References $lng, and $ok.

Referenced by ilHtmlBlockGUIGen\checkInputHtmlBlock().

{
global $lng;
$ok = true;
switch ($a_type)
{
case "varchar":
case "text":
if ($a_required && $a_value == "")
{
$err = $lng->txt("msg_input_is_required");
}
break;
case "int":
break;
case "datetime":
if ($a_required && $a_value == "")
{
$err = $lng->txt("msg_input_is_required");
}
break;
case "boolean":
case "enum":
break;
default:
die ("ERROR: ilTypeCheck::check: Type '".$a_type."' unknown.");
break;
}
if ($err != "")
{
$ok = false;
}
return array("ok" => $ok, "error" => $err);
}

+ Here is the caller graph for this function:


The documentation for this class was generated from the following file: