Checks whether the class will generate a new \MongoId instance for us.
public isIdGeneratorAuto ( ) : boolean | ||
return | boolean | TRUE if the class uses the AUTO generator, FALSE otherwise. |
/** * Returns an array of fields. Fields can be both column fields and * association fields. * * @param \Doctrine\ODM\MongoDB\Mapping\ClassMetadataInfo $metadata * * @return array */ private function getFieldsFromMetadata(ClassMetadataInfo $metadata) { $fields = (array) $metadata->getFieldNames(); // Remove the primary key field if it's not managed manually if ($metadata->isIdGeneratorAuto()) { $fields = array_diff($fields, array($metadata->identifier)); } return $fields; }