Detailed Description
Class provides algorithms.
- Author
- Dodonov A.A.
Definition at line 26 of file review_algorithms.php.
Constructor & Destructor Documentation
Constructor.
- Author
- Dodonov A.A.
Definition at line 66 of file review_algorithms.php.
{
try
{
$this->FileInputAccess =
get_package(
'file_input::file_input_access' ,
'last' , __FILE__ );
$this->LinkUtilities =
get_package(
'link::link_utilities' ,
'last' , __FILE__ );
$this->ReviewAccess =
get_package(
'review::review_access' ,
'last' , __FILE__ );
$this->Security =
get_package(
'security' ,
'last' , __FILE__ );
$this->UserAlgorithms =
get_package(
'user::user_algorithms' ,
'last' , __FILE__ );
}
catch( Exception $e )
{
}
}
Member Function Documentation
| create |
( |
& |
$Record, |
|
|
& |
$Options |
|
) |
| |
Creating record.
- Parameters
-
| $Record | Example for creation. |
| $Options | - Settings. |
- Returns
- id of the created record.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 236 of file review_algorithms.php.
{
try
{
$MasterId = $Options->get_setting( 'master_id' );
$MasterType = $Options->get_setting( 'master_type' );
return( $this->ReviewAccess->create( $Record ) );
}
catch( Exception $e )
{
}
}
Function returns record by it's id.
- Parameters
-
- Returns
- Record.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 142 of file review_algorithms.php.
{
try
{
$id = $this->Security->get( $id , 'integer' );
$Records = $this->ReviewAccess->unsafe_select( $this->ReviewAccess->NativeTable.".id = $id" );
if( count( $Records ) == 0 )
{
throw( new Exception( 'Record was not found' ) );
}
return( $Records[ 0 ] );
}
catch( Exception $e )
{
}
}
| get_records_for_object |
( |
|
$MasterId, |
|
|
|
$MasterType |
|
) |
| |
Function fetches comments.
- Parameters
-
| $MasterId | - Master object's id. |
| $MasterType | - Master object's type. |
- Returns
- Records.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 189 of file review_algorithms.php.
{
try
{
if( isset( $this->Cache[ "$MasterId.$MasterType" ] ) )
{
return( $this->Cache[ "$MasterId.$MasterType" ] );
}
$this->Cache[ "$MasterId.$MasterType" ] = $this->LinkUtilities->get_dependent_objects(
$MasterId , $MasterType , 'review' , $this->ReviewAccess
);
return( $this->Cache[ "$MasterId.$MasterType" ] );
}
catch( Exception $e )
{
}
}
| get_reviews_newer_than |
( |
|
$Author, |
|
|
|
$Time |
|
) |
| |
Function fetches reviews.
- Parameters
-
| $Author | - Author. |
| $Time | - Period limit (in seconds). |
- Returns
- Records.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 277 of file review_algorithms.php.
{
try
{
$Author = $this->Security->get( $Author , 'integer' );
$Time = $this->Security->get( $Time , 'integer' );
$Records = $this->ReviewAccess->unsafe_select(
$this->ReviewAccess->NativeTable.".author = $Author AND ".
"DATE_ADD( creation_date , INTERVAL $Time SECOND ) > NOW()"
);
return( $Records );
}
catch( Exception $e )
{
}
}
Function validates object's existense.
- Parameters
-
- Returns
- true if the object exists.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 104 of file review_algorithms.php.
{
try
{
$id = $this->Security->get( $id , 'integer' );
$Records = $this->ReviewAccess->unsafe_select( $this->ReviewAccess->NativeTable.".id = $id" );
return( count( $Records ) === 1 );
}
catch( Exception $e )
{
}
}
Field Documentation
The documentation for this class was generated from the following file: