70 $this->Database =
get_package(
'database' ,
'last' , __FILE__ );
71 $this->DatabaseAlgorithms =
get_package(
'database::database_algorithms' ,
'last' , __FILE__ );
72 $this->EventManager =
get_package(
'event_manager' ,
'last' , __FILE__ );
73 $this->Security =
get_package(
'security' ,
'last' , __FILE__ );
74 $this->SecurityParser =
get_package(
'security::security_parser' ,
'last' , __FILE__ );
116 if( $this->AddLimitations ===
'1 = 1' )
118 $this->AddLimitations = $theAddLimitation;
122 throw(
new Exception(
'"AddLimitations" was already set' ) );
125 catch( Exception $e )
160 $this->Database->select(
161 $this->NativeTable.
'.*' , $this->NativeTable ,
"( $this->AddLimitations ) AND $Condition"
165 catch( Exception $e )
209 function select( $Start =
false , $Limit =
false , $Field =
false ,
210 $Order =
false , $Condition =
'1 = 1' )
214 $Condition = $this->DatabaseAlgorithms->select_condition(
215 $Start , $Limit , $Field , $Order , $Condition , $this->NativeTable
220 catch( Exception $e )
248 function delete( $id , $Options =
' 1 = 1' )
252 $this->EventManager->trigger_event(
'on_before_delete_site' , array(
'id' => $id ) );
254 $id = $this->Security->get( $id ,
'integer_list' );
255 $this->Database->delete( $this->NativeTable ,
"( $this->AddLimitations ) AND id IN ( $id )" );
256 $this->Database->commit();
258 $this->EventManager->trigger_event(
'on_after_delete_site' , array(
'id' => $id ) );
260 catch( Exception $e )
292 $Record = $this->SecurityParser->parse_parameters(
293 $Record ,
'domain:string;comment:string,allow_not_set'
296 list( $Fields , $Values ) = $this->DatabaseAlgorithms->compile_fields_values( $Record ,
CREATION_DATE );
298 $id = $this->DatabaseAlgorithms->create( $this->NativeTable , $Fields , $Values );
301 $EventManager->trigger_event(
'on_after_create_site' , array(
'id' => $id ) );
305 catch( Exception $e )
337 $id = $this->Security->get( $id ,
'integer_list' );
338 $Record = $this->SecurityParser->parse_parameters(
339 $Record ,
'domain:string;comment:string' ,
'allow_not_set'
342 list( $Fields , $Values ) = $this->DatabaseAlgorithms->compile_fields_values( $Record );
344 if( isset( $Fields[ 0 ] ) )
346 $this->Database->update(
347 $this->NativeTable , $Fields , $Values ,
"( $this->AddLimitations ) AND id IN ( $id )"
349 $this->Database->commit();
352 catch( Exception $e )
384 $id = $this->Security->get( $id ,
'integer_list' );
386 return( $this->
unsafe_select( $this->NativeTable.
".id IN ( $id ) ORDER BY creation_date ASC" ) );
388 catch( Exception $e )