LdapTools\Ldif\Ldif::setVersion PHP Method

setVersion() public method

Set the LDIF version.
public setVersion ( integer $version )
$version integer
    public function setVersion($version)
    {
        $this->version = $version;
        return $this;
    }

Usage Example

Esempio n. 1
0
 /**
  * @param Ldif $ldif
  * @param int $version
  * @throws LdifParserException
  */
 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);
 }