Detailed Description
Class provides galeries manipulation routine.
- Author
- Dodonov A.A.
Definition at line 26 of file gallery_algorithms.php.
Constructor & Destructor Documentation
Constructor.
- Author
- Dodonov A.A.
Definition at line 53 of file gallery_algorithms.php.
{
try
{
$this->FileInputAccess =
get_package(
'file_input::file_input_access' ,
'last' , __FILE__ );
$this->GalleryAccess =
get_package(
'gallery::gallery_access' ,
'last' , __FILE__ );
$this->Link =
get_package(
'link' ,
'last' , __FILE__ );
$this->Security =
get_package(
'security' ,
'last' , __FILE__ );
}
catch( Exception $e )
{
}
}
Member Function Documentation
| attach_file |
( |
|
$gid, |
|
|
|
$fid |
|
) |
| |
Function adds file to the gallery.
- Parameters
-
| $gid | - Gallery's id. |
| $fid | - File's id. |
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 218 of file gallery_algorithms.php.
{
try
{
$gid = $this->Security->get( $gid , 'integer' );
$fid = $this->Security->get( $fid , 'integer' );
$this->Link->create_link( $gid, $fid , 'gallery' , 'file' );
}
catch( Exception $e )
{
}
}
| detach_file |
( |
|
$gid, |
|
|
|
$fid |
|
) |
| |
Function deletes file from the gallery.
- Parameters
-
| $gid | - Gallery's id. |
| $fid | - File's id. |
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 255 of file gallery_algorithms.php.
{
try
{
$gid = $this->Security->get( $gid , 'integer' );
$fid = $this->Security->get( $fid , 'integer' );
$this->Link->delete_link( $gid, $fid , 'gallery' , 'file' );
}
catch( Exception $e )
{
}
}
Function returns record by it's id.
- Parameters
-
- Returns
- Record.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 128 of file gallery_algorithms.php.
{
try
{
$id = $this->Security->get( $id , 'integer' );
$Records = $this->GalleryAccess->unsafe_select( $this->GalleryAccess->NativeTable.".id = $id" );
if( count( $Records ) == 0 )
{
throw( new Exception( 'Record was not found' ) );
}
return( $Records[ 0 ] );
}
catch( Exception $e )
{
}
}
| get_gallery_files |
( |
|
$gid | ) |
|
Function returns gallery's files.
- Parameters
-
- Returns
- List of gallery files.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 171 of file gallery_algorithms.php.
{
try
{
$gid = $this->Security->get( $gid , 'integer' );
$Links = $this->Link->get_links( $gid , false , 'gallery' , 'file' );
if( isset( $Ids[ 0 ] ) )
{
return( $this->FileInputAccess->unsafe_select( 'id IN ( '.implode( ',' , $Ids ).' )' ) );
}
else
{
return( array() );
}
}
catch( Exception $e )
{
}
}
Function validates object's existense.
- Parameters
-
- Returns
- true if the object exists.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 90 of file gallery_algorithms.php.
{
try
{
$id = $this->Security->get( $id , 'integer' );
$Records = $this->GalleryAccess->unsafe_select( $this->GalleryAccess->NativeTable.".id = $id" );
return( count( $Records ) === 1 );
}
catch( Exception $e )
{
}
}
Field Documentation
The documentation for this class was generated from the following file: