src/Classes/AdldapFolders.php
public function create(array $attributes)
    {
        $folder = new Folder($attributes);

        $folder->validateRequired();

        $folder->setAttribute('container', array_reverse($folder->getAttribute('container')));

        $add = [];

        $add['objectClass'] = 'organizationalUnit';
        $add['OU'] = $folder->getAttribute('ou_name');

        $containers = 'OU='.implode(',OU=', $folder->getAttribute('container'));

        $dn = 'OU='.$add['OU'].', '.$containers.$this->adldap->getBaseDn();

        return $this->connection->add($dn, $add);
    }
public function create(array $attributes)
    {
        $folder = new Folder($attributes);

        $folder->validateRequired();

        $folder->setAttribute('container', array_reverse($folder->getAttribute('container')));

        $add = [];

        $add['objectClass'] = 'organizationalUnit';
        $add['OU'] = $folder->getAttribute('ou_name');

        $containers = 'OU='.implode(',OU=', $folder->getAttribute('container'));

        $dn = 'OU='.$add['OU'].', '.$containers.$this->adldap->getBaseDn();

        return $this->connection->add($dn, $add);
    }
public function create ( array $ attributes ) { $ folder = new Folder ( $ attributes ) ; $ folder -> validateRequired ( ) ; $ folder -> setAttribute ( 'container' , array_reverse ( $ folder -> getAttribute ( 'container' ) ) ) ; $ add = [ ] ; $ add [ 'objectClass' ] = 'organizationalUnit' ; $ add [ 'OU' ] = $ folder -> getAttribute ( 'ou_name' ) ; $ containers = 'OU=' . implode ( ',OU=' , $ folder -> getAttribute ( 'container' ) ) ; $ dn = 'OU=' . $ add [ 'OU' ] . ', ' . $ containers . $ this -> adldap -> getBaseDn ( ) ; return $ this -> connection -> add ( $ dn , $ add ) ; }
Create an organizational unit.

@param array $attributes Default attributes of the ou

@return bool|string
Create an organizational unit .