/** * Converts the inserted string boolean to a PHP boolean. * * @param string $bool * * @return null|bool */ protected function convertStringToBool($bool) { $bool = strtoupper($bool); if ($bool === strtoupper($this->schema->false())) { return false; } elseif ($bool === strtoupper($this->schema->true())) { return true; } else { return; } }
/** * Finds a record by its Object SID. * * @param string $sid * @param array|string $columns * * @return bool|Entry */ public function findBySid($sid, $columns = []) { return $this->findBy($this->schema->objectSid(), $sid, $columns); }
/** * {@inheritdoc} */ public function getRootDse() { return $this->search()->setDn(null)->read(true)->whereHas($this->schema->objectClass())->first(); }
/** * 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(); }
/** * Returns the object category model class mapping. * * @return array */ protected function map() { return [$this->schema->objectCategoryComputer() => 'Adldap\\Models\\Computer', $this->schema->objectCategoryPerson() => 'Adldap\\Models\\User', $this->schema->objectCategoryGroup() => 'Adldap\\Models\\Group', $this->schema->objectCategoryExchangeServer() => 'Adldap\\Models\\ExchangeServer', $this->schema->objectCategoryContainer() => 'Adldap\\Models\\Container', $this->schema->objectCategoryPrinter() => 'Adldap\\Models\\Printer', $this->schema->objectCategoryOrganizationalUnit() => 'Adldap\\Models\\OrganizationalUnit']; }
/** * Creates a new computer instance. * * @param array $attributes * * @return Computer */ public function computer(array $attributes = []) { return (new Computer($attributes, $this->query))->setAttribute($this->schema->objectClass(), [$this->schema->top(), $this->schema->person(), $this->schema->organizationalPerson(), $this->schema->user(), $this->schema->computer()]); }
/** * Returns the object category model class mapping. * * @return array */ public function map() { return [$this->schema->objectClassComputer() => \Adldap\Models\Computer::class, $this->schema->objectClassContact() => \Adldap\Models\Contact::class, $this->schema->objectClassPerson() => \Adldap\Models\User::class, $this->schema->objectClassGroup() => \Adldap\Models\Group::class, $this->schema->objectClassContainer() => \Adldap\Models\Container::class, $this->schema->objectClassPrinter() => \Adldap\Models\Printer::class, $this->schema->objectClassOu() => \Adldap\Models\OrganizationalUnit::class]; }