dmBridge PHP API
DMSession Class Reference

Encapsulates a session associated with an incoming HTTP request. More...

Public Member Functions


Detailed Description

Encapsulates a session associated with an incoming HTTP request.

Typically this is populated with the contents of the $_SESSION superglobal upon instantiation.

Author:
Alex Dolski <alex.dolski@unlv.edu> http://www.opensource.org/licenses/mit-license.php

Definition at line 17 of file DMSession.php.


Member Function Documentation

DMSession::addFavorite ( DMObject obj)

Saves a DMObject to the user's favorites.

Must be called before the HTTP header has been output. Duplicate objects will not be saved.

Returns:
void

Definition at line 32 of file DMSession.php.

DMSession::addHasCommented ( DMObject obj)
Parameters:
DMObjectobj
Returns:
void
Since:
0.1

Definition at line 206 of file DMSession.php.

DMSession::addHasRated ( DMObject obj)
Parameters:
DMObjectobj
Since:
0.1

Definition at line 265 of file DMSession.php.

DMSession::addRecentlyViewedObject ( DMObject obj)

Adds an object to the stack of recently viewed objects.

If the given object is the same as the last object in the stack, it is not added.

Parameters:
DMObjectobj

Definition at line 311 of file DMSession.php.

DMSession::deleteFavorites ( array $  objects)

Deletes multiple DMObjects by removing them from the user's cookie and then destroying them.

Must be called before the HTTP header has been output.

Parameters:
arrayobjects Array of DMObjects
Returns:
void

Definition at line 94 of file DMSession.php.

DMSession::getAccessibleFavorites ( DMTemplateSet template_set)

Returns an array of all DMObjects in the user's favorites that are accessible from within the given template set.

Parameters:
DMTemplateSetThe template set in which to search
Returns:
Array of DMObjects, or an empty array if none exist
See also:
getObjects()

Definition at line 64 of file DMSession.php.

DMSession::getAllFavorites ( )

Returns an array of all DMObjects in the user's favorites, whether or not they are accessible within the current template set.

Returns:
Array of DMObjects
See also:
getAccessibleFavorites()

Definition at line 82 of file DMSession.php.

Referenced by getAccessibleFavorites().

DMSession::getFlash ( )

Note: If accessing the flash from the templates, using DMGenericTemplateHelper::getHtmlFormattedFlash() is preferred.

Returns:
DMFlash, or null if it has not been set.
See also:
getFlash()
unsetFlash()
DMGenericTemplateHelper::isFlash()
DMGenericTemplateHelper::drawFormattedFlash()
Since:
0.1

Definition at line 150 of file DMSession.php.

DMSession::getQuery ( )
Returns:
DMQuery, or null if nonexistent
Since:
0.1

Definition at line 282 of file DMSession.php.

DMSession::getRecentlyViewedObjects ( limit)
Parameters:
intlimit
Returns:
array Array of DMObjects, sorted in chronological order. No duplicate objects will be returned.

Definition at line 328 of file DMSession.php.

DMSession::getResultsView ( )
Returns:
DMResultsView
Since:
2.0

Definition at line 351 of file DMSession.php.

DMSession::getSearchInput ( )
Returns:
DMInput, or null if nonexistent
Since:
0.3

Definition at line 377 of file DMSession.php.

DMSession::getUser ( )
Returns:
DMUser object, or null if nonexistent
Since:
0.1

Definition at line 403 of file DMSession.php.

DMSession::hasCommentedOnObject ( DMObject obj)
Parameters:
DMObjectobj
Returns:
Boolean
Since:
0.1

Definition at line 185 of file DMSession.php.

DMSession::hasRated ( )
Returns:
Array of all alias/ptr pairs that have been rated
Since:
0.1

Definition at line 237 of file DMSession.php.

DMSession::hasRatedObject ( DMObject obj)
Parameters:
DMObjectobj
Since:
0.1

Definition at line 247 of file DMSession.php.

DMSession::setFlash ( DMFlash flash)
Parameters:
DMFlashflash
Returns:
void
See also:
unsetFlash()
getFlash()
Since:
0.1

Definition at line 164 of file DMSession.php.

DMSession::setQuery ( DMQuery q)
Parameters:
DMQueryq
Returns:
void
Since:
0.1

Definition at line 293 of file DMSession.php.

DMSession::setResultsView ( DMResultsView view)
Parameters:
stringurl
Returns:
void
Since:
2.0

Definition at line 361 of file DMSession.php.

DMSession::setSearchInput ( DMInput input)
Parameters:
DMInputinput
Returns:
void
Since:
0.3

Definition at line 387 of file DMSession.php.

DMSession::setUser ( DMUser user)
Parameters:
DMUseruser
Since:
0.1

Definition at line 412 of file DMSession.php.

DMSession::unsetFlash ( )
Returns:
void
See also:
getFlash()
setFlash()
DMGenericTemplateHelper::isFlash()
DMGenericTemplateHelper::flash()
Since:
0.1

Definition at line 176 of file DMSession.php.

DMSession::unsetQuery ( )
Returns:
void
Since:
0.1

Definition at line 301 of file DMSession.php.

DMSession::unsetResultsView ( )
Returns:
void
Since:
2.0

Definition at line 369 of file DMSession.php.

DMSession::unsetSearchInput ( )
Returns:
void
Since:
0.3

Definition at line 395 of file DMSession.php.

DMSession::unsetUser ( )
Since:
0.1

Definition at line 419 of file DMSession.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables