ultimix
graph_data_access_1_0_0 Class Reference

Public Member Functions

 __construct ()
 set_add_limitations ($theAddLimitation)
 unsafe_select ($Condition, $Fields=false)
 create ($Record)

Data Fields

 $NativeTable = '`umx_graph_data`'
 $Database = false
 $DatabaseAlgorithms = false
 $Security = false
 $SecurityParser = false
 $UserAlgorithms = false
 $AddLimitations = '1 = 1'

Detailed Description

Class provides records access routine.

Author
Dodonov A.A.

Definition at line 26 of file graph_data_access.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

Author
Dodonov A.A.

Definition at line 66 of file graph_data_access.php.

{
try
{
$this->Database = get_package( 'database' , 'last' , __FILE__ );
$this->DatabaseAlgorithms = get_package( 'database::database_algorithms' , 'last' , __FILE__ );
$this->Security = get_package( 'security' , 'last' , __FILE__ );
$this->SecurityParser = get_package( 'security::security_parser' , 'last' , __FILE__ );
$this->UserAlgorithms = get_package( 'user::user_algorithms' , 'last' , __FILE__ );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Member Function Documentation

create (   $Record)

Creating record.

Parameters
$RecordExample for creation.
Returns
id of the created record.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 237 of file graph_data_access.php.

{
try
{
list( $Fields , $Values ) = $this->fetch_create_parameters( $Record );
$this->Database->delete(
$this->NativeTable , "( $this->AddLimitations ) AND abscissa = ".get_field( $Record , 'abscissa' ).
' AND graph_type = '.get_field( $Record , 'graph_type' )
);
$this->Database->commit();
$id = $this->DatabaseAlgorithms->create( $this->NativeTable , $Fields , $Values );
$EventManager = get_package( 'event_manager' , 'last' , __FILE__ );
$EventManager->trigger_event( 'on_after_create_graph_data' , array( 'id' => $id ) );
return( $id );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
set_add_limitations (   $theAddLimitation)

Function sets additional limitations.

Parameters
$theAddLimitation- Additional limitations.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 112 of file graph_data_access.php.

{
try
{
if( $this->AddLimitations === '1 = 1' )
{
$this->AddLimitations = $theAddLimitation;
}
else
{
throw( new Exception( '"AddLimitations" was already set' ) );
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
unsafe_select (   $Condition,
  $Fields = false 
)

Selecting records.

Parameters
$Condition- Records selection condition.
Returns
Array of objects.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 153 of file graph_data_access.php.

{
try
{
$this->Database->query_as( DB_OBJECT );
return(
$this->Database->select(
$Fields === false ? $this->NativeTable.'.*' : $Fields , $this->NativeTable ,
"( $this->AddLimitations ) AND $Condition"
)
);
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Field Documentation

$AddLimitations = '1 = 1'

Definition at line 92 of file graph_data_access.php.

$Database = false

Cached objects.

Author
Dodonov A.A.

Definition at line 50 of file graph_data_access.php.

$DatabaseAlgorithms = false

Definition at line 51 of file graph_data_access.php.

$NativeTable = '`umx_graph_data`'

Table name in wich objects of this entity are stored.

Author
Dodonov A.A.

Definition at line 38 of file graph_data_access.php.

$Security = false

Definition at line 52 of file graph_data_access.php.

$SecurityParser = false

Definition at line 53 of file graph_data_access.php.

$UserAlgorithms = false

Definition at line 54 of file graph_data_access.php.


The documentation for this class was generated from the following file: