BAOBAB
CO_Security_Node Class Reference
Inheritance diagram for CO_Security_Node:
Collaboration diagram for CO_Security_Node:

Public Member Functions

 __construct ( $in_db_object=NULL, $in_db_result=NULL)
 
- Public Member Functions inherited from A_CO_DB_Table_Base
 set_batch_mode ()
 
 clear_batch_mode ()
 
 load_from_db ( $in_db_result)
 
 id ()
 
 lock ()
 
 locked ()
 
 danger_will_robinson_danger_clear_id ()
 
 user_can_read ()
 
 user_can_write ()
 
 set_read_security_id ($in_new_id)
 
 set_write_security_id ($in_new_id)
 
 set_name ($in_new_value)
 
 delete_from_db ()
 
 update_db ()
 
 reload_from_db ()
 
 get_access_object ()
 
 get_lang ()
 
 set_lang ( $in_lang_id=NULL)
 

Protected Member Functions

 _default_setup ()
 
 _build_parameter_array ()
 
- Protected Member Functions inherited from A_CO_DB_Table_Base
 _badger_serialize ( $in_data)
 
 _badger_unserialize ( $in_data)
 
 _write_to_db ()
 
 _seppuku ()
 

Protected Attributes

 $_ids
 
- Protected Attributes inherited from A_CO_DB_Table_Base
 $_db_object
 This is the actual database object that "owns" this instance. It should not be exposed beyond this class or subclasses, thereof. More...
 
 $_id
 This is the within-table unique ID of this record. More...
 
 $_batch_mode
 If this is true, then the write_record call will not be made in update_db. It will be done when clear_batch_mode() is called, instead. More...
 

Additional Inherited Members

- Public Attributes inherited from A_CO_DB_Table_Base
 $class_description
 This is a description of the class (not the instance). More...
 
 $instance_description
 This is a description that describes the instance. More...
 
 $last_access
 This is a UNIX epoch date that describes the last modification. The default is UNIX Day Two (in case of UTC timezone issues). More...
 
 $name
 This is the "object_name" string field. More...
 
 $read_security_id
 This is a single integer, defining the security ID required to view the record. If it is 0, then it is "open.". More...
 
 $write_security_id
 This is a single integer, defining the required security token to modify the record. If it is 0, then any logged-in user can modify. More...
 
 $context
 This is a mixed associative array, containing fields for the object. More...
 
 $error
 If there is an error, it is contained here, in a LGV_Error instance. More...
 

Detailed Description

This is the base class for records in the security database.

Definition at line 38 of file co_security_node.class.php.

Constructor & Destructor Documentation

◆ __construct()

CO_Security_Node::__construct (   $in_db_object = NULL,
  $in_db_result = NULL 
)

Initializer

Parameters
$in_db_objectThis is the database instance that "owns" this record.
$in_db_resultThis is a database-format associative array that is used to initialize this instance.

Reimplemented from A_CO_DB_Table_Base.

Reimplemented in CO_Security_ID.

Definition at line 80 of file co_security_node.class.php.

82  {
83  parent::__construct($in_db_object, $in_db_result);
84  $this->class_description = 'The basic class for all security nodes. This should be specialized.';
85 
86  $this->instance_description = isset($this->name) && $this->name ? "$this->name ($this->_id)" : "Unnamed Security Node ($this->_id)";
87  }

Member Function Documentation

◆ _build_parameter_array()

CO_Security_Node::_build_parameter_array ( )
protected

This builds up the basic section of the instance database record. It should be overloaded, and the parent called before adding new fields.

This method overloads (and calls) the base class method.

Returns
an associative array, in database record form.

Reimplemented from A_CO_DB_Table_Base.

Reimplemented in CO_Security_Login.

Definition at line 65 of file co_security_node.class.php.

65  {
66  $ret = parent::_build_parameter_array();
67 
68  $ret['login_id'] = NULL;
69  $ret['personal_ids'] = NULL;
70  $ret['ids'] = NULL;
71 
72  return $ret;
73  }

◆ _default_setup()

CO_Security_Node::_default_setup ( )
protected

This is called to populate the object fields for this class with default values. These use the SQL table tags.

This should be subclassed, and the parent should be called before applying specific instance properties.

This method overloads (and calls) the base class method.

Returns
An associative array, simulating a database read.

Reimplemented from A_CO_DB_Table_Base.

Reimplemented in CO_Security_Login.

Definition at line 52 of file co_security_node.class.php.

52  {
53  $default_setup = parent::_default_setup();
54  return $default_setup;
55  }

Member Data Documentation

◆ $_ids

CO_Security_Node::$_ids
protected

Definition at line 39 of file co_security_node.class.php.