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

Class: MySQLView

Source Location: /databases/mysql/MySQLView.class.php

Class Overview

ABSTView
   |
   --MySQLView



Author(s):

Version:

  • 0.2.12

Copyright:

  • Copyright (C) 2005 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


Inherited Variables

Inherited Methods

Class: ABSTView

ABSTView::ABSTView()
Fake-Constructor
ABSTView::addCustomField()
This can be use to add a field to the definition of the result list of the query.
ABSTView::addJoin()
Adds a join's reference to this view's object.
ABSTView::getDatasetsWithFields()
Returns the datasets as an two dimensional array if the query could be execute. The first dimension carries the datasets. The second dimension carries the fields's values of the result list.
ABSTView::getLastQuery()
Returns the last stored database query.
ABSTView::getName()
Returns the name of this view.
ABSTView::getResourceID()
Returns the id of the connection resource to the database host.
ABSTView::setCustomFields()
Sets additionally fields to the definition of the result list of the query.
ABSTView::setErrorCallback()
Sets the name of the function that should be invoked on a connection error.
ABSTView::__constructor()
Constructor

Class Details

[line 56]


Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  0.2.12
copyright:  

Copyright (C) 2005 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

$fixed_where =  ""

[line 65]

Stores the condition on every query with this view. It is helpful to define inner joins in the where clause.



Tags:

access:  public

Type:   object


[ Top ]



Class Methods


constructor MySQLView [line 77]

MySQLView MySQLView( [ $name = ""], string $name*)

Constructor



Tags:

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


Parameters:

string   $name*  
   $name  

[ Top ]

method getArrayOfDataField [line 501]

array getArrayOfDataField( string $fieldname, [string $where = "1=1"])

Returns a array of values of a data field.



Tags:

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


Parameters:

string   $fieldname  
string   $where  

[ Top ]

method getCorrectWhere [line 107]

string getCorrectWhere( string $string)

Returns the correct where clause from given where concate the fixed where.



Tags:

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


Parameters:

string   $string  

[ Top ]

method getCount [line 787]

integer getCount( [string $where = "1=1"], [string $fieldname = "*"])

Returns the count of datasets.



Tags:

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


Parameters:

string   $where  
string   $fieldname  

[ Top ]

method getDatasets [line 305]

boolean|array getDatasets( [string $fields_or_where = "1=1"], [boolean $where_or_only_one = false], [string $array_kind = MYSQL_OUTPUT_DEFAULT], [boolean $only_one = false])

Returns the datasets as an array if the query could be execute.

Notice that the fieldnames will be output in the special form that the given alias of a table and the responsed fieldname are separated by an underscore, for example "alias_fieldname".




Tags:

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


Parameters:

string   $fields_or_where   The where clause of the query.
boolean   $where_or_only_one   Whether only one Dataset should be output.
string   $array_kind   The kind how the tuples should be output. MYSQL_OUTPUT_ASSOC - to get an associative array, with the fieldnames as indices. MYSQL_OUTPUT_NUM - to get an array, with numbers as indices in order of the $fieldnamesArr or of the underlying table. MYSQL_OUTPUT_DEFAULT - to get a mix of both output kinds.
boolean   $only_one   Whether only one Dataset should be output.

[ Top ]

method getDatasetsWithFields [line 548]

array getDatasetsWithFields( [array $field_arr = array()], [string $where = "1=1"], [boolean $only_one = false], [string $array_kind = MYSQL_OUTPUT_DEFAULT])

Returns the datasets as an two dimensional array if the query could be execute. The first dimension carries the datasets. The second dimension carries the fields's values of the result list.

Usage: getDatasetsWithFields( $fieldnamesArr, $where, $only_one );




Tags:

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


Overrides ABSTView::getDatasetsWithFields() (Returns the datasets as an two dimensional array if the query could be execute. The first dimension carries the datasets. The second dimension carries the fields's values of the result list.)

Parameters:

array   $field_arr   Is a blind parameter whithout any funktion.
string   $where   The where clause of the query.
boolean   $only_one  
string   $array_kind   The kind how the tuples should be output. MYSQL_OUTPUT_ASSOC - to get an associative array, with the fieldnames as indices. MYSQL_OUTPUT_NUM - to get an array, with numbers as indices in order of the $fieldnamesArr or of the underlying table. MYSQL_OUTPUT_DEFAULT - to get a mix of both output kinds.

[ Top ]

method getDatasetsWithPrimaryToMultiple [line 430]

array getDatasetsWithPrimaryToMultiple( array $primary_key, array $value_fields, [string $where = ""])

Returns the datasets as array with the values of the primary key as index.



Tags:

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


Parameters:

array   $primary_key   The fields that should be in the result list.
array   $value_fields   The fields with the values for the content.
string   $where   The where clause of the query.

[ Top ]

method getDatasetsWithPrimaryToValue [line 360]

array getDatasetsWithPrimaryToValue( array $primary_key, array $value_fields, [string $where = ""])

Returns the datasets as array with the values of the primary key as index.



Tags:

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


Parameters:

array   $primary_key   The fields that should be in the result list.
array   $value_fields   The fields with the values for the content.
string   $where   The where clause of the query.

[ Top ]

method getJoinOrder [line 161]

string getJoinOrder( &$field_arr, array $field_arr)

Returns the order to join the database tables in the query.



Tags:

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


Parameters:

array   $field_arr   In-out-parameter.
   &$field_arr  

[ Top ]

method getSingleDataFieldValue [line 729]

mixed getSingleDataFieldValue( string $fieldname, [string $where = "1=1"])

Returns a single value of a data field.



Tags:

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


Parameters:

string   $fieldname  
string   $where  

[ Top ]

method getSingleDataset [line 689]

array getSingleDataset( string $fields_or_where, [string $where = ""], [string $array_kind = MYSQL_OUTPUT_DEFAULT])

Returns a single dataset as an array if the query could be execute.

Notice that the fieldnames will be output in the special form that the given alias of a table and the responsed fieldname are separated by an underscore, for example "alias_fieldname".




Tags:

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


Parameters:

string   $fields_or_where  
string   $where  
string   $array_kind   The kind how the tuples should be output. MYSQL_OUTPUT_ASSOC - to get an associative array, with the fieldnames as indices. MYSQL_OUTPUT_NUM - to get an array, with numbers as indices in order of the $fieldnamesArr or of the underlying table. MYSQL_OUTPUT_DEFAULT - to get a mix of both output kinds.

[ Top ]

method getSumOf [line 753]

integer getSumOf( string $fieldname, [string $where = "1=1"], [string $additional_arithmetic = ""])

Returns the sum value of a field.



Tags:

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


Parameters:

string   $fieldname  
string   $where   The where-clause is optional.
string   $additional_arithmetic   Additional calculations to the sum.

[ Top ]

method setFixedWhere [line 92]

string setFixedWhere( string $string)

Sets the condition of first priority.



Tags:

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


Parameters:

string   $string  

[ Top ]


Documentation generated on Thu, 05 Jun 2008 19:14:29 +0200 by phpDocumentor 1.4.1