class Db_Object_Config (ORM helper)

Db_Object_Config - a helper keeping the Db_Object data structure and used to obtain detailed information about the structure of the object. It also contains system properties for managing the object structure (used in the administration interface).

class Db_Object_Config{

const LINK_OBJECT = 'object';
const LINK_OBJECT_LIST = 'multy';

/**
 * Default DB connection name
 */	 	 	 	
const DEFAULT_CONNECTION = 'default';

/**
 * Instantiate data structure for the objects named $name
 * @param string $name - object name
 * @return Db_Object_Config
 */
static public function getInstance($name)

/**
 * Reload properties
 */	 	 	 	
public function reloadProperties()

/**
 * Set localization adapter
 * @param Db_Object_Congig_Translator $translator
 */
static public function setTranslator(Db_Object_Config_Translator $translator)

/**
 * Set object configuration files directory
 * @param string $path
 * @throws Exception
 * @return void
 */
static public function setConfigPath($path)

/**
 * Get object configuration files directory
 * @return string
 */
static public function getConfigPath()

/**
 * Get the name of the object with the helper assigned
 * @return string
 */
public function getName()

/**
 * Get the name of the database storing the object data  
 * @param boolean $withPrefix - a checkbox allowing to return the parameter with a prefix
 * @return string
 */
public function getTable($withPrefix = true)

/**
 * Get the list of fields, which will be used for search
 * @return array
 */
public function getSearchFields()

/**
 * Get configuration element by key
 * @param string $key
 */
public function get($key)

/**
 * Check whether document version control is used
 */
public function isRevControl()

/**
 * Get list of indexes (from configuration file)
 * @property boolean $includeSystem -optional default = true
 * @return array
 */
public function getIndexesConfig($includeSystem = true)

/**
 * Get field settings
 * @param string $field - field name
 * @throws Exception
 * @return array
 */
public function getFieldConfig($field)

/**
 * Get index settings
 * @param string $index
 * @throws Exception
 * @return array
 */
public function getIndexConfig($index)

/**
 * Get field settings
 * @property boolean $includeSystem -optional default = true
 * @return array
 */
public function getFieldsConfig($includeSystem = true)

/**
 * Get system field settings  (version 0.9.1 and higher)
 * @return array
 */
public function getSystemFieldsConfig()

/**
 * Check if a field is a link of the multilink type (a link to the list of objects of one type)
 * @param string $field
 * @throws Exception
 * @return boolean
 */
public function isMultiLink($field)

/**
 * Get the name of the linked object
 * @param string $field
 * @return string or false on error
 */
public function getLinkedObject($field)

/**
 * Get the name of the linked dictionary
 * @param string $field
 * @return string or false on error
 */
public function getLinkedDictionary($field)

/**
 * Check if the field is a link
 * @param string $field
 * @return boolean
 */
public function isLink($field)

/**
 * Check if the field links to a dictionary
 * @param string $field
 * @return boolean
 */
public function isDictionaryLink($field)

/**
 * Get database field type
 * @param string $field
 * @return string
 */
public function getDbType($field)

/**
 * Get the list of fields referring to external objects
 * @param array $linkTypes - optional link type filter
 * @return array field => link_config
 */
public function getLinks($linkTypes = array('object','multy'))

/**
 * Check if field value should be unique
 * @param string $field
 * @return boolen
 */
public function isUnique($field)

/**
 * Check if the field is boolean
 * @param string $field
 * @return boolean
 */
public function isBoolean($field)

/**
 * Check if the field is text
 * @param string $field
 * @return boolean
 */
public function isText($field)

/**
 * Check if the field is required
 * @param string $field
 * @return boolean
 */
public function isRequired($field)

/**
 * Check if the object field exists
 * @param string $field
 */
public function fieldExists($field)

/**
 * Check if the index exists
 * @param string $index
 * @return boolean
 */
public function indexExists($index)

/**
 * Get the class name of the field validator
 * @param string $field
 * @return mixed string class name / boolean false
 */
public function getValidator($field)

/**
 * Transform settings into an array
 * @return array
 */
public function __toArray()

/**
 * Get localized title for object type
 * @return string
 */
public function getTitle()

/**
 * Set a localized title for object type
 * @param string $title
 */
public function setObjectTitle($title)

/**
 * Get the name of field defining the object title 
 * when displaying object relations
 * @return string
 */
public function getLinkTitle()

/**
 * Check the availability of using transactions for operations with the object 
 * @return boolean
 */
public function isTransact()

/**
 * Save object settings
 */
public function save()

/**
 * Replace object settings with an array
 * @param array $data
 */
public function setData(array $data)

/**
 * Configure field settings
 * @param string $field
 * @param array $config
 */
public function setFieldconfig($field , array $config)

/**
 * Update link settings for the field,  
 * replace the name of the linked object
 * @param string $field
 * @param string $linkedObject
 * @return boolean
 */
public function setFieldLink($field , $linkedObject)

/**
 * Configure index settings
 * @param string $index
 * @param array $config
 */
public function setIndexConfig($index , array $config)

/**
 * Rename the field, rebuild the database
 * @param string $oldname
 * @param string $newName
 * @return boolean
 */
public function renameField($oldName , $newName)

/**
 * Remove the field
 * @param string $name
 */
public function removeField($name)

/**
 * Remove the index
 * @param string $name
 */
public function removeIndex($name)

/**
 * Get object configuration
 * @return Config_Abstract
 */
public function getConfig()

/**
 * Check if the object is a system one
 * @return boolean
 */
public function isSystem()

/**
 * Check of the object configuration file exists
 * (available with version 0.9)
 * @param string $name
 * @return boolean
 */
static public function configExists($name)

/**
 * Get system fields configuration
 * (available with version 0.9)
 * @return array
 */
public function getSystemFieldsConfig()
	 	 	 	
/**
 * Check if a field is an object 
link
 * (available with version 0.9)
 * @param string $field
 * @throws Exception
 * @return boolean
 */
public function isObjectLink($field)

/**
 * Check if html tags are allowed
 * (version 0.9 and higher)
 * @param string $field
 * @return boolean
 */
public function isHtml($field)

/**
 * Check if the object uses history log
 * (version 0.9 and higher)
 * @return boolean
 */
public function hasHistory()

/**
 * Check whether the field is a numeric field
 * (version 0.9 and higher)
 * @param string $field
 * @return boolean
 */
public function isNumeric($field)

/**
 * Check whether the field is an integer field
 *  (version 0.9 and higher)
 * @param string $field
 * @return boolean
 */
public function isInteger($field)

/**
 * Check whether the field is a float field
 * (version 0.9 and higher)
 * @param string $field
 * @return boolean
 */
public function isFloat($field)

/**
 * Check if object structure may be changed
 * (rebuilding db tables (version 0.9.1 and higher)
 * @return boolean
 */
public function isLocked()

/**
 * Check if data may be written (version 0.9.1 and higher)
 * @return boolean
 */
public function isReadonly()

/**
 * Get the list of Foreign keys
 * (version 0.9 and higher)
 * @return array
 * array(
 * 	array(
 *              'curDb' => string,
 * 		'curObject' => string,
 * 		'curTable' => string,
 *		'curField'=> string,
 *		'isNull'=> boolean,
 *		'toDb'=> string, 
 *		'toObject'=> string,
 *		'toTable'=> string,
 *		'toField'=> string,
 *              'onUpdate'=> string
 *              'onDelete'=> string
 *            ),
 *        ...
 *     )
 */
public function getForeignKeys()

/**
 * Check if a foreign key may be used
 * (version 0.9 and higher)
 * @return boolean
 */
public function canUseForeignKeys()

/**
 * service stub, get the name of the initial key field
 * (version 0.9 and higher)
 * @return string
 */
public function getPrimaryKey()

/**
 * Set translation adapter
 * @param Db_Object_Config_Translator $translator
 */
static public function setTranslator(Db_Object_Config_Translator $translator)

/**
 * Get Translation adapter
 * @return Db_Object_Config_Translator
 */
static public function getTranslator()

/**
 * Get field default value. Note! The method returns false if value is not specified
 * (version 0.9.2.5 and higher)
 * @return string | false
 */
public function getDefault($field)

/**
 * Check if field has default value
 * (version 0.9.2.5 and higher)
 * @return boolean
 */
public function hasDefault($field)

/**
 * Check if field is numeric and unsigned
 * (version 0.9.2.5 and higher)
 * @param string $field
 * @return boolean
 */
public function isUnsigned($field)

/**
 * Set object configuration files directory
 * @param string $path
 * @throws Exception
 * @return void
 */
static public function setConfigPath($path)
 
/**
 * Get object configuration files directory
 * @return string
 */
static public function getConfigPath()
}

comments powered by Disqus