67 $this->DatabaseAlgorithms =
get_package(
'database::database_algorithms' ,
'last' , __FILE__ );
68 $this->SecurityParser =
get_package(
'security::security_parser' ,
'last' , __FILE__ );
110 if( $this->AddLimitations ===
'1 = 1' )
112 $this->AddLimitations = $theAddLimitation;
116 throw(
new Exception(
'"AddLimitations" was already set' ) );
119 catch( Exception $e )
151 $Database =
get_package(
'database' ,
'last' , __FILE__ );
154 $Records = $Database->select(
'*' , $this->NativeTable ,
"( $this->AddLimitations ) AND $Condition" );
158 catch( Exception $e )
202 function select( $Start , $Limit , $Field =
false , $Order =
false , $Condition =
'1 = 1' )
206 $Condition = $this->DatabaseAlgorithms->select_condition(
207 $Start , $Limit , $Field , $Order , $Condition , $this->NativeTable
212 catch( Exception $e )
244 $Security =
get_package(
'security' ,
'last' , __FILE__ );
245 $id = $Security->get( $id ,
'integer' );
247 $Records = $this->
unsafe_select( $this->NativeTable.
".id = $id" );
249 if( count( $Records ) == 0 )
251 throw(
new Exception(
'Record was not found' ) );
254 return( $Records[ 0 ] );
256 catch( Exception $e )
284 $Record = $this->SecurityParser->parse_parameters( $Record ,
'name:string' );
286 list( $Fields , $Values ) = $this->DatabaseAlgorithms->compile_fields_values( $Record );
288 $id = $this->DatabaseAlgorithms->create( $this->NativeTable , $Fields , $Values );
292 catch( Exception $e )
333 $Security =
get_package(
'security' ,
'last' , __FILE__ );
334 $Start = $Security->get( $Start ,
'integer' );
335 $Limit = $Security->get( $Limit ,
'integer' );
337 $Databse =
get_package(
'database' ,
'last' , __FILE__ );
338 $Result = $Databse->select(
'*' ,
'umx_menu' ,
"$this->AddLimitations LIMIT $Start , $Limit" );
339 foreach( $Result as $i => $r )
341 $Result[ $i ] = array_merge( array(
'n' => $i + 1 ) , $Result );
346 catch( Exception $e )
378 $Security =
get_package(
'security' ,
'last' , __FILE__ );
379 $Menu = $Security->get( $Menu ,
'command' );
383 $MenuItemAccess =
get_package(
'menu::menu_item_access' ,
'last' , __FILE__ );
384 $Result = $MenuItemAccess->select(
385 false ,
false ,
false ,
false ,
"( $this->AddLimitations ) AND menu LIKE '$Menu'"
390 catch( Exception $e )
422 $Security = &
get_package(
'security' ,
'last' , __FILE__ );
423 $Menu = $Security->get( $Menu ,
'command' );
425 $Databse =
get_package(
'database' ,
'last' , __FILE__ );
426 $Result = $Databse->select(
'*' ,
'umx_menu' ,
"( $this->AddLimitations ) AND name LIKE '$Menu'" );
427 if( count( $Result ) !== 1 )
429 throw(
new Exception(
"An error occured while selecting menu" ) );
433 return( $Result[ 0 ] );
436 catch( Exception $e )
468 $Security =
get_package(
'security' ,
'last' , __FILE__ );
469 $OldMenuLocator = $Security->get( $OldMenuLocator ,
'command' );
470 $NewMenuLocator = $Security->get( $NewMenuLocator ,
'command' );
472 $Databse =
get_package(
'database' ,
'last' , __FILE__ );
474 'umx_menu' , array(
'name' ) , array( $NewMenuLocator ) ,
475 "( $this->AddLimitations ) AND name LIKE '$OldMenuLocator'"
479 catch( Exception $e )
507 $Security =
get_package(
'security' ,
'last' , __FILE__ );
508 $Menu = $Security->get( $Menu ,
'command' );
510 $Database =
get_package(
'database' ,
'last' , __FILE__ );
511 $Database->delete(
'umx_menu' ,
"( $this->AddLimitations ) AND name LIKE '$Menu'" );
514 catch( Exception $e )