public function __sleep()
{
// This metadata is always serialized/cached.
$serialized = array('name', 'associationsMappings', 'fieldMappings', 'jsonNames', 'idGenerator', 'identifier', 'rootDocumentName');
if ($this->inInheritanceHierachy) {
$serialized[] = 'inInheritanceHierachy';
}
if ($this->parentClasses) {
$serialized[] = 'parentClasses';
}
if ($this->isVersioned) {
$serialized[] = 'isVersioned';
$serialized[] = 'versionField';
}
if ($this->customRepositoryClassName) {
$serialized[] = 'customRepositoryClassName';
}
if ($this->hasAttachments) {
$serialized[] = 'hasAttachments';
$serialized[] = 'attachmentField';
if ($this->attachmentDeclaredClass) {
$serialized[] = 'attachmentDeclaredClass';
}
}
if ($this->isReadOnly) {
$serialized[] = 'isReadOnly';
}
if ($this->isMappedSuperclass) {
$serialized[] = 'isMappedSuperclass';
}
if ($this->indexed) {
$serialized[] = 'indexed';
}
if ($this->indexes) {
$serialized[] = 'indexes';
}
return $serialized;
}