tangra logo
   
[ class tree: tangra_lib ] [ index: tangra_lib ] [ all elements ]
 

Class: Registry_Key_DB

Source Location: /registry/registry_key_db.class.php

Class Registry_Key_DB

Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From Registry_Key

Registry_Key::$key_name
Registry_Key::$path
Registry_Key::$type
Registry_Key::$value

Inherited From Registry_Key

Registry_Key::decompose_key_path()
Decomposes path into array
Registry_Key::get_key_name()
Returns key name
Registry_Key::get_path()
Returns key path
Registry_Key::get_type()
Returns key type
Registry_Key::get_value()
Returns value of the key
Registry_Key::is_valid_decomposed_path()
Checks if decomposed path is valid
Registry_Key::is_valid_key_name()
Checks if key name is valid
Registry_Key::is_valid_path()
Checks if path is valid
Registry_Key::is_valid_type()
Checks if type is valid
Registry_Key::is_value_ok()
Checks if value is calid for the key type
Registry_Key::replace_slashes()
Replaces windows style slashes (\) with normal (/)
Registry_Key::set_key_name()
Sets key name
Registry_Key::set_path()
Sets key path
Registry_Key::set_type()
Sets key type
Registry_Key::set_value()
Sets key value

Inherited From Tangra_Class

Tangra_Class::get_class_name()
Alias of get_class(). Exist because of historical reasons.
Tangra_Class::__set()
Overides PHP built-in method and just throws exception if called. Purpose - to "forbid" autosetting of nonexisting class properties.

Inherited From Registry_Key

Registry_Key::KEY_BOOLEAN
Registry_Key::KEY_FLOAT
Registry_Key::KEY_INTEGER
Registry_Key::KEY_STRING

[ Top ]
Property Summary
integer   $id   Key ID
integer   $parent   Key parent
string   $table_name   DB table name for the registry table

[ Top ]
Method Summary
static void   delete()   Deletes a key specified by it's ID
static void   delete_key_and_children_with_id()   Deletes key (specified with ID) and it's children
static void   delete_key_and_children_with_path()   Deletes key (specified with full path) and it's children
static array   get_child_keys_by_full_path()   Returns child keys of key specified by full path
static array   get_child_keys_by_id()   Returns child kes of a key specified by ID
static boolena   key_exists()   Checks if key exists
static array   _get_child_keys_by_id()   Returns child kes of a key specified by ID
Registry_Key_DB   __construct()   Constructor
void   find_full_path_arr()   Returns full path of the current key
unknown   get_id()   Returns ID
integer   get_parent()   Returns parent key ID
string   get_table_name()   Returns table name
integer   insert()   Inserts the key into DB
integer   load_by_full_path()   Loads key by full path
integer   load_by_id()   Loads key by ID
integer   load_by_parent_and_key_name()   Loads key by parent and key name
returns   save()   Saves the key in DB
void   save_key()   Saves the key in DB. Alias of $this->save()
void   set_id()   Sets ID
void   set_parent()   Sets parent ID
void   set_table_name()   Sets table name
Integer   update()   Updates the key data into DB
void   _find_full_path_arr()   Returns array with full path of the current key

[ Top ]
Properties
integer   $id [line 39]

Key ID

API Tags:
Internal:  
Access:  private


[ Top ]
integer   $parent = 0 [line 46]

Key parent

API Tags:
Internal:  
Access:  private


[ Top ]
string   $table_name [line 53]

DB table name for the registry table

API Tags:
Internal:  
Access:  private


[ Top ]
Methods
static method delete  [line 424]

  static void delete( DB_Connection $dbc, integer $id, [string $table_name = 'registry']  )

Deletes a key specified by it's ID

Parameters:
DB_Connection   $dbc: 
integer   $id:  Key ID
string   $table_name:  Table name of registry

API Tags:
Access:  public


[ Top ]
static method delete_key_and_children_with_id  [line 462]

  static void delete_key_and_children_with_id( DB_Connection $dbc, integer $id, [string $table_name = 'registry']  )

Deletes key (specified with ID) and it's children

Parameters:
DB_Connection   $dbc: 
integer   $id:  ID of the key
string   $table_name:  Table name of registry

API Tags:
Access:  public


[ Top ]
static method delete_key_and_children_with_path  [line 445]

  static void delete_key_and_children_with_path( DB_Connection $dbc, string $full_path, [string $table_name = 'registry']  )

Deletes key (specified with full path) and it's children

Parameters:
DB_Connection   $dbc: 
string   $full_path:  Full path of the key
string   $table_name:  Table name of registry

API Tags:
Access:  public


[ Top ]
static method get_child_keys_by_full_path  [line 353]

  static array get_child_keys_by_full_path( DB_Connection $dbc, string $key_full_path, [ $table_name = 'registry'], string $able_name  )

Returns child keys of key specified by full path

Parameters:
DB_Connection   $dbc: 
string   $key_full_path:  Full path of the key
string   $able_name:  Table name of registry
   $table_name: 

API Tags:
Access:  public


[ Top ]
static method get_child_keys_by_id  [line 384]

  static array get_child_keys_by_id( DB_Connection $dbc, integer $parent_id, [string $table_name = 'registry']  )

Returns child kes of a key specified by ID

Parameters:
DB_Connection   $dbc: 
integer   $parent_id:  Key ID
string   $table_name:  Table name of registry

API Tags:
Access:  public


[ Top ]
static method key_exists  [line 254]

  static boolena key_exists( DB_Connection $dbc, string $full_path, [string $table_name = 'registry']  )

Checks if key exists

Parameters:
DB_Connection   $dbc: 
string   $full_path:  Full path to the key
string   $table_name:  Table name of the registry

API Tags:
Return:  Returns true if key exist, false otherwise
Access:  public

Information Tags:
Throws:  TE_Registry_Invalid_Path

[ Top ]
static method _get_child_keys_by_id  [line 401]

  static array _get_child_keys_by_id( DB_Connection $dbc, unknown_type $parent_id, [string $table_name = 'registry']  )

Returns child kes of a key specified by ID

Parameters:
DB_Connection   $dbc: 
unknown_type   $parent_id:  Key ID
string   $table_name:  Table name of registry

API Tags:
Internal:  
Access:  private


[ Top ]
Constructor __construct  [line 61]

  Registry_Key_DB __construct( [string $table_name = 'registry']  )

Constructor

Parameters:
string   $table_name:  DB table name for the registry table


[ Top ]
find_full_path_arr  [line 478]

  void find_full_path_arr( DB_Connection $dbc, integet $id  )

Returns full path of the current key

Parameters:
DB_Connection   $dbc: 
integet   $id: 

API Tags:
Access:  public


[ Top ]
get_id  [line 82]

  unknown get_id( )

Returns ID


API Tags:
Access:  public


[ Top ]
get_parent  [line 102]

  integer get_parent( )

Returns parent key ID


API Tags:
Access:  public


[ Top ]
get_table_name  [line 127]

  string get_table_name( )

Returns table name


API Tags:
Access:  public


[ Top ]
insert  [line 289]

  integer insert( DB_Connection $dbc  )

Inserts the key into DB

Parameters:
DB_Connection   $dbc: 

API Tags:
Return:  ID of the key. If unsuccessful - returns false
Internal:  
Access:  protected

Information Tags:
Throws:  TE_Exception

[ Top ]
load_by_full_path  [line 233]

  integer load_by_full_path( DB_Connection $dbc, string $full_path  )

Loads key by full path

Parameters:
DB_Connection   $dbc: 
string   $full_path:  Full path of the key

API Tags:
Return:  Returns key ID on success, false otherwise
Access:  public


[ Top ]
load_by_id  [line 169]

  integer load_by_id( DB_Connection $dbc, integer $id  )

Loads key by ID

Parameters:
DB_Connection   $dbc: 
integer   $id: 

API Tags:
Return:  Returns ID on success, false otherwise
Access:  public


Implementation of:
I_DB_Storable::load_by_id()
Loads the object from DB

[ Top ]
load_by_parent_and_key_name  [line 205]

  integer load_by_parent_and_key_name( DB_Connection $dbc, integer $parent, string $key_name  )

Loads key by parent and key name

Parameters:
DB_Connection   $dbc: 
integer   $parent:  ID of the parent
string   $key_name:  Name of the key

API Tags:
Return:  Returns key ID on success, false otherwise
Access:  public


[ Top ]
save  [line 148]

  returns save( DB_Connection $dbc  )

Saves the key in DB

Parameters:
DB_Connection   $dbc: 

API Tags:
Return:  ID of the key on success, false otherwise
Access:  public


Implementation of:
I_DB_Storable::save()
Save the object in DB

[ Top ]
save_key  [line 137]

  void save_key( DB_Connection $dbc  )

Saves the key in DB. Alias of $this->save()

Parameters:
DB_Connection   $dbc: 

API Tags:
Access:  public


[ Top ]
set_id  [line 71]

  void set_id( intger $id  )

Sets ID

Parameters:
intger   $id: 

API Tags:
Access:  public


[ Top ]
set_parent  [line 92]

  void set_parent( integer $parent  )

Sets parent ID

Parameters:
integer   $parent: 

API Tags:
Access:  public


[ Top ]
set_table_name  [line 113]

  void set_table_name( string $table_name  )

Sets table name

Parameters:
string   $table_name: 

API Tags:
Access:  public

Information Tags:
Throws:  Tangra_Module_Exception

[ Top ]
update  [line 327]

  Integer update( DB_Connection $dbc  )

Updates the key data into DB

Parameters:
DB_Connection   $dbc: 

API Tags:
Return:  ID of the key
Access:  protected


[ Top ]
_find_full_path_arr  [line 491]

  void _find_full_path_arr( DB_Connection $dbc, integer $id  )

Returns array with full path of the current key

Parameters:
DB_Connection   $dbc: 
integer   $id: 

API Tags:
Internal:  
Access:  private


[ Top ]