Detailed Description
Class provides records access routine.
- Author
- Dodonov A.A.
Definition at line 26 of file graph_data_algorithms.php.
Constructor & Destructor Documentation
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 )
{
}
}
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
-
| Exception | An 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 )
{
}
}
| get_abscissa_range |
( |
|
$UserId, |
|
|
|
$GraphType |
|
) |
| |
Getting range.
- Parameters
-
| $UserId | - User id. |
| $GraphType | - Graph type. |
- Returns
- Abscissa range.
- Exceptions
-
| Exception | An 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 )
{
}
}
| 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
-
| Exception | An 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 )
{
}
}
Field Documentation
The documentation for this class was generated from the following file: