public function getEntityColumnType($entity, $property) {
        $classRef = new \ReflectionClass($entity);
        if ($classRef->hasProperty($property)) {
            $propertyRef = $classRef->getProperty($property);
            $columnRef = $this->annoReader->getPropertyAnnotation($propertyRef, 'Doctrine\ORM\Mapping\Column');
        } else {
            /** Can not find the property on the class. Check the all the Column annotation */
            foreach ($classRef->getProperties() as $propertyRef) {
                $columnRef = $this->annoReader->getPropertyAnnotation($propertyRef, 'Doctrine\ORM\Mapping\Column');
                if ($columnRef->name == $property) {
                    break;
                } else {
                    $columnRef = null;
                }
            }
        }
        if ($columnRef === null) {
            $idRef = $this->annoReader->getPropertyAnnotation($propertyRef, 'Doctrine\ORM\Mapping\Id');
            if ($idRef !== null) {
                return "int";
            } else {
                return "string";
            }
        } else {
            return $this->getColumnType($columnRef->type);
        }
    }
public function getEntityColumnType($entity, $property) {
        $classRef = new \ReflectionClass($entity);
        if ($classRef->hasProperty($property)) {
            $propertyRef = $classRef->getProperty($property);
            $columnRef = $this->annoReader->getPropertyAnnotation($propertyRef, 'Doctrine\ORM\Mapping\Column');
        } else {
            /** Can not find the property on the class. Check the all the Column annotation */
            foreach ($classRef->getProperties() as $propertyRef) {
                $columnRef = $this->annoReader->getPropertyAnnotation($propertyRef, 'Doctrine\ORM\Mapping\Column');
                if ($columnRef->name == $property) {
                    break;
                } else {
                    $columnRef = null;
                }
            }
        }
        if ($columnRef === null) {
            $idRef = $this->annoReader->getPropertyAnnotation($propertyRef, 'Doctrine\ORM\Mapping\Id');
            if ($idRef !== null) {
                return "int";
            } else {
                return "string";
            }
        } else {
            return $this->getColumnType($columnRef->type);
        }
    }
public function getEntityColumnType ( $ entity , $ property ) { $ classRef = new \ ReflectionClass ( $ entity ) ; if ( $ classRef -> hasProperty ( $ property ) ) { $ propertyRef = $ classRef -> getProperty ( $ property ) ; $ columnRef = $ this -> annoReader -> getPropertyAnnotation ( $ propertyRef , 'Doctrine\ORM\Mapping\Column' ) ; } else { /** Can not find the property on the class. Check the all the Column annotation */ foreach ( $ classRef -> getProperties ( ) as $ propertyRef ) { $ columnRef = $ this -> annoReader -> getPropertyAnnotation ( $ propertyRef , 'Doctrine\ORM\Mapping\Column' ) ; if ( $ columnRef -> name == $ property ) { break ; } else { $ columnRef = null ; } } } if ( $ columnRef === null ) { $ idRef = $ this -> annoReader -> getPropertyAnnotation ( $ propertyRef , 'Doctrine\ORM\Mapping\Id' ) ; if ( $ idRef !== null ) { return "int" ; } else { return "string" ; } } else { return $ this -> getColumnType ( $ columnRef -> type ) ; } }
Get Column Type of a model.

@param $entity string Class name of the entity
@param $property string
@return string
Get Column Type of a model .