69 $this->Database =
get_package(
'database' ,
'last' , __FILE__ );
70 $this->DatabaseAlgorithms =
get_package(
'database::database_algorithms' ,
'last' , __FILE__ );
71 $this->Security =
get_package(
'security' ,
'last' , __FILE__ );
72 $this->SecurityParser =
get_package(
'security::security_parser' ,
'last' , __FILE__ );
114 if( $this->AddLimitations ===
'1 = 1' )
116 $this->AddLimitations = $theAddLimitation;
120 throw(
new Exception(
'"AddLimitations" was already set' ) );
123 catch( Exception $e )
158 $this->Database->select(
'*' , $this->NativeTable ,
"( $this->AddLimitations ) AND $Condition" )
161 catch( Exception $e )
205 function select( $Start =
false , $Limit =
false ,
206 $Field =
false , $Order =
false , $Condition =
'1 = 1' )
210 $Condition = $this->DatabaseAlgorithms->select_condition(
211 $Start , $Limit , $Field , $Order , $Condition , $this->NativeTable
216 catch( Exception $e )
244 function delete( $id , $Options =
' 1 = 1' )
248 $id = $this->Security->get( $id ,
'integer_list' );
249 $this->Database->delete( $this->NativeTable ,
"( $this->AddLimitations ) AND id IN ( $id )" );
250 $this->Database->commit();
252 catch( Exception $e )
284 $Record = $this->SecurityParser->parse_parameters(
285 $Record ,
'title:string;description:string,allow_no_set'
288 list( $Fields , $Values ) = $this->DatabaseAlgorithms->compile_fields_values( $Record );
290 $id = $this->DatabaseAlgorithms->create( $this->NativeTable , $Fields , $Values );
292 $EventManager =
get_package(
'event_manager' ,
'last' , __FILE__ );
293 $EventManager->trigger_event(
'on_after_create_gallery' , array(
'id' => $id ) );
297 catch( Exception $e )
329 $id = $this->Security->get( $id ,
'integer_list' );
330 $Record = $this->SecurityParser->parse_parameters(
331 $Record ,
'title:string;description:string' ,
'allow_no_set'
334 list( $Fields , $Values ) = $this->DatabaseAlgorithms->compile_fields_values( $Record );
336 if( isset( $Fields[ 0 ] ) )
338 $this->Database->update(
339 $this->NativeTable , $Fields , $Values ,
"( $this->AddLimitations ) AND id IN ( $id )"
341 $this->Database->commit();
344 catch( Exception $e )
376 $id = $this->Security->get( $id ,
'integer_list' );
378 return( $this->
unsafe_select( $this->NativeTable.
".id IN ( $id )" ) );
380 catch( Exception $e )