1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Implemented Fetch Conditions

Discussion in 'Closed Suggestions' started by xf_phantom, Apr 19, 2013.

  1. xf_phantom

    xf_phantom Well-Known Member

    They're nice BUT very limited:(

    There's a need to be able to use the same criteria 2 times
    e.g.
    i'm not able to do something like without the need to use a xfcp class adding e.g.
    PHP:
    if (!empty($conditions['last_post_date2']) && is_array($conditions['last_post_date2']))
    , own method or add another (own) condition
    Code:
    WHERE thread.last_post_date>= " . $foo
              AND thread.last_post_date<= " . $foo2
    

    if this would be possible, lazy coders wouldn't need to create own methods and own queries for the getXXXByIdRange methods;)
     
  2. Mike

    Mike XenForo Developer Staff Member

    1.2 has a helper to handle both single- and double-ended limits:
    Code:
    if (!empty($conditions['last_post_date']) && is_array($conditions['last_post_date']))
    {
    $sqlConditions[] = $this->getCutOffCondition("thread.last_post_date", $conditions['last_post_date']);
    }
    The operator is ">=<" with 2 additional values for the lower and upper bound.
     
    xf_phantom likes this.
  3. xf_phantom

    xf_phantom Well-Known Member

    Great news! Then it's probably time for vacation till 1.2 comes out:D
     
  4. xf_phantom

    xf_phantom Well-Known Member

    Will negations also be possible?:sneaky:
     

Share This Page