Detailed Description
Class provides algorithms.
- Author
- Dodonov A.A.
Definition at line 26 of file comment_algorithms.php.
Constructor & Destructor Documentation
Constructor.
- Author
- Dodonov A.A.
Definition at line 55 of file comment_algorithms.php.
{
try
{
$this->CommentAccess =
get_package(
'comment::comment_access' ,
'last' , __FILE__ );
$this->Link =
get_package(
'link' ,
'last' , __FILE__ );
$this->LinkUtilities =
get_package(
'link::link_utilities' ,
'last' , __FILE__ );
$this->Security =
get_package(
'security' ,
'last' , __FILE__ );
}
catch( Exception $e )
{
}
}
Member Function Documentation
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 130 of file comment_algorithms.php.
{
try
{
$id = $this->Security->get( $id , 'integer' );
$Records = $this->CommentAccess->unsafe_select( $this->CommentAccess->NativeTable.".id = $id" );
if( count( $Records ) == 0 )
{
throw( new Exception( 'Record was not found' ) );
}
return( $Records[ 0 ] );
}
catch( Exception $e )
{
}
}
| get_comments_newer_than |
( |
|
$Author, |
|
|
|
$Time |
|
) |
| |
Function fetches comments.
- 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 224 of file comment_algorithms.php.
{
try
{
$Author = $this->Security->get( $Author , 'integer' );
$Time = $this->Security->get( $Time , 'integer' );
$Records = $this->CommentAccess->unsafe_select(
$this->CommentAccess->NativeTable.".author = $Author AND ".
"DATE_ADD( creation_date , INTERVAL $Time SECOND ) > NOW()"
);
return( $Records );
}
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 177 of file comment_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 , 'comment' , $this->CommentAccess
);
return( $this->Cache[ "$MasterId.$MasterType" ] );
}
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 92 of file comment_algorithms.php.
{
try
{
$id = $this->Security->get( $id , 'integer' );
$Records = $this->CommentAccess->unsafe_select( $this->CommentAccess->NativeTable.".id = $id" );
return( count( $Records ) === 1 );
}
catch( Exception $e )
{
}
}
Field Documentation
The documentation for this class was generated from the following file: