ClanCats / Hydrahon

🐉 Fast & standalone PHP MySQL Query Builder library.
https://clancats.io/hydrahon/master/
MIT License
278 stars 58 forks source link

WhereOr access in function #39

Closed eurairapelli closed 4 years ago

eurairapelli commented 4 years ago

Good night,

How i can get variable from function where. Example:

where(function($q) { $q->where('start','>=',$variable1)->orWhere('end','<=',$variable2); });

mario-deluna commented 4 years ago

Hello

Im not 100% sure I understand the question correctly.

but if you mean to get the variables into the where scope you can just use them.

->where(function($q) use($variable1, $variable2) {
    $q->where('start', '>=', $variable1)->orWhere('end','<=',$variable2);
});
mario-deluna commented 4 years ago

Im closing this Issue now. Let me know if the issue persists.

eurairapelli commented 3 years ago

Its works

Thanksssss