private function getType(Property $property)
{
$type = NULL;
if ($property->isBasicType()) {
$type = $property->getType();
if ($type == 'string') {
if (!$property->hasCustomFlag('size')) {
$type = 'text';
}
}
/* if ($property->containsEnumeration()) {
$type = 'enum';
} */
} else {
// Objects
$class = new ReflectionClass($property->getType());
$class = $class->newInstance();
if ($class instanceof DateTime) {
if ($property->hasCustomFlag('format')) {
$type = $property->getCustomFlagValue('format');
} else {
$type = 'datetime';
}
}
}
return $type;
}