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

Class: Registry_DB

Source Location: /registry/registry_db.class.php

Class Registry_DB

Class Overview

Regisrty_DB provides Registry with storage of data in DB

This file is deprecated. Functionality moved to module registry_db

Located in /registry/registry_db.class.php [line 43]

Tangra_Class
   |
   --Registry
      |
      --Registry_DB
Author(s):
API Tags:
Deprecated:  

Properties

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From Registry

Registry::create_key_w_path()
Create key with given full path
Registry::get_key_value()
Returns key value
Registry::set_key_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.

[ Top ]
Property Summary
DB_Connection   $dbc   Holds DB_Connection instance
string   $table_name   Holds table name for the registry db table

[ Top ]
Method Summary
Registry_DB   __construct()   Constructor
void   create_key_with_parent_id()   Creates key with parent ID given
integer   create_key_w_path()   Creates key with full path given
DB_Connection   get_dbc()   Returns db connection
mixed   get_key_value()   Returns value of the key
string   get_table_name()   Returns table name for the registry db table
void   save_key()   Saves key in DB
void   set_key_value()   Sets value of a key.
void   set_table_name()   Sets table name for the registry db table

[ Top ]
Properties
DB_Connection   $dbc [line 50]

Holds DB_Connection instance

API Tags:
Internal:  
Access:  private


[ Top ]
string   $table_name [line 56]

Holds table name for the registry db table

API Tags:
Access:  private


[ Top ]
Methods
Constructor __construct  [line 65]

  Registry_DB __construct( DB_Connection $dbc, [string $table_name = 'registry']  )

Constructor

Parameters:
DB_Connection   $dbc: 
string   $table_name:  Table name for the registry db table


[ Top ]
create_key_with_parent_id  [line 159]

  void create_key_with_parent_id( integer $parent_id, string $key_name, integer $type, mixed $value  )

Creates key with parent ID given

Parameters:
integer   $parent_id:  ID of the parent
string   $key_name:  Name of the key
integer   $type:  Type of the key (@see Registry_Key_DB for constants)
mixed   $value:  Value of the key

API Tags:
Access:  public


[ Top ]
create_key_w_path  [line 114]

  integer create_key_w_path( string $key_full_path, integer $type, mixed $value, [ $forgiving = true]  )

Creates key with full path given

Parameters:
string   $key_full_path:  Full path of the key (Please note that path must NOT end with slash (/))
integer   $type:  Type of the key (@see Registry_Key_DB for constants)
mixed   $value:  Value of the key
   $forgiving: 

API Tags:
Return:  On success returns the ID of the key. On failure - return false
Access:  public


Redefinition of:
Registry::create_key_w_path()
Create key with given full path

[ Top ]
get_dbc  [line 77]

  DB_Connection get_dbc( )

Returns db connection


API Tags:
Access:  public


[ Top ]
get_key_value  [line 188]

  mixed get_key_value( string $key_full_path, [boolean $forgiving = false]  )

Returns value of the key

Parameters:
string   $key_full_path:  Full path of the key
boolean   $forgiving:  If false and key does not exist will throw excepion. If $forgiving = true and key not exists will return false

API Tags:
Access:  public

Information Tags:
Throws:  TE_Registry_Key_Not_Exists

Redefinition of:
Registry::get_key_value()
Returns key value

[ Top ]
get_table_name  [line 101]

  string get_table_name( )

Returns table name for the registry db table


API Tags:
Access:  public


[ Top ]
save_key  [line 232]

  void save_key( DB_Connection $dbc, Registry_Key_DB $key  )

Saves key in DB

Parameters:
DB_Connection   $dbc: 
Registry_Key_DB   $key: 

API Tags:
Internal:  
Access:  protected


[ Top ]
set_key_value  [line 212]

  void set_key_value( string $key_full_path, mixed $value  )

Sets value of a key.

Parameters:
string   $key_full_path:  Full path of the key
mixed   $value:  New value

API Tags:
Access:  public


Redefinition of:
Registry::set_key_value()
Sets key value

[ Top ]
set_table_name  [line 87]

  void set_table_name( string $table_name  )

Sets table name for the registry db table

Parameters:
string   $table_name: 

API Tags:
Access:  public


[ Top ]