Class Details

Manages reading and writing to a database table.

This class manages a database table and is used by the Model class for reading and writing to its database table. There is one instance of Table for every table you have a model for.


Class Variables

public static object ActiveRecord\CallBack $callback

A instance of CallBack for this model/table

public mixed $class
public mixed $columns = array()
public mixed $conn
public mixed $db_name

Name of the database (optional)

public mixed $last_sql
public mixed $pk
public mixed $sequence

Name of the sequence for this table (optional). Defaults to {$table}_seq

public mixed $table

Name of the table.


Class Methods

public Table __construct ( $class_name )
  • $class_name -
public static void clear_cache ( [ $model_class_name = null] )
  • $model_class_name -
public void create_joins ( $joins )
  • $joins -
public void delete ( $data )
  • $data -
public void find ( $options )
  • $options -
public void find_by_sql ( $sql , [ $values = null] , [ $readonly = false] , [ $includes = null] )
  • $sql -
  • $values -
  • $readonly -
  • $includes -
public void get_column_by_inflected_name ( $inflected_name )
  • $inflected_name -
public void get_fully_qualified_table_name ( [ $quote_name = true] )
  • $quote_name -
public Relationship get_relationship ( $name $name , [ $strict $strict = false] )

Retrieve a relationship object for this table. Strict as true will throw an error if the relationship name does not exist.

  • $name $name - string name of Relationship
  • $strict $strict - bool
  • return: or null
  • throws: RelationshipException
public bool has_relationship ( $name $name )

Does a given relationship exist?

  • $name $name - string name of Relationship
public void insert ( &$data , [ $pk = null] , [ $sequence_name = null] )
  • &$data -
  • $pk -
  • $sequence_name -
public static void load ( $model_class_name )
  • $model_class_name -
public void options_to_sql ( $options )
  • $options -
public void reestablish_connection ( [ $close = true] )
  • $close -
public void update ( &$data , $where )
  • &$data -
  • $where -