nur-sery/nur_src/ldap/io/LdapWriter.php

26 lines
502 B
PHP
Raw Normal View History

2024-04-04 22:21:20 +04:00
<?php
namespace nur\ldap\io;
use nur\b\io\IWriter;
use nur\ldap\LdapObject;
use nur\writer;
abstract class LdapWriter {
static function write_object($output, LdapObject $object, ?array $names=null): void {
$writer = new static($output);
$writer->write($object, $names);
$writer->close();
}
function __construct($output=null) {
$this->writer = writer::with($output);
}
/** @var IWriter */
protected $writer;
function close(): void {
$this->writer->close();
}
}