Database Administration model. This model reads data about the database structure both from the file system (configs/db*) and the database and shows a combination of the actual database structure and required database structure.

package Gems
subpackage Model
copyright Copyright (c) 2011 Erasmus MC
license New BSD License
since Class available since version 1.0

 Methods

__construct()

__construct(\Zend_Db_Adapter_Abstract $db, array $directories) 

Parameters

$db

\Zend_Db_Adapter_Abstract

$directories

array

directory => name | \Zend_Db_Adaptor_Abstract | array(['path' =>], 'name' =>, 'db' =>,)

The encoding used in the script files

getFileEncoding() : string

Returns

string

Quick filter alias function for loading a single table

loadTable(string $tableName) : array

Parameters

$tableName

string

Returns

array

Run a sql statement from an object loaded through this model

runScript(array $data, boolean $includeResultSets = false) : string

$data is an array with the following keys: script The sql statement to be executed name The name of the table, used in messages type Type of db element (table or view), used in messages

Parameters

$data

array

$includeResultSets

boolean

Returns

string

Set the text encoding of the db definition files

setFileEncoding(string $encoding) : \Gems_Model_DbaModel

Parameters

$encoding

string

Returns

\Gems_Model_DbaModel(continuation pattern)

An ArrayModel assumes that (usually) all data needs to be loaded before any load action, this is done using the iterator returned by this function.

_loadAllTraversable() : \Traversable

Returns

\TraversableReturn an iterator over or an array of all the rows in this object

When $this->_saveable is true a child class should either override the delete() and save() functions of this class or override _saveAllTraversable().

_saveAllTraversable(array $data) : void

In the latter case this class will use _loadAllTraversable() and remove / add the data to the data in the delete() / save() functions and pass that data on to this function.

Parameters

$data

array

An array containing all the data that should be in this object

proxy for easy access to translations

_(string $messageId, string|\Zend_Locale $locale = null) : string

Parameters

$messageId

string

Translation string

$locale

string\Zend_Locale

(optional) Locale/Language to use, identical with locale identifier, @see \Zend_Locale for more information

Returns

string

_getGroupName()

_getGroupName($name) 

Parameters

$name

_getOrder()

_getOrder($name) 

Parameters

$name

_getType()

_getType($name) 

Parameters

$name

 Properties

 

When set to true in a subclass, then the model should be able to save itself.

$_saveable : boolean

Default

true
 

$defaultDb

$defaultDb : \Zend_Db_Adapter_Abstract

Default

 

'path' => directory, 'db' => \Zend_Db_Adapter_Abstract, 'name' => name

$directories : array

Default

 

The encoding used to read files

$file_encoding : string

Default

 

$translate

$translate : \Zend_Translate_Adapter

Default

 Constants

 

DEFAULT_ORDER

DEFAULT_ORDER = 1000 
 

STATE_CREATED

STATE_CREATED = 1 
 

STATE_DEFINED

STATE_DEFINED = 2 
 

STATE_UNKNOWN

STATE_UNKNOWN = 3