phpDocumentor ImageBlock
Classes
[ class tree: ImageBlock ] [ index: ImageBlock ] [ all elements ]

Class: ImageBlockHelper

Source Location: /modules/imageblock/classes/ImageBlockHelper.class

Class ImageBlockHelper

Method Summary
GalleryStatus   cacheViewableTree()   Cache viewable data for user
array   fetchViewableData()   Fetch item data for use in image block
array   getDisabledFlag()   Get the disabled flag for an item
int   getRandomKey()   Get a random number that can be used to search later
array   getRandomKeyRange()   Determine the highest and lowest numbers currently in the random index.
void   handleEvent()   Event handler for Gallery::ViewableTreeChange, GalleryEntity::save, and GalleryEntity::delete
GalleryStatus   loadImageBlocks()   Load image block data into template.
GalleryStatus   setDisabledFlag()   Set the disabled flag for an album
array   _buildOrderBy()   Build the 'ORDER BY' section of the fetchViewableData query
void   _getBlockData()  
void   _isCached()  
void   _runQuery()  

[ Top ]
Methods
cacheViewableTree  [line 704]

  GalleryStatus cacheViewableTree( int $userId  )

Cache viewable data for user

Parameters:
int   $userId: 

API Tags:
Return:  a status code

Information Tags:
Todo:  Respect DisabledMap on INSERT such that we don't have to join the DisabledMap on SELECT

[ Top ]
fetchViewableData  [line 502]

  array fetchViewableData( string $itemType, string $order, int $count, [int $parentId = null], [int $userId = null]  )

Fetch item data for use in image block

Parameters:
string   $itemType: 
string   $order:  the order type (random, recent, viewed, daily, weekly, monthly)
int   $count:  how many items to select
int   $parentId:  limit item selection to descendents of this item (optional)
int   $userId:  user id for permissions check (optional; defaults to current user)

API Tags:
Return:  GalleryStatus a status code array of arrays containing id, viewCount of items (empty array if none found)


[ Top ]
getDisabledFlag  [line 984]

  array getDisabledFlag( int $itemId  )

Get the disabled flag for an item

Parameters:
int   $itemId:  entityId of a GalleryItem for which the flag is to be retrieved

API Tags:
Return:  GalleryStatus a status code boolean disabledFlag for the GalleryDataItem


[ Top ]
getRandomKey  [line 1004]

  int getRandomKey( [ $min = 0], [ $max = 2147483647], int $min(optional), int $max(optional)  )

Get a random number that can be used to search later

Parameters:
int   $min(optional):  the minimum number to generate (default: 0)
int   $max(optional):  the maximim number to generate (default: 2147483647)
   $min: 
   $max: 

API Tags:
Return:  a number between 0 and 2147483647.


[ Top ]
getRandomKeyRange  [line 1027]

  array getRandomKeyRange( int $userId, int $itemType, [string $parentSequence = null]  )

Determine the highest and lowest numbers currently in the random index.

Parameters:
int   $userId:  User id
int   $itemType:  ImageBlock itemType
string   $parentSequence:  (optional) Optional parent sequence condition

API Tags:
Return:  GalleryStatus a status code array int Minimum value of the random number to be genereated int Maximum value of the random number to be generated


[ Top ]
handleEvent  [line 767]

  void handleEvent( $event  )

Event handler for Gallery::ViewableTreeChange, GalleryEntity::save, and GalleryEntity::delete

Parameters:
   $event: 

API Tags:
See:  GalleryEventListener::handleEvent


[ Top ]
loadImageBlocks  [line 44]

  GalleryStatus loadImageBlocks( &$template, array $params, GalleryTemplate $template  )

Load image block data into template.

Parameters:
GalleryTemplate   $template: 
array   $params:  (optional) image block parameters (to override module settings)
   &$template: 

API Tags:
Return:  a status code


[ Top ]
setDisabledFlag  [line 892]

  GalleryStatus setDisabledFlag( GalleryAlbumItem $parentAlbum, boolean $recursive, boolean $disabled, [boolean $useProgressBar = false]  )

Set the disabled flag for an album

Parameters:
GalleryAlbumItem   $parentAlbum:  AlbumItem which is to be flagged
boolean   $recursive:  whether to set the disabledFlag recursively to all subalbums
boolean   $disabled:  whether to set the disabledFlag to true or to false
boolean   $useProgressBar:  (optional) use a progressbar during update? (default=false)

API Tags:
Return:  a status code


[ Top ]
_buildOrderBy  [line 643]

  array _buildOrderBy( string $order  )

Build the 'ORDER BY' section of the fetchViewableData query

Parameters:
string   $order:  the order type (random, recent, viewed)

API Tags:
Return:  GalleryStatus a status code string containing SQL ORDER BY statement


[ Top ]
_getBlockData  [line 215]

  void _getBlockData( $itemType, $order, $count, [ $parentId = null], [ $fullSize = false], [ $userId = null], [ $maxSize = null], [ $biggerOnly = false]  )

Parameters:
   $itemType: 
   $order: 
   $count: 
   $parentId: 
   $fullSize: 
   $userId: 
   $maxSize: 
   $biggerOnly: 

API Tags:
Access:  private


[ Top ]
_isCached  [line 686]

  void _isCached( $userId  )

Parameters:
   $userId: 

API Tags:
Access:  private


[ Top ]
_runQuery  [line 666]

  void _runQuery( $query, $data  )

Parameters:
   $query: 
   $data: 

API Tags:
Access:  private


[ Top ]

Documentation generated on Fri, 08 Oct 2010 05:18:50 -0700 by phpDocumentor 1.3.0RC6