private function generateFieldMappingPropertyDocBlock(array $fieldMapping, ClassMetadataInfo $metadata)
{
$lines = array();
$lines[] = $this->spaces . '/**';
$lines[] = $this->spaces . ' * @var ' . $fieldMapping['type'] . ' $' . $fieldMapping['fieldName'];
if ($this->generateAnnotations) {
$lines[] = $this->spaces . ' *';
if (isset($fieldMapping['id']) && $fieldMapping['id']) {
$lines[] = $this->spaces . ' * @OXM\\XmlId';
if ($generatorType = $this->getIdGeneratorTypeString($metadata->generatorType)) {
$lines[] = $this->spaces . ' * @OXM\\XmlGeneratedValue(strategy="' . $generatorType . '")';
}
}
if (isset($fieldMapping['references'])) {
$lines[] = $this->spaces . ' * @OXM\\XmlReferences(entityName="' . $fieldMapping['references'] . '")';
}
$field = array();
if (isset($fieldMapping['name'])) {
$field[] = 'name="' . $fieldMapping['name'] . '"';
}
if (isset($fieldMapping['type'])) {
$field[] = 'type="' . $fieldMapping['type'] . '"';
}
if (isset($fieldMapping['nullable']) && $fieldMapping['nullable'] === true) {
$field[] = 'nullable=' . var_export($fieldMapping['nullable'], true);
}
if (isset($fieldMapping['options'])) {
$options = array();
foreach ($fieldMapping['options'] as $key => $value) {
$options[] = '"' . $key . '" = "' . $value . '"';
}
$field[] = "options={" . implode(', ', $options) . "}";
}
$lines[] = $this->spaces . ' * @OXM\\XmlField(' . implode(', ', $field) . ')';
// if (isset($fieldMapping['version']) && $fieldMapping['version']) {
// $lines[] = $this->spaces . ' * @OXM\\Version';
// }
}
$lines[] = $this->spaces . ' */';
return implode("\n", $lines);
}