ultimix

- Main Page
- Data Structures
- Files
- Examples

- Data Structures
- Data Structure Index
- Data Fields

Public Member Functions | Data Fields
site_algorithms_1_0_0 Class Reference

## Public Member Functions
| __construct ()
| get_by_id ($id)

## Data Fields
| $Security = false
| $SiteAccess = false

## Detailed Description

Class provides records access routine.

Author
  Dodonov A.A.

Definition at line 26 of file site_algorithms.php.

## Constructor & Destructor Documentation

__construct | ( |  | ) |

Constructor.

Author
  Dodonov A.A.

Definition at line 51 of file site_algorithms.php.

{
try
{
$this->Security = get_package( 'security' , 'last' , __FILE__ );
$this->SiteAccess = get_package( 'site::site_access' , 'last' , __FILE__ );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

## Member Function Documentation

get_by_id | ( |  | $id | ) |

Function returns user by it's id.

Parameters

  $id | - Id of the searching user.

Returns
  User object.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 86 of file site_algorithms.php.

{
try
{
$id = $this->Security->get( $id , 'integer' );
$Sites = $this->SiteAccess->unsafe_select( $this->SiteAccess->NativeTable.".id = $id" );
if( count( $Sites ) === 0 || count( $Sites ) > 1 )
{
throw( new Exception( 'Site with id '.$id.' was not found' ) );
}
else
{
return( $Sites[ 0 ] );
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

## Field Documentation

$Security = false

Cached objects.

Author
  Dodonov A.A.

Definition at line 38 of file site_algorithms.php.

$SiteAccess = false

Definition at line 39 of file site_algorithms.php.

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

- packages/site/packages/site_algorithms/site_algorithms.php