Data Structures | |
class | zItem |
zItem Class Constructs a Node of a Linked List or a tree More... | |
class | zList |
Linked List Class. More... | |
class | zTree |
class | zVect |
Implementation of Vector by Using Linked List. More... | |
class | zVectIterator |
Functions | |
typeId ($var) | |
ofType ($var, $typeName) | |
ofPolymorphicType ($var, $className) |
ofPolymorphicType | ( | $ | var, | |
$ | className | |||
) |
Checks wheather the Object is of given Polymorphic type or not. e.g. you can use it like ofPolymorphicType('zigController', 'zCore');
$var | mixed the variable who's datatype you want to know. | |
$typeName | string datatype with Which you want to match/compare |
Definition at line 34 of file type.php.
References typeId().
Referenced by zItem::setParent().
00034 { 00035 if($classType = get_class($var)){ 00036 if($className == $classType)return true; 00037 //{ get Parent Class's List of $var 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 }
ofType | ( | $ | var, | |
$ | typeName | |||
) |
Checks wheather the variable is of given datatype or not. e.g. you can use it like ofType("Hello World", "string")
$var | mixed the variable who's datatype you want to know. | |
$typeName | string datatype with Which you want to match/compare |
Definition at line 24 of file type.php.
References typeId().
Referenced by zItem::setData(), and zItem::setNext().
00024 { 00025 return (strtolower(typeId($var)) == strtolower($typeName)); 00026 }
typeId | ( | $ | var | ) |
Returns the datatype of a Variable as a String.
$var | mixed the variable who's datatype you want to know. |
Definition at line 13 of file type.php.
Referenced by zItem::isDataValid(), ofPolymorphicType(), ofType(), zItem::setData(), zItem::setNext(), and zItem::setParent().
00013 { 00014 if($classType = get_class($var))return $classType; 00015 return gettype($var); 00016 }