setDn() public method

Sets the DN to perform searches upon.
public setDn ( string | null $dn = null ) : Builder
$dn string | null
return Builder
Esempio n. 1
0
 /**
  * Returns a new query builder instance.
  *
  * @param string $baseDn
  *
  * @return Builder
  */
 public function newQueryBuilder($baseDn = '')
 {
     // Create a new Builder.
     $builder = new Builder($this->connection, $this->newGrammar());
     // Set the Base DN on the Builder.
     $builder->setDn($baseDn);
     // Return the new Builder instance.
     return $builder;
 }
Esempio n. 2
0
 /**
  * Returns a new query builder instance.
  *
  * @return Builder
  */
 public function newQueryBuilder()
 {
     // Create a new Builder.
     $builder = new Builder($this->getAdldap()->getConnection(), $this->newGrammar());
     // Get the configuration Base DN.
     $baseDn = $this->getAdldap()->getConfiguration()->getBaseDn();
     // Set the Base DN on the Builder.
     $builder->setDn($baseDn);
     // Return the new Builder instance.
     return $builder;
 }
Esempio n. 3
0
 /**
  * Get the RootDSE properties from a domain controller.
  *
  * @return AbstractModel|bool
  */
 protected function getRootDse()
 {
     return $this->query->setDn(null)->read(true)->whereHas($this->schema->objectClass())->first();
 }