public function toString()
{
/** @var BatchModifyOperation $operation */
$operation = $this->toOperation();
$ldif = $this->getCommonString();
$this->unicodePwdHack($operation);
/** @var Batch $batch */
foreach ($operation->getBatchCollection() as $batch) {
$ldif .= $this->getLdifLine($this->batchMap[$batch->getModType()], $batch->getAttribute());
// Nothing else to do in this case, as a reset directive is a delete with no attributes/values afterward.
if (!$batch->isTypeRemoveAll()) {
foreach ($batch->getValues() as $value) {
$ldif .= $this->getLdifLine($batch->getAttribute(), $value);
}
}
$ldif .= self::SEPARATOR . Ldif::ENTRY_SEPARATOR;
}
return $ldif;
}