57 $this->FileInputAccess =
get_package(
'file_input::file_input_access' ,
'last' , __FILE__ );
58 $this->GalleryAccess =
get_package(
'gallery::gallery_access' ,
'last' , __FILE__ );
59 $this->Link =
get_package(
'link' ,
'last' , __FILE__ );
60 $this->Security =
get_package(
'security' ,
'last' , __FILE__ );
94 $id = $this->Security->get( $id ,
'integer' );
96 $Records = $this->GalleryAccess->unsafe_select( $this->GalleryAccess->NativeTable.
".id = $id" );
98 return( count( $Records ) === 1 );
100 catch( Exception $e )
132 $id = $this->Security->get( $id ,
'integer' );
134 $Records = $this->GalleryAccess->unsafe_select( $this->GalleryAccess->NativeTable.
".id = $id" );
136 if( count( $Records ) == 0 )
138 throw(
new Exception(
'Record was not found' ) );
141 return( $Records[ 0 ] );
143 catch( Exception $e )
175 $gid = $this->Security->get( $gid ,
'integer' );
177 $Links = $this->Link->get_links( $gid ,
false ,
'gallery' ,
'file' );
181 if( isset( $Ids[ 0 ] ) )
183 return( $this->FileInputAccess->unsafe_select(
'id IN ( '.implode(
',' , $Ids ).
' )' ) );
190 catch( Exception $e )
222 $gid = $this->Security->get( $gid ,
'integer' );
223 $fid = $this->Security->get( $fid ,
'integer' );
225 $this->Link->create_link( $gid, $fid ,
'gallery' ,
'file' );
227 catch( Exception $e )
259 $gid = $this->Security->get( $gid ,
'integer' );
260 $fid = $this->Security->get( $fid ,
'integer' );
262 $this->Link->delete_link( $gid, $fid ,
'gallery' ,
'file' );
267 catch( Exception $e )