Skip to content

Howto dynamic Or Where on same Attribute? #382

Answered by stevebauman
t0mcat1337 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @t0mcat1337,

Would this work for you?

use LdapRecord\Connection;

$conn = new Connection();

$query = $conn->query();

$input = ["UserID1","UserID2","UserID3"];

foreach ($input as $id) {
    $query->orWhere('uid', '=', $id);
}

// "(|(uid=UserID1)(uid=UserID2)(uid=UserID3))"
echo $query->getUnescapedQuery();

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by t0mcat1337
Comment options

You must be logged in to vote
1 reply
@stevebauman
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants