Cast Class Reference
[Lib]
Static Public Member Functions |
|
static | datetime ($string) |
Static. |
|
static | float ($val) |
Static. |
|
static | int ($val) |
Static. |
|
static | string ($value) |
Static. |
Detailed Description
Cast helper routines.
Definition at line 8 of file cast.cls.php.
Member Function Documentation
static Cast::datetime | ( | $ | string | ) | [static] |
Static.
Converts string retrieved from PHP to date
- Parameters:
-
String Anything that possible can be interpreted as a date
- Returns:
- date
Definition at line 36 of file cast.cls.php.
00036 { 00037 return GyroDate::datetime($string); 00038 }
static Cast::float | ( | $ | val | ) | [static] |
Static.
Forces the given param to be float.
- Parameters:
-
mixed The value to convert bool True, if languange specific seperators should be acknowledged
- Returns:
- Float
Definition at line 26 of file cast.cls.php.
static Cast::int | ( | $ | val | ) | [static] |
Static.
Forces the given param to be integer.
- Parameters:
-
mixes
- Returns:
- Integer
Definition at line 15 of file cast.cls.php.
static Cast::string | ( | $ | value | ) | [static] |
Static.
Converts given expression to string
Definition at line 43 of file cast.cls.php.
00043 { 00044 if (is_string($value)) { 00045 return $value; 00046 } 00047 if (is_array($value)) { 00048 return ''; 00049 } 00050 else if (is_object($value)) { 00051 if ($value->__toString) { 00052 return $value->__toString(); 00053 } 00054 else { 00055 return strval($value); 00056 } 00057 } 00058 return strval($value); 00059 }
The documentation for this class was generated from the following file:
- gyro/core/lib/helpers/cast.cls.php