b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (CVS HEAD) [ class tree: evocore ] [ index: evocore ] [ all elements ]

Class: SQL

Source Location: /blogs/inc/_core/model/db/_sql.class.php

Class SQL

Class Overview

SQL class: help constructing queries

Located in /blogs/inc/_core/model/db/_sql.class.php [line 40]



		
				Author(s):
		
Information Tags:
Todo:  dh> should provide quoting, e.g. via $DB->quote().. Maybe using printf-style, where all args get quoted.
Todo:  (fplanque)

Properties

Methods

[ Top ]
Direct descendents
Child Class Description
ItemQuery ItemQuery: help constructing queries on Items

[ Top ]
Property Summary
mixed   $from  
mixed   $group_by  
mixed   $limit  
mixed   $order_by  
mixed   $search_field  
mixed   $search_field_regexp  
mixed   $select  
mixed   $title  
mixed   $where  

[ Top ]
Method Summary
SQL   SQL()   Constructor.
void   add_search_field()   create array of search fields
void   display()   Get whole query
void   FROM()  
void   FROM_add()   Extends the FROM clause.
void   get()   Get whole query
void   get_from()   Get FROM clause if there is something inside
void   get_group_by()   Get GROUP BY clause if there is something inside
void   get_limit()   Get LIMIT clause if there is something inside
void   get_order_by()   Get ORDER BY clause if there is something inside
void   get_select()   Get SELECT clause if there is something inside
void   get_where()   Get WHERE clause if there is something inside
void   GROUP_BY()  
void   LIMIT()  
void   ORDER_BY()  
void   ORDER_BY_prepend()  
void   SELECT()   Set SELECT clause
void   SELECT_add()   Extends the SELECT clause.
void   WHERE()  
void   WHERE_and()   Extends the WHERE clause with AND
void   WHERE_keywords()   create the filter whith the search field array
void   WHERE_or()   Extends the WHERE clause with OR
void   WHERE_regexp()   create the filter whith the search field regexp array

[ Top ]
Properties
mixed   $from = '' [line 43]

[ Top ]
mixed   $group_by = '' [line 45]

[ Top ]
mixed   $limit = '' [line 47]

[ Top ]
mixed   $order_by = '' [line 46]

[ Top ]
mixed   $search_field = array() [line 48]

[ Top ]
mixed   $search_field_regexp = array() [line 49]

[ Top ]
mixed   $select = '' [line 42]

[ Top ]
mixed   $title [line 50]

Redefined in descendants as:

[ Top ]
mixed   $where = '' [line 44]

[ Top ]
Methods
Constructor SQL  [line 56]

  SQL SQL( [ $title = NULL]  )

Constructor.

Parameters:
   $title: 


[ Top ]
add_search_field  [line 309]

  void add_search_field( string $field, [string $reg_exp = '']  )

create array of search fields

Parameters:
string   $field:  field to search on
string   $reg_exp:  regular expression we want to use on the search for the field param


[ Top ]
display  [line 82]

  void display( )

Get whole query



[ Top ]
FROM  [line 202]

  void FROM( $from  )

Parameters:
   $from: 


[ Top ]
FROM_add  [line 212]

  void FROM_add( string $from_add  )

Extends the FROM clause.

Parameters:
string   $from_add:  should typically start with INNER JOIN or LEFT JOIN


[ Top ]
get  [line 66]

  void get( )

Get whole query



[ Top ]
get_from  [line 110]

  void get_from( [ $prefix = ' FROM ']  )

Get FROM clause if there is something inside

Parameters:
   $prefix: 


[ Top ]
get_group_by  [line 138]

  void get_group_by( [ $prefix = ' GROUP BY ']  )

Get GROUP BY clause if there is something inside

Parameters:
   $prefix: 


[ Top ]
get_limit  [line 166]

  void get_limit( [ $prefix = ' LIMIT ']  )

Get LIMIT clause if there is something inside

Parameters:
   $prefix: 


[ Top ]
get_order_by  [line 152]

  void get_order_by( [ $prefix = ' ORDER BY ']  )

Get ORDER BY clause if there is something inside

Parameters:
   $prefix: 


[ Top ]
get_select  [line 96]

  void get_select( [ $prefix = ' SELECT ']  )

Get SELECT clause if there is something inside

Parameters:
   $prefix: 


[ Top ]
get_where  [line 124]

  void get_where( [ $prefix = ' WHERE ']  )

Get WHERE clause if there is something inside

Parameters:
   $prefix: 


[ Top ]
GROUP_BY  [line 271]

  void GROUP_BY( $group_by  )

Parameters:
   $group_by: 


[ Top ]
LIMIT  [line 298]

  void LIMIT( $limit  )

Parameters:
   $limit: 


[ Top ]
ORDER_BY  [line 276]

  void ORDER_BY( $order_by  )

Parameters:
   $order_by: 


[ Top ]
ORDER_BY_prepend  [line 281]

  void ORDER_BY_prepend( $order_by_prepend  )

Parameters:
   $order_by_prepend: 


[ Top ]
SELECT  [line 180]

  void SELECT( $select  )

Set SELECT clause

Parameters:
   $select: 


[ Top ]
SELECT_add  [line 191]

  void SELECT_add( srting $select_add  )

Extends the SELECT clause.

Parameters:
srting   $select_add:  should typically start with a comma ','


[ Top ]
WHERE  [line 223]

  void WHERE( $where  )

Parameters:
   $where: 


[ Top ]
WHERE_and  [line 232]

  void WHERE_and( string $where_and  )

Extends the WHERE clause with AND

Parameters:
string   $where_and: 


[ Top ]
WHERE_keywords  [line 325]

  void WHERE_keywords( string $search, string $search_kw_combine  )

create the filter whith the search field array

Parameters:
string   $search:  keywords separated by space
string   $search_kw_combine:  operator( AND , OR , PHRASE ) for the filter


[ Top ]
WHERE_or  [line 255]

  void WHERE_or( string $where_or  )

Extends the WHERE clause with OR

NOTE: there is almost NEVER a good reason to use this! Think again!

Parameters:
string   $where_or: 


[ Top ]
WHERE_regexp  [line 380]

  void WHERE_regexp( string $search, string $search_kw_combine  )

create the filter whith the search field regexp array

Parameters:
string   $search:  search
string   $search_kw_combine:  operator( AND , OR , PHRASE ) for the filter


[ Top ]

Documentation generated on Sat, 06 Mar 2010 04:23:48 +0100 by phpDocumentor 1.4.2. This site is hosted and maintained by Daniel HAHLER (Contact).