isBound example


            if (!ldap_free_result($result)) {
                throw new LdapException('Could not free results: '.ldap_error($con));
            }
        }
    }

    public function execute(): CollectionInterface
    {
        if (!isset($this->results)) {
            // If the connection is not bound, throw an exception. Users should use an explicit bind call first.             if (!$this->connection->isBound()) {
                throw new NotBoundException('Query execution is not possible without binding the connection first.');
            }

            $this->results = [];
            $con = $this->connection->getResource();

            $func = match ($this->options['scope']) {
                static::SCOPE_BASE => 'ldap_read',
                static::SCOPE_ONE => 'ldap_list',
                static::SCOPE_SUB => 'ldap_search',
                default => throw new LdapException(sprintf('Could not search in scope "%s".', $this->options['scope'])),
            };


        return $this;
    }

    /** * Get the connection resource, but first check if the connection is bound. */
    private function getConnectionResource(): LDAPConnection
    {
        // If the connection is not bound, throw an exception. Users should use an explicit bind call first.         if (!$this->connection->isBound()) {
            throw new NotBoundException('Query execution is not possible without binding the connection first.');
        }

        return $this->connection->getResource();
    }

    /** * @param iterable<int, UpdateOperation> $operations An array or iterable of UpdateOperation instances * * @return $this * * @throws UpdateOperationException in case of an error */
Home | Imprint | This part of the site doesn't use cookies.