ultimix
content_algorithms_1_0_0 Class Reference

Public Member Functions

 __construct ()
 object_exists ($id)
 get_by_id ($id)

Data Fields

 $ContentAccess = false
 $Security = false

Detailed Description

Class provides content manipulation routine.

Author
Dodonov A.A.

Definition at line 26 of file content_algorithms.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

Author
Dodonov A.A.

Definition at line 51 of file content_algorithms.php.

{
try
{
$this->ContentAccess = get_package( 'content::content_access' , 'last' , __FILE__ );
$this->Security = get_package( 'security' , 'last' , __FILE__ );
}
catch( Exception $e )
{
$Args = func_get_args();_throw_exception_object( __METHOD__ , $Args , $e );
}
}

Member Function Documentation

get_by_id (   $id)

Function returns record by it's id.

Parameters
$id- Record's id.
Returns
Record.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 124 of file content_algorithms.php.

{
try
{
$id = $this->Security->get( $id , 'integer' );
$Records = $this->ContentAccess->unsafe_select( $this->ContentAccess->NativeTable.".id = $id" );
if( count( $Records ) == 0 )
{
throw( new Exception( 'Record was not found' ) );
}
return( $Records[ 0 ] );
}
catch( Exception $e )
{
$Args = func_get_args();_throw_exception_object( __METHOD__ , $Args , $e );
}
}
object_exists (   $id)

Function validates object's existense.

Parameters
$id- Record's id.
Returns
true if the object exists.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 86 of file content_algorithms.php.

{
try
{
$id = $this->Security->get( $id , 'integer' );
$Records = $this->ContentAccess->unsafe_select( $this->ContentAccess->NativeTable.".id = $id" );
return( count( $Records ) === 1 );
}
catch( Exception $e )
{
$Args = func_get_args();_throw_exception_object( __METHOD__ , $Args , $e );
}
}

Field Documentation

$ContentAccess = false

Cached objects.

Author
Dodonov A.A.

Definition at line 38 of file content_algorithms.php.

$Security = false

Definition at line 39 of file content_algorithms.php.


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