59 $this->CommentAccess =
get_package(
'comment::comment_access' ,
'last' , __FILE__ );
60 $this->Link =
get_package(
'link' ,
'last' , __FILE__ );
61 $this->LinkUtilities =
get_package(
'link::link_utilities' ,
'last' , __FILE__ );
62 $this->Security =
get_package(
'security' ,
'last' , __FILE__ );
96 $id = $this->Security->get( $id ,
'integer' );
98 $Records = $this->CommentAccess->unsafe_select( $this->CommentAccess->NativeTable.
".id = $id" );
100 return( count( $Records ) === 1 );
102 catch( Exception $e )
134 $id = $this->Security->get( $id ,
'integer' );
136 $Records = $this->CommentAccess->unsafe_select( $this->CommentAccess->NativeTable.
".id = $id" );
138 if( count( $Records ) == 0 )
140 throw(
new Exception(
'Record was not found' ) );
143 return( $Records[ 0 ] );
145 catch( Exception $e )
181 if( isset( $this->Cache[
"$MasterId.$MasterType" ] ) )
183 return( $this->Cache[
"$MasterId.$MasterType" ] );
186 $this->Cache[
"$MasterId.$MasterType" ] = $this->LinkUtilities->get_dependent_objects(
187 $MasterId , $MasterType ,
'comment' , $this->CommentAccess
190 return( $this->Cache[
"$MasterId.$MasterType" ] );
192 catch( Exception $e )
228 $Author = $this->Security->get( $Author ,
'integer' );
229 $Time = $this->Security->get( $Time ,
'integer' );
231 $Records = $this->CommentAccess->unsafe_select(
232 $this->CommentAccess->NativeTable.
".author = $Author AND ".
233 "DATE_ADD( creation_date , INTERVAL $Time SECOND ) > NOW()"
238 catch( Exception $e )