Class dbfield

Description

Class describing a database field of a table.

Located in /schema-defs.php (line 571)

SchemaObject
   |
   --dbfield
Direct descendents
Class Description
 class DB_dbfield Class describing a database field of a Postgres table.
Variable Summary
 mixed $constraints
 mixed $defaultval
 mixed $ispkey
 mixed $notnull
 mixed $num
 mixed $type
Method Summary
 dbfield dbfield (mixed &$schema, mixed $name, mixed $num, mixed $type, [mixed $defaultval = ""], [mixed $notnull = false], [mixed $ispkey = false])
 boolean constraints_match (object $field)
 string create ()
 string create_constraints ()
 void drop ()
 void dump ()
 void generic_type ()
 void is_serial_class ()
Variables
mixed $constraints = array() (line 577)
mixed $defaultval = "" (line 574)
mixed $ispkey = false (line 576)
mixed $notnull = false (line 575)
mixed $num = 0 (line 572)
mixed $type = "" (line 573)

Inherited Variables

Inherited from SchemaObject

SchemaObject::$name
SchemaObject::$schema
Methods
Constructor dbfield (line 579)
dbfield dbfield (mixed &$schema, mixed $name, mixed $num, mixed $type, [mixed $defaultval = ""], [mixed $notnull = false], [mixed $ispkey = false])
constraints_match (line 684)

Return true if field constraints match those passed in.

  • return: True if $field's constraints match ours
boolean constraints_match (object $field)
  • object $field: Field object to check matching constraints on
create (line 654)

Return SQL to create this field in a table. This represents a portion of the CREATE TABLE script pertaining to this field and it comprises field name, type, and constraints.

  • return: SQL to create field inside a create table statement.
string create ()
create_constraints (line 666)

Return SQL to create all constraints for this field..

  • return: SQL to create all field constraints.
string create_constraints ()
drop (line 675)

Return the SQL to drop this field.

void drop ()
dump (line 589)

Dump field description to stdout.

void dump ()

Redefined in descendants as:
generic_type (line 609)

Return the generic type of the field. The generic types are as

follows: text Fixed or varying length strings numeric Integers, real numbers or money datetime Times, dates date-times logical Boolean or bit field (true/false)

You should override this method to return the appropriate generic field types from this list, for your database type. NB: Override this function to get schema info per DB type.

void generic_type ()

Redefined in descendants as:
is_integer_class (line 632)

Return true if the field is of an integer class.

NB: Override this function to get schema info per DB type.

void is_integer_class ()

Redefined in descendants as:
  • DB_dbfield::is_integer_class() : Return true if the field is of an integer class. We exclude the serial types due to the initial purpose of this method - to determine fields which are standalone integer types, without attached sequences.
is_serial_class (line 643)

Return true if the field is of a 'serial' class. This is a pseudo class of types which encapsulates integer fields which are able to auto-increment themselves when records are inserted.

NB: Override this function to get schema info per DB type.

void is_serial_class ()

Redefined in descendants as:
  • DB_dbfield::is_serial_class() : Return true if the field is of a 'serial' class. This is a pseudo class of types which encapsulates integer fields which are able to auto-increment themselves when records are inserted.

Inherited Methods

Inherited From SchemaObject

 SchemaObject::SchemaObject()

Documentation generated by phpDocumentor 1.3.0RC3