protected function setLdifVersion(Ldif $ldif, $version)
{
if ($version != '1') {
$this->throwException(sprintf('LDIF version "%s" is not currently supported.', $version));
} elseif (count($ldif->getEntries()) !== 0) {
$this->throwException('The LDIF version must be defined before any entries.');
}
$ldif->setVersion($version);
}