Source for file Join.class.php
Documentation is available at Join.class.php
* @author Daniel Plücken <daniel@debakel.net>
* @license http://www.gnu.org/copyleft/lesser.html
* GNU Lesser General Public License
* @copyright Copyright (C) 2004 Daniel Plücken <daniel@debakel.net>
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
* The left databasetable's object of this join.
* The right databasetable's object of this join.
* Carries the left fieldnames of this join.
* Note that fieldnames in a join could also be values. It isn't necessary to
* join one fieldname to another.
* Carries the right fieldnames of this join.
* Note that fieldnames in a join could also be values. It isn't necessary to
* join one fieldname to another.
* @var array $right_field
* Carries an alias of the tablename of $this->dbt_left.
* Carries an alias of the tablename of $this->dbt_right.
* @var array $alias_right
* Carries the relational operators between the fields in the "ON"-Clause of
* @var array $join_operator
* Carries the logical operators between the relational statements in the
* "ON"-Clause of the join.
* @var array $join_operator
* Carries the type of join. Can be INNER, CROSS, LEFT [OUTER], RIGHT [OUTER]
* or NATURAL [LEFT | RIGTH [OUTER]]. The Standard is LEFT, because it was the
* only used join in the past.
* @author Daniel Plücken <daniel@debakel.net>
* @param object $dbt_left
* @param object $dbt_right
* @param mixed $left_field A fieldname of $dbt_left which should get
* a join or a condition for $right_field.
* @param mixed $right_field A fieldname that should join to $left_field.
* @param string $alias_left* An alias for the tablename of $dbt_left.
* @param string $alias_right* An alias for the tablename of $dbt_right.
$left_field, $right_field,
$alias_left = "l", $alias_right = "r",
$logical_operator = array(),
$relational_operator = array()
is_a( $dbt_left, "ABSTDatabaseTable" )
"<h3>The parameter dbt_left does not "
. "refer to a valid database's object!</h3>"
is_a( $dbt_right, "ABSTDatabaseTable" )
"<h3>The parameter dbt_right does not "
. "refer to a valid database's object!</h3>"
* Sets the type of join. Has to be INNER, CROSS, LEFT [OUTER], RIGHT [OUTER]
* or NATURAL [LEFT | RIGTH [OUTER]]
* @author Daniel Plücken <daniel@debakel.net>
* @param string $left_field A fieldname of $dbt_left which should get a
* join or a condition for $right_field.
* @param string $right_field A fieldname that should join to $left_field.
. "(?:LEFT|RIGHT)(?:\s+OUTER)?"
. "|NATURAL(?:\s+(?:LEFT|RIGHT)(?:\s+OUTER)?)?"
* Adds Fields to this join.
* @author Daniel Plücken ( daniel@debakel.net )
* @param string $left_field A fieldname of $dbt_left which should get a
* join or a condition for $right_field.
* @param string $right_field A fieldname that should join to $left_field.
if( count( $param ) % 2 == 1 )
for( $i = 0; $i < count( $param ); $i++ )
* Swaps the left-right definition. The reference from the left table moves
* to the reference of the right database table and the other way around.
* This is useful for some complications with the join generation.
* @author Daniel Plücken <daniel@debakel.net>
|