dmBridge PHP API
DMPDODataStore Class Reference

An instance of this class will be returned by DMDataStoreFactory::getDataStore() when PDO is the current data store. More...

Inheritance diagram for DMPDODataStore:

Public Member Functions

Static Protected Attributes


Detailed Description

An instance of this class will be returned by DMDataStoreFactory::getDataStore() when PDO is the current data store.

This class contains a lot of accessors that can be safely inherited by most subclasses because they use database-agnostic SQL. Concrete instances of this class should feel free to override whatever ones they need to.

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

Definition at line 19 of file DMPDODataStore.php.


Member Function Documentation

DMPDODataStore::addObjectComment ( DMObject obj,
DMComment comment 
) [final]
Parameters:
DMObjectobj
DMCommentcomment
Returns:
Boolean

Definition at line 442 of file DMPDODataStore.php.

DMPDODataStore::addObjectRating ( DMObject obj,
DMRating rating 
) [final]
Parameters:
DMObjectobj
DMRatingrating
Returns:
Boolean
Since:
0.3

Definition at line 678 of file DMPDODataStore.php.

DMPDODataStore::addObjectTag ( DMObject obj,
DMTag tag 
) [final]
Parameters:
DMObjectobj
DMTagtag
Returns:
Boolean

Definition at line 1032 of file DMPDODataStore.php.

DMPDODataStore::commentTableExists ( )
Returns:
Boolean

Definition at line 130 of file DMPDODataStore.php.

DMPDODataStore::createTables ( )
Exceptions:
DMPDOException
Returns:
void

Definition at line 78 of file DMPDODataStore.php.

DMPDODataStore::deleteAllTagsWithValue ( value)

Deletes all tags with the given value.

Parameters:
stringvalue
Returns:
int The number of tags deleted

Definition at line 1019 of file DMPDODataStore.php.

DMPDODataStore::deleteComment ( DMComment comment)
Parameters:
DMCommentcomment
Returns:
Boolean

Definition at line 315 of file DMPDODataStore.php.

DMPDODataStore::deleteTag ( DMTag tag)
Parameters:
DMTagtag
Returns:
Boolean

Definition at line 1158 of file DMPDODataStore.php.

DMPDODataStore::filterObjectsWithRatingsBetween ( array $  input_objects,
min,
max 
) [final]
Parameters:
arrayinput_objects Array of DMObjects
intmin
intmax
Returns:
array Array of DMObjects

Definition at line 766 of file DMPDODataStore.php.

DMPDODataStore::getAllRatingsForObject ( DMObject obj) [final]
Parameters:
DMObjectobj
Returns:
Indexed array of DMRating objects, or an empty array if there are none
Since:
0.3

Definition at line 519 of file DMPDODataStore.php.

DMPDODataStore::getApprovedCommentsForObject ( DMObject obj,
page,
rpp,
sort = true 
) [final]
Parameters:
DMObjectobj
intpage
intrpp Results per page
Boolean|nullsort True for ascending, false for descending, null for no sort
Returns:
array Array of DMComment objects

Definition at line 287 of file DMPDODataStore.php.

DMPDODataStore::getCommentsForQuery ( DMCommentQuery query,
count 
)
Parameters:
DMCommentQueryquery
boolcount Whether to get the result count (true) or just the results
Returns:
Array of DMComment objects, or int, depending on the query

Definition at line 192 of file DMPDODataStore.php.

DMPDODataStore::getHighestRatedObjects ( array $  collections,
page,
limit,
&$  total 
) [final]
Parameters:
arraycollections Array of DMCollections
intpage
intlimit
inttotal Returned by reference
Returns:
array Array of DMObjects
Since:
1.0

Definition at line 540 of file DMPDODataStore.php.

DMPDODataStore::getMeanNumCommentsPerObjectInCollection ( DMCollection col) [final]
Parameters:
DMCollectioncol
Returns:
float

Definition at line 380 of file DMPDODataStore.php.

DMPDODataStore::getMeanNumRatingsPerObjectInCollection ( DMCollection col)
Parameters:
DMCollectioncol
Returns:
float

Definition at line 583 of file DMPDODataStore.php.

DMPDODataStore::getMeanNumTagsPerObjectInCollection ( DMCollection col)
Parameters:
DMCollectioncol
Returns:
float

Definition at line 1076 of file DMPDODataStore.php.

DMPDODataStore::getMedianNumCommentsPerObjectInCollection ( DMCollection col) [final]
Parameters:
DMCollectioncol
Returns:
int

Definition at line 397 of file DMPDODataStore.php.

DMPDODataStore::getMedianNumRatingsPerObjectInCollection ( DMCollection col) [final]
Parameters:
DMCollectioncol
Returns:
int

Definition at line 596 of file DMPDODataStore.php.

DMPDODataStore::getMedianNumTagsPerObjectInCollection ( DMCollection col) [final]
Parameters:
DMCollectioncol
Returns:
int

Definition at line 1092 of file DMPDODataStore.php.

DMPDODataStore::getNumObjectsWithApprovedComments ( )
Returns:
int

