ultimix
rating_access_1_0_0 Class Reference

Public Member Functions

 __construct ()
 unsafe_select ($Condition)
 select_list ($id)
 create ($Record)
 update ($id, $Record)

Data Fields

 $NativeTable = '`umx_rating`'
 $Database = false
 $DatabaseAlgorithms = false
 $Link = false
 $Security = false
 $SecurityParser = false

Detailed Description

Class provides data access routine.

Author
Dodonov A.A.

Definition at line 26 of file rating_access.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

Author
Dodonov A.A.

Definition at line 66 of file rating_access.php.

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

Member Function Documentation

create (   $Record)

Creating record.

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

Definition at line 207 of file rating_access.php.

{
try
{
$MasterLink = $this->SecurityParser->parse_parameters(
$Record , 'master_type:command;master_id:integer'
);
$Record = array( 'value' => 0 );
list( $Fields , $Values ) = $this->DatabaseAlgorithms->compile_fields_values( $Record );
$id = $this->DatabaseAlgorithms->create( $this->NativeTable , $Fields , $Values );
$Link = get_package( 'link' , 'last' , __FILE__ );
$Link->create_link(
get_field( $MasterLink , 'master_id' ) , $id ,
get_field( $MasterLink , 'master_type' ) , 'rating'
);
$this->rise_create_event( $id );
return( $id );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
select_list (   $id)

Function selects list of objects.

Parameters
$id- Comma separated list of record's id.
Returns
Array of records.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 140 of file rating_access.php.

{
try
{
$id = $this->Security->get( $id , 'integer_list' );
return( $this->unsafe_select( $this->NativeTable.".id IN ( $id ) ORDER BY id DESC" ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
unsafe_select (   $Condition)

Selecting reviews.

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

Definition at line 104 of file rating_access.php.

{
try
{
$this->Database->query_as( DB_OBJECT );
return( $this->Database->select( '*' , $this->NativeTable , $Condition ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
update (   $id,
  $Record 
)

Updating record.

Parameters
$id- Comma separated list of record's id.
$Record- Example for update.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 259 of file rating_access.php.

{
try
{
$id = $this->Security->get( $id , 'integer_list' );
$Record = $this->SecurityParser->parse_parameters( $Record , 'value:float' , 'allow_not_set' );
list( $Fields , $Values ) = $this->DatabaseAlgorithms->compile_fields_values( $Record );
if( isset( $Fields[ 0 ] ) )
{
$this->Database->update(
$this->NativeTable , $Fields , $Values , "( $this->AddLimitations ) AND id IN ( $id )"
);
$this->Database->commit();
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Field Documentation

$Database = false

Cached objects.

Author
Dodonov A.A.

Definition at line 50 of file rating_access.php.

$DatabaseAlgorithms = false

Definition at line 51 of file rating_access.php.

$Link = false

Definition at line 52 of file rating_access.php.

$NativeTable = '`umx_rating`'

Table name in wich objects of this entity are stored.

Author
Dodonov A.A.

Definition at line 38 of file rating_access.php.

$Security = false

Definition at line 53 of file rating_access.php.

$SecurityParser = false

Definition at line 54 of file rating_access.php.


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