ultimix
graph_data_algorithms_1_0_0 Class Reference

Public Member Functions

 __construct ()
 get_abscissa_range ($UserId, $GraphType)
 get_data_for_range ($UserId, $GraphType, $AbscissaFrom, $AbscissaTo)
 get_abscissa_for_ordinatus ($DataX, $DataY, $Ordinatus)

Data Fields

 $GraphDataAccess = false
 $Security = false
 $SecurityParser = false

Detailed Description

Class provides records access routine.

Author
Dodonov A.A.

Definition at line 26 of file graph_data_algorithms.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

Author
Dodonov A.A.

Definition at line 52 of file graph_data_algorithms.php.

{
try
{
$this->GraphDataAccess = get_package( 'graph::graph_data::graph_data_access' , 'last' , __FILE__ );
$this->Security = get_package( 'security' , 'last' , __FILE__ );
$this->SecurityParser = get_package( 'security::security_parser' , 'last' , __FILE__ );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Member Function Documentation

get_abscissa_for_ordinatus (   $DataX,
  $DataY,
  $Ordinatus 
)

Getting data.

Parameters
$DataX- Absciss values.
$DataY- Ordinatus values.
$Ordinatus- Ordinatus value.
Returns
Data.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 205 of file graph_data_algorithms.php.

{
try
{
foreach( $DataY as $i => $Y )
{
if( $Y == $Ordinatus )
{
return( $DataX[ $i ] );
}
}
throw( new Exception( 'Abscissa was not found' ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
get_abscissa_range (   $UserId,
  $GraphType 
)

Getting range.

Parameters
$UserId- User id.
$GraphType- Graph type.
Returns
Abscissa range.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 92 of file graph_data_algorithms.php.

{
try
{
$UserId = $this->Security->get( $UserId , 'integer' );
$GraphType = $this->Security->get( $GraphType , 'integer' );
$Records = $this->GraphDataAccess->unsafe_select(
"author = $UserId AND graph_type = $GraphType" ,
"MIN( abscissa ) AS `from` , MAX( abscissa ) AS `to`"
);
if( isset( $Records[ 0 ] ) === false || get_field( $Records[ 0 ] , 'from' ) == null )
{
return( false );
}
return(
array( 'from' => get_field( $Records[ 0 ] , 'from' ) , 'to' => get_field( $Records[ 0 ] , 'to' ) )
);
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
get_data_for_range (   $UserId,
  $GraphType,
  $AbscissaFrom,
  $AbscissaTo 
)

Getting range.

Parameters
$UserId- User id.
$GraphType- Graph type.
$AbscissaFrom- Range start.
$AbscissaTo- Range end.
Returns
Data range.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 153 of file graph_data_algorithms.php.

{
try
{
$UserId = $this->Security->get( $UserId , 'integer' );
$GraphType = $this->Security->get( $GraphType , 'integer' );
$AbscissaFrom = $this->Security->get( $AbscissaFrom , 'integer' );
$AbscissaTo = $this->Security->get( $AbscissaTo , 'integer' );
$Records = $this->GraphDataAccess->unsafe_select(
"author = $UserId AND graph_type = $GraphType ".
"AND abscissa >= $AbscissaFrom AND abscissa <= $AbscissaTo ORDER BY abscissa ASC"
);
return( $Records );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Field Documentation

$GraphDataAccess = false

Cached objects.

Author
Dodonov A.A.

Definition at line 38 of file graph_data_algorithms.php.

$Security = false

Definition at line 39 of file graph_data_algorithms.php.

$SecurityParser = false

Definition at line 40 of file graph_data_algorithms.php.


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