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 )
157 $Records = $this->Database->select(
158 '*' , $this->NativeTable ,
"( $this->AddLimitations ) AND $Condition"
163 catch( Exception $e )
207 function select( $Start =
false , $Limit =
false , $Field =
false ,
208 $Order =
false , $Condition =
'1 = 1' )
212 $Condition = $this->DatabaseAlgorithms->select_condition(
213 $Start , $Limit , $Field , $Order , $Condition , $this->NativeTable
218 catch( Exception $e )
246 $Record = $this->SecurityParser->parse_parameters(
248 'package_name:string;package_version:string,allow_not_set;type:integer,allow_not_set;'.
249 'time_step:integer,allow_not_set;archived:integer,allow_not_set;'.
250 'parameters:string,allow_not_set;next_processing_time:integer,allow_not_set'
253 list( $Fields , $Values ) = $this->DatabaseAlgorithms->compile_fields_values( $Record );
255 $id = $this->DatabaseAlgorithms->create( $this->NativeTable , $Fields , $Values );
259 catch( Exception $e )
283 function delete( $id )
287 $id = $this->Security->get( $id ,
'integer_list' );
291 $this->Database->delete( $this->NativeTable ,
"( $this->AddLimitations ) AND id IN ( $id )" );
292 $this->Database->commit();
294 catch( Exception $e )
326 $id = $this->Security->get( $id ,
'integer_list' );
328 return( $this->
unsafe_select( $this->NativeTable.
".id IN ( $id )" ) );
330 catch( Exception $e )
360 foreach( $Records as $k => $v )
362 $Records[ $k ]->title = $v->package_name.
'.'.$v->package_version.$v->parameters;
367 catch( Exception $e )
399 $id = $this->Security->get( $id ,
'integer_list' );
400 $Record = $this->SecurityParser->parse_parameters(
402 'package_name:string;package_version:string;type:integer;time_step:integer;archived:integer;'.
403 'parameters:string;next_processing_time:integer;processing:integer' ,
'allow_not_set'
406 list( $Fields , $Values ) = $this->DatabaseAlgorithms->compile_fields_values( $Record );
408 if( isset( $Fields[ 0 ] ) )
410 $this->Database->update(
411 $this->NativeTable , $Fields , $Values ,
"( $this->AddLimitations ) AND id IN ( $id )"
413 $this->Database->commit();
416 catch( Exception $e )