Formatting output Plese Wait...
OOPS data structures.
Detailed Description
This Module fullfills the necessity of Object Oriented approach to different Data Structure. Which can be used if required. such as Linked list, Tree, Vector. Map etc..
Function Documentation
ofPolymorphicType( mixed $var, mixed $className )
Checks wheather the Object is of given Polymorphic type or not. e.g. you can use it like ofPolymorphicType('zigController', 'zCore');
- Parameters:
-
| $var | the variable who's datatype you want to know. |
| $typeName | string datatype with Which you want to match/compare |
- Returns:
- boolean
Definition at line 34 of file type.php.
References typeId().
Referenced by zItem::setParent().
Show Source00034 {
00035 if($classType = get_class($var)){
00036 if($className == $classType)return true;
00037
00038 $parentClassList = array();
00039 $parentClassName = get_class($var);
00040 while($parentClassName = get_parent_class($parentClassName)){
00041 $parentClassList[] = strtolower($parentClassName);
00042 }
00043
00044 return in_array(strtolower($className), $parentClassList);
00045 }else{
00046 return (strtolower(typeId($var)) == strtolower($className));
00047 }
00048 }
Top
ofType( mixed $var, string $typeName )
Checks wheather the variable is of given datatype or not. e.g. you can use it like ofType("Hello World", "string")
- Parameters:
-
| $var | the variable who's datatype you want to know. |
| $typeName | datatype with Which you want to match/compare |
- Returns:
- boolean
Definition at line 24 of file type.php.
References typeId().
Referenced by zItem::setData(), and zItem::setNext().
Show Source00024 {
00025 return (strtolower(typeId($var)) == strtolower($typeName));
00026 }
Top