databases
[ class tree: databases ] [ index: databases ] [ all elements ]

Class: Join

Source Location: /databases/Join.class.php

Class Overview




Author(s):

Version:

  • 0.1.31

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

Variables

Methods



Class Details

[line 29]


Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  0.1.31
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

license:  GNU Lesser General Public License


[ Top ]


Class Variables

$alias_left =  ""

[line 69]

Carries an alias of the tablename of $this->dbt_left.



Tags:

access:  private

Type:   array


[ Top ]

$alias_right =  ""

[line 76]

Carries an alias of the tablename of $this->dbt_right.



Tags:

access:  public

Type:   array


[ Top ]

$dbt_left =  null

[line 37]

The left databasetable's object of this join.



Tags:

access:  public

Type:   object


[ Top ]

$dbt_right =  null

[line 44]

The right databasetable's object of this join.



Tags:

access:  public

Type:   object


[ Top ]

$left_field =  ""

[line 53]

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.




Tags:

access:  private

Type:   array


[ Top ]

$logical_operator = array()

[line 92]

Carries the logical operators between the relational statements in the "ON"-Clause of the join.



Tags:

access:  public

Type:   array


[ Top ]

$relational_operator = array()

[line 84]

Carries the relational operators between the fields in the "ON"-Clause of the join.



Tags:

access:  public

Type:   array


[ Top ]

$right_field =  ""

[line 62]

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.




Tags:

access:  private

Type:   array


[ Top ]

$type =  "LEFT"

[line 101]

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.



Tags:

access:  public

Type:   string


[ Top ]



Class Methods


constructor Join [line 120]

Join Join( &$dbt_left, &$dbt_right, mixed $left_field, mixed $right_field, [ $alias_left = "l"], [ $alias_right = "r"], [ $logical_operator = array()], [ $relational_operator = array()], object $dbt_left, object $dbt_right, string $alias_left*, string $alias_right*)

Constructor



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.2
since:  0.1.0
access:  public


Parameters:

object   $dbt_left  
object   $dbt_right  
mixed   $left_field   A fieldname of $dbt_left which should get a join or a condition for $right_field.
mixed   $right_field   A fieldname that should join to $left_field.
string   $alias_left*   An alias for the tablename of $dbt_left.
string   $alias_right*   An alias for the tablename of $dbt_right.
   &$dbt_left  
   &$dbt_right  
   $alias_left  
   $alias_right  
   $logical_operator  
   $relational_operator  

[ Top ]

method addFields [line 220]

void addFields( string $left_field, string $right_field)

Adds Fields to this join.



Tags:

author:  Daniel Plücken ( daniel@debakel.net )
version:  1.0
since:  0.1.1
access:  public


Parameters:

string   $left_field   A fieldname of $dbt_left which should get a join or a condition for $right_field.
string   $right_field   A fieldname that should join to $left_field.

[ Top ]

method setType [line 191]

void setType( $string, string $left_field, string $right_field)

Sets the type of join. Has to be INNER, CROSS, LEFT [OUTER], RIGHT [OUTER] or NATURAL [LEFT | RIGTH [OUTER]]



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.01
since:  0.1.3
access:  public


Parameters:

string   $left_field   A fieldname of $dbt_left which should get a join or a condition for $right_field.
string   $right_field   A fieldname that should join to $left_field.
   $string  

[ Top ]

method swapLeftRight [line 255]

void swapLeftRight( )

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.




Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.2
access:  public


[ Top ]


Documentation generated on Thu, 05 Jun 2008 19:13:41 +0200 by phpDocumentor 1.4.1