/** * @return string Name of AbstractDataType in Php * * Ex : string, \DateTime */ public function getPhpTypeName() { if (true === $this->className->isGlobalNamespaceClass()) { return '\\' . $this->className->getName(); } return $this->className->getName(); }
protected function initializeProperty(ClassFileDefinition $file, PropertyDefinition $property) { $fqcn = new FullyQualifiedClassName('Doctrine\\Common\\Collections\\ArrayCollection'); $file->addUse($fqcn->getFullQualifiedClassName()); $arrayCollection = new ObjectValue($fqcn); $property->setDefaultValue($arrayCollection); $construct = $this->getConstructor($file); $construct->addLine(sprintf('$this->%s = %s;', $property->getName()->toLowerCamelCase(), $arrayCollection->getPhpFormatedValue())); }
/** * @param FullyQualifiedClassName $className * * @return $this */ public function addClassNameUse(FullyQualifiedClassName $className) { if ($this->fullyQualifiedClassName->getNamespace() !== $className->getNamespace()) { $this->addUse($className->getFullQualifiedClassName()); } return $this; }