ultimix
db_markup_1_0_0 Class Reference

Public Member Functions

 __construct ()
 compile_query_field (&$Settings)
 compile_record_field (&$Settings)

Data Fields

 $Database = false
 $String = false
 $Utilities = false

Detailed Description

Class processes data access macro.

Author
Dodonov A.A.

Definition at line 26 of file db_markup.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

Author
Dodonov A.A.

Definition at line 53 of file db_markup.php.

{
try
{
$this->Database = get_package( 'database' , 'last' , __FILE__ );
$this->String = get_package( 'string' , 'last' , __FILE__ );
$this->Utilities = get_package( 'utilities' , 'last' , __FILE__ );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Member Function Documentation

compile_query_field ( $Settings)

Function returns field value.

Parameters
$Settings- Extraction parameters.
Returns
Field value.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 89 of file db_markup.php.

{
try
{
$Result = $this->Database->query( $Settings->get_setting( 'query' ) );
$Result = $this->Database->fetch_results( $Result );
if( isset( $Result[ 0 ] ) )
{
$Result = $Result[ 0 ];
}
else
{
throw( new Exception( "No data found for the query \"$Query\"" ) );
}
return( get_field( $Result , $Settings->get_setting( 'field' ) ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_record_field ( $Settings)

Function returns field value.

Parameters
$Settings- Extraction parameters.
Returns
Field value.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 135 of file db_markup.php.

{
try
{
$Value = '';
$id = $Settings->get_setting( 'id' );
if( $id != '0' )
{
$PackageObject = $this->Utilities->get_package( $Settings , __FILE__ , 'access_' );
if( method_exists( $PackageObject , 'get_by_id' ) == false )
{
$Message = 'The method "get_by_id" was not found in class '.get_class( $PackageObject );
throw( new Exception( $Message ) );
}
$Record = call_user_func( array( $PackageObject , 'get_by_id' ) , $id );
$Field = $Settings->get_setting( 'field' );
$Value = get_field( $Record , $Field );
}
return( $Value );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Field Documentation

$Database = false

Cached objects.

Author
Dodonov A.A.

Definition at line 39 of file db_markup.php.

$String = false

Definition at line 40 of file db_markup.php.

$Utilities = false

Definition at line 41 of file db_markup.php.


The documentation for this class was generated from the following file: