/**
* Given an array of values and the attribute to query, get the values as represent by the attribute to select.
*
* @param array $values
* @param string $toQuery
* @param string $toSelect
* @return array
*/
protected function getValuesForAttribute(array $values, $toQuery, $toSelect)
{
$query = new LdapQueryBuilder($this->getLdapConnection());
$or = $query->filter()->bOr();
foreach ($values as $value) {
$or->add($query->filter()->eq($toQuery, $value));
}
$query->select($toSelect)->where($or);
return $query->getLdapQuery()->getResult();
}