Detailed Description
Menu class.
- Author
- Dodonov A.A.
Definition at line 26 of file menu_access.php.
Constructor & Destructor Documentation
Constructor.
- Author
- Dodonov A.A.
Definition at line 63 of file menu_access.php.
{
try
{
$this->DatabaseAlgorithms =
get_package(
'database::database_algorithms' ,
'last' , __FILE__ );
$this->SecurityParser =
get_package(
'security::security_parser' ,
'last' , __FILE__ );
}
catch( Exception $e )
{
}
}
Member Function Documentation
Creating record.
- Parameters
-
| $Record | - Example for creation. |
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 280 of file menu_access.php.
{
try
{
$Record = $this->SecurityParser->parse_parameters( $Record , 'name:string' );
list( $Fields , $Values ) = $this->DatabaseAlgorithms->compile_fields_values( $Record );
$id = $this->DatabaseAlgorithms->create( $this->NativeTable , $Fields , $Values );
return( $id );
}
catch( Exception $e )
{
}
}
Function deletes menu.
- Parameters
-
| $Menu | - Deleting menu locator. |
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 503 of file menu_access.php.
{
try
{
$Security =
get_package(
'security' ,
'last' , __FILE__ );
$Menu = $Security->get( $Menu , 'command' );
$Database =
get_package(
'database' ,
'last' , __FILE__ );
$Database->delete( 'umx_menu' , "( $this->AddLimitations ) AND name LIKE '$Menu'" );
$Database->commit();
}
catch( Exception $e )
{
}
}
Function returns record by it's id.
- Parameters
-
- Returns
- Record.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 240 of file menu_access.php.
{
try
{
$Security =
get_package(
'security' ,
'last' , __FILE__ );
$id = $Security->get( $id , 'integer' );
$Records = $this->
unsafe_select( $this->NativeTable.
".id = $id" );
if( count( $Records ) == 0 )
{
throw( new Exception( 'Record was not found' ) );
}
return( $Records[ 0 ] );
}
catch( Exception $e )
{
}
}
Function returns menu description.
- Parameters
-
- Returns
- Menu description
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 418 of file menu_access.php.
{
try
{
$Security = &
get_package(
'security' ,
'last' , __FILE__ );
$Menu = $Security->get( $Menu , 'command' );
$Databse =
get_package(
'database' ,
'last' , __FILE__ );
$Result = $Databse->select( '*' , 'umx_menu' , "( $this->AddLimitations ) AND name LIKE '$Menu'" );
if( count( $Result ) !== 1 )
{
throw( new Exception( "An error occured while selecting menu" ) );
}
else
{
return( $Result[ 0 ] );
}
}
catch( Exception $e )
{
}
}
Getting items for menu.
- Parameters
-
- Returns
- List of menu items
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 374 of file menu_access.php.
{
try
{
$Security =
get_package(
'security' ,
'last' , __FILE__ );
$Menu = $Security->get( $Menu , 'command' );
$Counter = 0;
$MenuItemAccess =
get_package(
'menu::menu_item_access' ,
'last' , __FILE__ );
$Result = $MenuItemAccess->select(
false , false , false , false , "( $this->AddLimitations ) AND menu LIKE '$Menu'"
);
return( $Result );
}
catch( Exception $e )
{
}
}
| get_menu_list |
( |
|
$Start, |
|
|
|
$Limit |
|
) |
| |
Function returns list of available menues.
- Parameters
-
| $Start | - Cursor of the first selected record. |
| $Limit | - Count of the selected records. |
- Returns
- List of registred menues. Data is returned in next format array( 0 => 'menu number' , 1 => 'menu title' , 'menu_file_path' => 'path to menu file' )
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 329 of file menu_access.php.
{
try
{
$Security =
get_package(
'security' ,
'last' , __FILE__ );
$Start = $Security->get( $Start , 'integer' );
$Limit = $Security->get( $Limit , 'integer' );
$Databse =
get_package(
'database' ,
'last' , __FILE__ );
$Result = $Databse->select( '*' , 'umx_menu' , "$this->AddLimitations LIMIT $Start , $Limit" );
foreach( $Result as $i => $r )
{
$Result[ $i ] = array_merge( array( 'n' => $i + 1 ) , $Result );
}
return( $Result );
}
catch( Exception $e )
{
}
}
| select |
( |
|
$Start, |
|
|
|
$Limit, |
|
|
|
$Field = false, |
|
|
|
$Order = false, |
|
|
|
$Condition = '1 = 1' |
|
) |
| |
Function returns list of records.
- Parameters
-
| $Start | - Number of the first record. |
| $Limit | - Count of records limitation. |
| $Field | - Field to sort by. |
| $Order | - Sorting order. |
| $Condition | - Records selection condition. |
- Returns
- List of records.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 202 of file menu_access.php.
{
try
{
$Condition = $this->DatabaseAlgorithms->select_condition(
$Start , $Limit , $Field , $Order , $Condition , $this->NativeTable
);
}
catch( Exception $e )
{
}
}
| set_add_limitations |
( |
|
$theAddLimitation | ) |
|
Function sets additional limitations.
- Parameters
-
| $theAddLimitation | - Additional limitations. |
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 106 of file menu_access.php.
{
try
{
if( $this->AddLimitations === '1 = 1' )
{
$this->AddLimitations = $theAddLimitation;
}
else
{
throw( new Exception( '"AddLimitations" was already set' ) );
}
}
catch( Exception $e )
{
}
}
| unsafe_select |
( |
|
$Condition | ) |
|
Selecting records.
- Parameters
-
| $Condition | - records selection condition. |
- Returns
- Array of objects.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 147 of file menu_access.php.
{
try
{
$Database =
get_package(
'database' ,
'last' , __FILE__ );
$Records = $Database->select( '*' , $this->NativeTable , "( $this->AddLimitations ) AND $Condition" );
return( $Records );
}
catch( Exception $e )
{
}
}
| update_menu |
( |
|
$OldMenuLocator, |
|
|
|
$NewMenuLocator |
|
) |
| |
Function updates menu.
- Parameters
-
| $OldMenuLocator | - Old menu locator. |
| $NewMenuLocator | - New menu locator. |
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Додонов А.А.
Definition at line 464 of file menu_access.php.
{
try
{
$Security =
get_package(
'security' ,
'last' , __FILE__ );
$OldMenuLocator = $Security->get( $OldMenuLocator , 'command' );
$NewMenuLocator = $Security->get( $NewMenuLocator , 'command' );
$Databse =
get_package(
'database' ,
'last' , __FILE__ );
$Databse->update(
'umx_menu' , array( 'name' ) , array( $NewMenuLocator ) ,
"( $this->AddLimitations ) AND name LIKE '$OldMenuLocator'"
);
$Databse->commit();
}
catch( Exception $e )
{
}
}
Field Documentation
| $AddLimitations = '1 = 1' |
| $DatabaseAlgorithms = false |
| $NativeTable = '`umx_menu`' |
Table name in wich objects of this entity are stored.
- Author
- Dodonov A.A.
Definition at line 38 of file menu_access.php.
The documentation for this class was generated from the following file: