finder

  1. Orit

    XF 2.2 How to use the finder when joining tables?

    How should I use the XF finder with an sql query left joining 3 tables (I can join only 2 of them if it's simpler...)? I'm working on adding API endpoints to an existing add-on (I've already succeeded in doing it for another add-on) but have had a problem: I have 3 tables. One has events, the...
  2. E

    XF 2.2 Is there a way to use Union with the finder?

    I want to retrieve a list of threads using an Union in the query. Is there a way to translate this query to the finder? SELECT * FROM ( ( SELECT xt.* FROM xf_thread xt WHERE xt.node_id = 100 ORDER BY xt.last_post_date DESC LIMIT 20 ) union (...
  3. forumSolution

    XF 2.2 Or condition on finder

    Hey, I want to write a query on xenforo that will have both operator AND , OR . If i use $item->where() then it will use only AND .. but if use $item->where()->whereOr(). Then it will wrap all OR condition in AND . Is there anyway i can write something like that . Select * from zyx where...
  4. Improvs

    XF 2.1 Sql query (finder) assistance

    Hello. Is it possible to add extra select sql to xenforo Finder query? For example, I have XF finder query like this: $BuyerFinder = \XF::finder('MK\Store:Buyer') ->with('Thread', true) ->with('User', true) ->where('stage', 'active') ->fetch($limit, $offset); I need to improve...
  5. Zig

    XF 2.2 Fetching SUM(column) via the Finder

    Hello everyone, I'm wondering, is it possible to use the Finder to fetch the SUM() of a certain column? In my search for examples of SUM() in the core I've found only examples of raw SQL. I'd change course and go this route, but in this particular case I already have a Finder object with all...
  6. Kevin

    XF 2.1 Trying to use a custom thread field as the compare value in whereOr in finder... not supported, bug, feature request, or am I doing it wrong?

    I have two custom thread fields, cv_event_date_start and cv_event_date_end. In my finder I'm trying to include a whereOr clause to check if either the end date value is blank or if it is greater than the start date. When executing the code it looks like left side (the end date) of the whereOr...
  7. CMTV

    XF 2.1 Finder limit min value is 1

    Hi! AbstractAdapter class, line 560: public function limit($query, $amount, $offset = 0) { $offset = max(0, intval($offset)); if ($amount === null) { if (!$offset) { // no limit return $query; } // no amount limit, but...
Top Bottom