According to my comment above, this line maybe should be:
$this->ldap->controlPagedResult($link_resource, 999999, false, "");