Advertisement
Guest User

Untitled

a guest
Nov 17th, 2017
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.33 KB | None | 0 0
  1. // Extend Plastic Builder to Support Nesting Queries
  2. \Sleimanx2\Plastic\DSL\SearchBuilder::macro('nest', function (\Closure $closure) {
  3.      $builder = new self($this->connection, new $this->query());
  4.  
  5.      $closure($builder);
  6.  
  7.      $query = $builder->query->getQueries();
  8.  
  9.      $this->append($query);
  10.  
  11.      return $this;
  12. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement