public function searchAll($filter, array $attributes = [])
	{
		$ldap = $this->getResource();

		// $ds is a valid link identifier (see ldap_connect)
		ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);

		$cookie = '';
		$result = [];
		do {
			ldap_control_paged_result($ldap, self::PAGE_SIZE, true, $cookie);

			Stdlib\ErrorHandler::start(E_WARNING);
			$search = ldap_search($ldap, $this->getBaseDn(), $filter, $attributes);
			Stdlib\ErrorHandler::stop();

			if ($search === false) {
				throw new Lp\Exception\LdapException($this, 'searching: ' . $filter);
			}

			$entries = $this->createCollection(new Lp\Collection\DefaultIterator($this, $search), null);
			foreach ( $entries as $es ) {
				$result[] = $es;
			}

			ldap_control_paged_result_response($ldap, $search, $cookie);
		} while ($cookie !== null && $cookie != '');

		return $result;
	}