* @author Falko Menge */ abstract class ezcReflectionAbstractType implements ezcReflectionType { /** * @var string */ protected $typeName = null; /** * @param string $typeName */ public function __construct( $typeName ) { $this->typeName = ezcReflectionTypeMapper::getInstance()->getTypeName( $typeName ); } /** * @return string */ public function getTypeName() { return $this->typeName; } /** * @return boolean */ public function isArray() { return false; } /** * @return boolean */ public function isObject() { return false; } /** * @return boolean */ public function isPrimitive() { return false; } /** * @return boolean */ public function isMap() { return false; } /** * Returns whether this type is one of integer, float, string, or boolean. * * Types array, object, resource, NULL, mixed, number, and callback are not * scalar. * * @return boolean */ function isScalarType() { return false; } /** * Returns name of the correspondent XML Schema datatype * * The prefix `xsd' is comonly used to refer to the * XML Schema namespace. * * @param boolean $usePrefix augments common prefix `xsd:' to the name * @return string */ function getXmlName($usePrefix = true) { if ($usePrefix) { $prefix = 'xsd:'; } else { $prefix = ''; } return $prefix . ezcReflectionTypeMapper::getInstance()->getXmlType( $this->getTypeName() ); } /** * @param DOMDocument $dom * @return DOMElement */ function getXmlSchema(DOMDocument $dom) { return null; } /** * Returns a string representation. * * @return String Type name */ public function __toString() { return $this->getTypeName(); } }