Definition at line 427 of file DMPDODataStore.php.

DMPDODataStore::getNumObjectsWithApprovedTags ( )
Returns:
int

Definition at line 1122 of file DMPDODataStore.php.

DMPDODataStore::getNumObjectsWithRatings ( )
Returns:
int

Definition at line 626 of file DMPDODataStore.php.

DMPDODataStore::getNumRatings ( ) [final]
Returns:
int
Since:
0.3

Definition at line 639 of file DMPDODataStore.php.

DMPDODataStore::getNumRatingsForObject ( DMObject obj) [final]
Parameters:
DMObjectobj
Returns:
integer
Since:
0.3

Definition at line 650 of file DMPDODataStore.php.

DMPDODataStore::getNumRatingsInCollection ( DMCollection c)
Parameters:
DMCollectionc
Returns:
int

Definition at line 665 of file DMPDODataStore.php.

Referenced by getMeanNumRatingsPerObjectInCollection().

DMPDODataStore::getObjectsWithHighestRatings ( limit)
Parameters:
intlimit
Returns:
array of DMObjects, or an empty array if no ratings exist for any object

Definition at line 702 of file DMPDODataStore.php.

DMPDODataStore::getObjectsWithLowestRatings ( limit)
Parameters:
intlimit
Returns:
array of DMObjects, or an empty array if no tags exist for any object

Definition at line 723 of file DMPDODataStore.php.

DMPDODataStore::getObjectsWithMostComments ( limit)
Parameters:
limitinteger
Returns:
array of DMObjects, or an empty array if no comments exist for any object

Definition at line 493 of file DMPDODataStore.php.

DMPDODataStore::getObjectsWithMostRatings ( limit)
Parameters:
intlimit
Returns:
array of DMObjects, or an empty array if no tags exist for any object

Definition at line 744 of file DMPDODataStore.php.

DMPDODataStore::getObjectsWithMostTags ( limit)
Parameters:
intlimit
Returns:
array of DMObjects, or an empty array if no tags exist for any object

Definition at line 1137 of file DMPDODataStore.php.

DMPDODataStore::getRatingForObject ( DMObject obj) [final]
Parameters:
DMObjectobj
Returns:
integer
Since:
0.3

Definition at line 798 of file DMPDODataStore.php.

DMPDODataStore::getTagsForQueryAsCounts ( DMTagQuery query,
count 
)
Parameters:
DMTagQueryquery
boolcount Whether to return the result count, or the result
Returns:
Array of DMTag objects, or associative array of tag count => value pairs, or int, depending on the tag query

Definition at line 817 of file DMPDODataStore.php.

DMPDODataStore::getTagsForQueryAsObjects ( DMTagQuery query,
count 
)
Parameters:
DMTagQueryquery
boolcount Whether to return the result count, or the result
Returns:
Array of DMTag objects, or associative array of tag count => value pairs, or int, depending on the tag query

Definition at line 916 of file DMPDODataStore.php.

DMPDODataStore::isAvailable ( )
Exceptions:
DMPDOException
Returns:
Boolean
Since:
0.3

Definition at line 48 of file DMPDODataStore.php.

DMPDODataStore::loadComment ( id) [final]
Parameters:
intid The ID of the comment to load
Returns:
DMComment
Exceptions:
DMPDOException
DMUnavailableModelException
Since:
0.3

Definition at line 328 of file DMPDODataStore.php.

Referenced by getApprovedCommentsForObject(), and getCommentsForQuery().

DMPDODataStore::loadTag ( id) [final]
Parameters:
intid The ID of the tag to load
Returns:
DMTag
Exceptions:
DMUnavailableModelException

Definition at line 1169 of file DMPDODataStore.php.

Referenced by getTagsForQueryAsObjects().

DMPDODataStore::ratingTableExists ( )
Returns:
Boolean

Definition at line 137 of file DMPDODataStore.php.

DMPDODataStore::saveComment ( DMComment comment) [final]
Parameters:
DMCommentcomment
Returns:
Boolean
Exceptions:
DMPDOException
Since:
0.3

Definition at line 362 of file DMPDODataStore.php.

DMPDODataStore::saveTag ( DMTag tag) [final]
Parameters:
DMTagtag
Returns:
Boolean
Exceptions:
DMPDOException

Definition at line 1197 of file DMPDODataStore.php.

DMPDODataStore::setDBName ( name) [final]
Parameters:
stringname

Definition at line 98 of file DMPDODataStore.php.

DMPDODataStore::tagTableExists ( )
Returns:
Boolean

Definition at line 144 of file DMPDODataStore.php.

DMPDODataStore::write ( sql,
array $  params 
)
Parameters:
stringsql
arrayparams Array of bound parameters, in :param => value format
Returns:
int Number of affected rows
Exceptions:
DMPDOException
Since:
0.3

Definition at line 173 of file DMPDODataStore.php.

Referenced by addObjectComment(), addObjectRating(), addObjectTag(), deleteAllTagsWithValue(), deleteComment(), deleteTag(), saveComment(), and saveTag().


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