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

Class: MDB2_Schema_Validate

Source Location: /MDB2_Schema-0.8.6/MDB2/Schema/Validate.php

Class Overview


Validates an XML schema file


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 60]
Validates an XML schema file


[ Top ]


Class Variables

$fail_on_invalid_names =  true

[line 64]


Type:   mixed


[ Top ]

$force_defaults =  true

[line 68]


Type:   mixed


[ Top ]

$max_identifiers_length =  null

[line 70]


Type:   mixed


[ Top ]

$valid_types = array()

[line 66]


Type:   mixed


[ Top ]



Method Detail

MDB2_Schema_Validate (Constructor)   [line 127]

void MDB2_Schema_Validate( [bool $fail_on_invalid_names = true], [array $valid_types = array()], [bool $force_defaults = true], [int $max_identifiers_length = null])

PHP 4 compatible constructor
  • Access: public

Parameters:

bool   $fail_on_invalid_names   —  array with reserved words per RDBMS
array   $valid_types   —  information of all valid fields types
bool   $force_defaults   —  if true sets a default value to field when not explicit
int   $max_identifiers_length   —  maximum allowed size for entities name

[ Top ]

__construct (Constructor)   [line 91]

void __construct( [bool $fail_on_invalid_names = true], [array $valid_types = array()], [bool $force_defaults = true], [int $max_identifiers_length = null])

PHP 5 constructor
  • Access: public

Parameters:

bool   $fail_on_invalid_names   —  array with reserved words per RDBMS
array   $valid_types   —  information of all valid fields types
bool   $force_defaults   —  if true sets a default value to field when not explicit
int   $max_identifiers_length   —  maximum allowed size for entities name

[ Top ]

isBoolean   [line 167]

bool isBoolean( mixed &$value)

Verifies if a given value can be considered boolean. If yes, set value to true or false according to its actual contents and return true. If not, keep its contents untouched and return false.
  • Access: public

Parameters:

mixed   &$value   —  value to be checked

[ Top ]

validateConstraint   [line 541]

bool|error validateConstraint( array $table_constraints, array &$constraint, string $constraint_name)

Checks whether a parsed foreign key is valid. Modify its definition when necessary.
  • Return: object
  • Access: public

Parameters:

array   $table_constraints   —  multi dimensional array that contains the constraints of current table.
array   &$constraint   —  multi dimensional array that contains the structure of the parsed foreign key.
string   $constraint_name   —  name of the parsed foreign key

[ Top ]

validateConstraintField   [line 594]

bool|error validateConstraintField( array $constraint_fields, string $field_name)

Checks whether a foreign-field is valid.
  • Return: object
  • Access: public

Parameters:

array   $constraint_fields   —  multi dimensional array that contains the fields of current foreign key.
string   $field_name   —  name of the parsed foreign-field

[ Top ]

validateConstraintReferencedField   [line 625]

bool|error validateConstraintReferencedField( array $referenced_fields, string $field_name)

Checks whether a foreign-referenced field is valid.
  • Return: object
  • Access: public

Parameters:

array   $referenced_fields   —  multi dimensional array that contains the fields of current foreign key.
string   $field_name   —  name of the parsed foreign-field

[ Top ]

validateDatabase   [line 711]

bool|error validateDatabase( array &$database)

Checks whether a parsed database is valid. Modify its structure and data when necessary.
  • Return: object
  • Access: public

Parameters:

array   &$database   —  multi dimensional array that contains the structure and optional data of the database.

[ Top ]

validateDataField   [line 844]

bool|error validateDataField( array $table_fields, array $instruction_fields, string &$field)

Checks whether a parsed DML-field is valid. Modify its structure when necessary. This is called when validating INSERT and UPDATE.
  • Return: object
  • Access: public

Parameters:

array   $table_fields   —  multi dimensional array that contains the definition for current table's fields.
array   $instruction_fields   —  multi dimensional array that contains the parsed fields of the current DML instruction.
string   &$field   —  array that contains the parsed instruction field

[ Top ]

validateDataFieldValue   [line 898]

bool|error validateDataFieldValue( array $field_def, string &$field_value, string $field_name)

Checks whether a given value is compatible with a table field. This is done when parsing a field for a INSERT or UPDATE instruction.
  • Return: object
  • See: MDB2_Schema_Validate::validateInsertField()
  • Access: public

Parameters:

array   $field_def   —  multi dimensional array that contains the definition for current table's fields.
string   &$field_value   —  value to fill the parsed field
string   $field_name   —  name of the parsed field

[ Top ]

validateField   [line 325]

bool|error validateField( array $fields, array &$field, string $field_name)

Checks whether the definition of a parsed field is valid. Modify field definition when necessary.
  • Return: object
  • Access: public

Parameters:

array   $fields   —  multi dimensional array that contains the fields of current table.
array   &$field   —  multi dimensional array that contains the structure of the parsed field.
string   $field_name   —  name of the parsed field

[ Top ]

validateIdentifier   [line 982]

bool|error validateIdentifier( string $id, string $type)

Checks whether a given identifier is valid for current driver.
  • Return: object
  • Access: public

Parameters:

string   $id   —  identifier to check
string   $type   —  whether identifier represents a table name, index, etc.

[ Top ]

validateIndex   [line 449]

bool|error validateIndex( array $table_indexes, array &$index, string $index_name)

Checks whether a parsed index is valid. Modify index definition when necessary.
  • Return: object
  • Access: public

Parameters:

array   $table_indexes   —  multi dimensional array that contains the indexes of current table.
array   &$index   —  multi dimensional array that contains the structure of the parsed index.
string   $index_name   —  name of the parsed index

[ Top ]

validateIndexField   [line 501]

bool|error validateIndexField( array $index_fields, array &$field, string $field_name)

Checks whether a parsed index-field is valid. Modify its definition when necessary.
  • Return: object
  • Access: public

Parameters:

array   $index_fields   —  multi dimensional array that contains the fields of current index.
array   &$field   —  multi dimensional array that contains the structure of the parsed index-field.
string   $field_name   —  name of the parsed index-field

[ Top ]

validateSequence   [line 659]

bool|error validateSequence( array $sequences, array &$sequence, string $sequence_name)

Checks whether the definition of a parsed sequence is valid. Modify sequence definition when necessary.
  • Return: object
  • Access: public

Parameters:

array   $sequences   —  multi dimensional array that contains the sequences of current database.
array   &$sequence   —  multi dimensional array that contains the structure of the parsed sequence.
string   $sequence_name   —  name of the parsed sequence

[ Top ]

validateTable   [line 221]

bool|error validateTable( array $tables, array &$table, string $table_name)

Checks whether the definition of a parsed table is valid. Modify table definition when necessary.
  • Return: object
  • Access: public

Parameters:

array   $tables   —  multi dimensional array that contains the tables of current database.
array   &$table   —  multi dimensional array that contains the structure and optional data of the table.
string   $table_name   —  name of the parsed table

[ Top ]


Documentation generated on Wed, 09 Dec 2015 23:16:35 +0000 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.