Class Xyster_Db_Translator

Description

Translates objects in the Xyster_Data package into SQL fragments

  • copyright: Copyright (c) 2007-2008 Irrational Logic (http://irrationallogic.net)
  • license: New BSD License

Located in /Db/Translator.php (line 28)


	
			
Direct descendents
Class Description
Xyster_Orm_Mapper_Translator A translator for db fields that is smart about ORM
Variable Summary
Zend_Db_Adapter_Abstract $_adapter
mixed $_table
Method Summary
Xyster_Db_Translator __construct ( $adapter)
Xyster_Db_Translator setTable (string $table)
Xyster_Db_Token translate ( $object, [boolean $quote = true])
Xyster_Db_Token translateClause ( $clause, [boolean $quote = true])
Xyster_Db_Token translateCriterion ( $tosql, [boolean $quote = true])
Xyster_Db_Token translateExpression ( $tosql, [boolean $quote = true])
Xyster_Db_Token translateField ( $tosql, [boolean $quote = true])
Xyster_Db_Token translateJunction ( $tosql, [boolean $quote = true])
Xyster_Db_Token translateSort ( $tosql, [boolean $quote = true])
string _getRenamedField ( $field)
string _getTableName ( $field)
Variables
Zend_Db_Adapter_Abstract $_adapter (line 33)
  • access: protected
mixed $_renameCallback (line 40)

The callback for column renaming

  • access: protected
mixed $_table (line 47)

A table name to prefix columns

  • access: protected
Methods
Constructor __construct (line 54)

Creates a new translator for a given SQL connection

  • access: public
Xyster_Db_Translator __construct ( $adapter)
  • Zend_Db_Adapter_Abstract $adapter

Redefined in descendants as:
setRenameCallback (line 67)

Sets the callback for column renaming

This can be any valid PHP callback. It's passed the column object.

  • return: Provides a fluent interface
  • access: public
Xyster_Db_Translator setRenameCallback (mixed $callback)
  • mixed $callback
setTable (line 83)

Sets a table name to prefix to columns

  • return: Provides a fluent interface
  • access: public
Xyster_Db_Translator setTable (string $table)
  • string $table
translate (line 96)

Translates one of the Xyster Data objects into a SQL token

  • access: public
Xyster_Db_Token translate ( $object, [boolean $quote = true])
translateClause (line 116)

Translates a clause

  • access: public
Xyster_Db_Token translateClause ( $clause, [boolean $quote = true])
translateCriterion (line 176)

Converts a criterion to SQL

  • return: The translated SQL syntax
  • access: public
Xyster_Db_Token translateCriterion ( $tosql, [boolean $quote = true])
translateExpression (line 217)

Converts an expression to SQL

  • return: The translated SQL syntax
  • access: public
Xyster_Db_Token translateExpression ( $tosql, [boolean $quote = true])
translateField (line 141)

Converts a field to SQL

  • return: The translated SQL syntax
  • access: public
Xyster_Db_Token translateField ( $tosql, [boolean $quote = true])
  • Xyster_Data_Field $tosql: The field to translate
  • boolean $quote: Whether to quote field names
translateJunction (line 194)

Converts a Junction to SQL

  • return: The translated SQL syntax
  • access: public
Xyster_Db_Token translateJunction ( $tosql, [boolean $quote = true])
  • Xyster_Data_Junction $tosql: The Junction to translate
  • boolean $quote: Whether to quote field names
translateSort (line 162)

Converts a sort to SQL

  • return: The translated SQL syntax
  • access: public
Xyster_Db_Token translateSort ( $tosql, [boolean $quote = true])
  • Xyster_Data_Sort $tosql: The Sort to translate
  • boolean $quote: Whether to quote field names
_getRenamedField (line 287)

Gets the renamed value of the field if appropriate

This can be overridden to provide a custom renaming strategy

  • access: protected
string _getRenamedField ( $field)

Redefined in descendants as:
_getTableName (line 304)

Gets the name of the table to use to prefix columns

This can be extended to provide a custom table name

  • access: protected
string _getTableName ( $field)

Redefined in descendants as:

Documentation generated on Mon, 19 May 2008 17:07:40 -0400 by phpDocumentor 1.4.2