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

Class: Registry_Key

Source Location: /registry/registry_key.class.php

Class Registry_Key

Descendants
Child Class Description
Registry_Key_DB Registry_Key_DB uses DB to store keys

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

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
string   $key_name   Holds key name
string   $path   Holds key path
integer   $type   Holds key type
mixed   $value   Holds key value

[ Top ]
Method Summary
static array   decompose_key_path()   Decomposes path into array
static boolean   is_valid_decomposed_path()   Checks if decomposed path is valid
static boolean   is_valid_key_name()   Checks if key name is valid
static boolean   is_valid_path()   Checks if path is valid
static boolean   is_valid_type()   Checks if type is valid
static string   replace_slashes()   Replaces windows style slashes (\) with normal (/)
string   get_key_name()   Returns key name
string   get_path()   Returns key path
integer   get_type()   Returns key type
mixed   get_value()   Returns value of the key
booleand   is_value_ok()   Checks if value is calid for the key type
void   set_key_name()   Sets key name
void   set_path()   Sets key path
void   set_type()   Sets key type
void   set_value()   Sets key value

[ Top ]
Properties
string   $key_name [line 63]

Holds key name

API Tags:
Internal:  
Access:  private


[ Top ]
string   $path [line 70]

Holds key path

API Tags:
Internal:  
Access:  private


[ Top ]
integer   $type [line 77]

Holds key type

API Tags:
Internal:  
Access:  private


[ Top ]
mixed   $value [line 84]

Holds key value

API Tags:
Internal:  
Access:  private


[ Top ]
Methods
static method decompose_key_path  [line 300]

  static array decompose_key_path( string $key_path  )

Decomposes path into array

When string path is given as parameter this function returns an array where each component of the path is in it's on array element

Parameters:
string   $key_path: 

API Tags:
Access:  public

Information Tags:
Throws:  TE_Registry_Invalid_Path

[ Top ]
static method is_valid_decomposed_path  [line 264]

  static boolean is_valid_decomposed_path( array $path_arr  )

Checks if decomposed path is valid

Parameters:
array   $path_arr: 

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


[ Top ]
static method is_valid_key_name  [line 233]

  static boolean is_valid_key_name( string $key_name  )

Checks if key name is valid

Valid key names are alphanumeric, lowecase, start with letter, 254 characters max, underscore allowed

Parameters:
string   $key_name: 

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


[ Top ]
static method is_valid_path  [line 244]

  static boolean is_valid_path( string $path  )

Checks if path is valid

Parameters:
string   $path: 

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


[ Top ]
static method is_valid_type  [line 319]

  static boolean is_valid_type( integer $type  )

Checks if type is valid

Parameters:
integer   $type: 

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


[ Top ]
static method replace_slashes  [line 284]

  static string replace_slashes( string $key_path  )

Replaces windows style slashes (\) with normal (/)

Parameters:
string   $key_path: 

API Tags:
Access:  protected


[ Top ]
get_key_name  [line 107]

  string get_key_name( )

Returns key name


API Tags:
Access:  public


[ Top ]
get_path  [line 137]

  string get_path( )

Returns key path


API Tags:
Access:  public


[ Top ]
get_type  [line 162]

  integer get_type( )

Returns key type


API Tags:
Access:  public


[ Top ]
get_value  [line 220]

  mixed get_value( )

Returns value of the key


API Tags:
Access:  public


[ Top ]
is_value_ok  [line 187]

  booleand is_value_ok( mixed $value  )

Checks if value is calid for the key type

Parameters:
mixed   $value: 

API Tags:
Return:  Returns true if valid, false otherwise
Access:  protected


[ Top ]
set_key_name  [line 93]

  void set_key_name( string $key_name  )

Sets key name

Parameters:
string   $key_name: 

API Tags:
Access:  public

Information Tags:
Throws:  TE_Registry_Invalid_Key_Name

[ Top ]
set_path  [line 119]

  void set_path( string $path  )

Sets key path

Parameters:
string   $path: 

API Tags:
Access:  public

Information Tags:
Throws:  TE_Registry_Invalid_Path

[ Top ]
set_type  [line 148]

  void set_type( integer $type  )

Sets key type

Parameters:
integer   $type: 

API Tags:
Access:  public

Information Tags:
Throws:  TE_Registry_Invalid_Type

[ Top ]
set_value  [line 172]

  void set_value( mixed $value  )

Sets key value

Parameters:
mixed   $value: 

API Tags:
Access:  public


[ Top ]
Constants
KEY_BOOLEAN = 3 [line 55]

Boolean


[ Top ]
KEY_FLOAT = 2 [line 50]

Float


[ Top ]
KEY_INTEGER = 1 [line 45]

Integer


[ Top ]
KEY_STRING = 0 [line 40]

String


[ Top ]