Doctrine\ODM\MongoDB\Mapping\Types\Type::getTypesMap PHP Method

getTypesMap() public static method

Get the types array map which holds all registered types and the corresponding type class
public static getTypesMap ( ) : array
return array $typesMap
    public static function getTypesMap()
    {
        return self::$typesMap;
    }

Usage Example

 private function generateDocumentStubMethod(ClassMetadataInfo $metadata, $type, $fieldName, $typeHint = null)
 {
     $methodName = $type . Inflector::classify($fieldName);
     if ($this->hasMethod($methodName, $metadata)) {
         return;
     }
     $var = sprintf('%sMethodTemplate', $type);
     $template = self::${$var};
     $variableType = $typeHint ? $typeHint . ' ' : null;
     $types = \Doctrine\ODM\MongoDB\Mapping\Types\Type::getTypesMap();
     $methodTypeHint = $typeHint && !isset($types[$typeHint]) ? '\\' . $typeHint . ' ' : null;
     $replacements = array('<description>' => ucfirst($type) . ' ' . $fieldName, '<methodTypeHint>' => $methodTypeHint, '<variableType>' => $variableType, '<variableName>' => Inflector::camelize($fieldName), '<methodName>' => $methodName, '<fieldName>' => $fieldName);
     $method = str_replace(array_keys($replacements), array_values($replacements), $template);
     return $this->prefixCodeWithSpaces($method);
 }