Hoa central
Join.php
Go to the documentation of this file.
1 <?php
2 
37 namespace Hoa\Database\Query;
38 
47 class Join
48 {
54  protected $_parent = null;
55 
61  protected $_from = null;
62 
63 
64 
72  public function __construct(Select $parent, Array &$from)
73  {
74  $this->_parent = $parent;
75  $this->_from = &$from;
76  end($this->_from);
77 
78  return;
79  }
80 
87  public function on($expression)
88  {
89  $this->_from[key($this->_from)] =
90  current($this->_from) .
91  ' ON ' . $expression;
92 
93  return $this->_parent;
94  }
95 
103  public function using($expression)
104  {
105  $this->_from[key($this->_from)] =
106  current($this->_from) .
107  ' USING (' .
108  implode(', ', func_get_args()) . ')';
109 
110  return $this->_parent;
111  }
112 }
on($expression)
Definition: Join.php:87
__construct(Select $parent, Array &$from)
Definition: Join.php:72