private function generateFieldMappingPropertyDocBlock(array $fieldMapping, ClassMetadataInfo $metadata)
{
$lines = array();
$lines[] = $this->spaces . '/**';
if (isset($fieldMapping['id']) && $fieldMapping['id']) {
$fieldMapping['strategy'] = isset($fieldMapping['strategy']) ? $fieldMapping['strategy'] : ClassMetadataInfo::GENERATOR_TYPE_AUTO;
if ($fieldMapping['strategy'] === ClassMetadataInfo::GENERATOR_TYPE_AUTO) {
$lines[] = $this->spaces . ' * @var MongoId $' . $fieldMapping['fieldName'];
} elseif ($fieldMapping['strategy'] === ClassMetadataInfo::GENERATOR_TYPE_INCREMENT) {
$lines[] = $this->spaces . ' * @var integer $' . $fieldMapping['fieldName'];
} elseif ($fieldMapping['strategy'] === ClassMetadataInfo::GENERATOR_TYPE_UUID) {
$lines[] = $this->spaces . ' * @var string $' . $fieldMapping['fieldName'];
} elseif ($fieldMapping['strategy'] === ClassMetadataInfo::GENERATOR_TYPE_NONE) {
$lines[] = $this->spaces . ' * @var $' . $fieldMapping['fieldName'];
} else {
$lines[] = $this->spaces . ' * @var $' . $fieldMapping['fieldName'];
}
} else {
$lines[] = $this->spaces . ' * @var ' . $fieldMapping['type'] . ' $' . $fieldMapping['fieldName'];
}
if ($this->generateAnnotations) {
$lines[] = $this->spaces . ' *';
$field = array();
if (isset($fieldMapping['id']) && $fieldMapping['id']) {
if (isset($fieldMapping['strategy'])) {
$field[] = 'strategy="' . $this->getIdGeneratorTypeString($metadata->generatorType) . '"';
}
$lines[] = $this->spaces . ' * @ODM\\Id(' . implode(', ', $field) . ')';
} else {
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 . ' * @ODM\\Field(' . implode(', ', $field) . ')';
}
if (isset($fieldMapping['version']) && $fieldMapping['version']) {
$lines[] = $this->spaces . ' * @ODM\\Version';
}
}
$lines[] = $this->spaces . ' */';
return implode("\n", $lines);
}