ultimix
chronological_1_0_0 Class Reference

Public Member Functions

 __construct ()
 create_record ($MasterId, $DataAccess)
 update_record ($MasterId, $Changes, $DataAccess)
 close_record ($MasterId, $DataAccess)

Data Fields

 $Database = false
 $Security = false

Detailed Description

Class provides chronological records manupulation routine.

Author
Dodonov A.A.

Definition at line 26 of file chronological.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 55 of file chronological.php.

{
try
{
$this->Database = get_package( 'database' , 'last' , __FILE__ );
$this->Security = get_package( 'security' , 'last' , __FILE__ );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Member Function Documentation

close_record (   $MasterId,
  $DataAccess 
)

Function closes record, wich is equivalent to it's deletion.

Parameters
$MasterId- Updating record's id.
$DataAccess- Data access object.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 271 of file chronological.php.

{
try
{
$MasterId = $this->Security->get( $MasterId , 'integer_list' );
$this->Database->update(
$DataAccess->NativeTable , array( 'date_to' ) , array( time() ) ,
"id IN ( $MasterId ) AND ( ".$DataAccess->AddLimitations." )"
);
$this->Database->commit();
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
create_record (   $MasterId,
  $DataAccess 
)

Function updates data bounds and group_id.

Parameters
$MasterId- Updating record's id.
$DataAccess- Data access object.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 90 of file chronological.php.

{
try
{
$MasterId = $this->Security->get( $MasterId , 'integer' );
$Time = time();
$this->Database->update(
$DataAccess->NativeTable ,
array( 'date_from' , 'date_to' , 'group_id' ) ,
array( $Time , $Time + 100 * 365 * 24 * 60 * 60 , $MasterId ) ,
"id = $MasterId"
);
$this->Database->commit();
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
update_record (   $MasterId,
  $Changes,
  $DataAccess 
)

Function updates data bounds and group_id for the updating record.

Parameters
$MasterId- Updating record's id.
$Changes- Records changes.
$DataAccess- Data access object.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 231 of file chronological.php.

{
try
{
$this->Database->lock( array( $DataAccess->NativeTable ) , array( 'WRITE' ) );
$this->close_old_version( $MasterId , $Changes , $DataAccess );
$this->create_new_version( $MasterId , $Changes , $DataAccess );
$this->Database->unlock();
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Field Documentation

$Database = false

Cached packages.

Author
Dodonov A.A.

Definition at line 38 of file chronological.php.

$Security = false

Definition at line 39 of file chronological.php.


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