IP.Board  3.3.0
classes_like_composite Class Reference

Composite class, holds main functionality. More...

Inheritance diagram for classes_like_composite:
like_blog_blog_composite like_blog_entries_composite like_calendar_calendars_composite like_calendar_events_composite like_ccs_composite like_downloads_categories_composite like_downloads_files_composite like_forums_forums_composite like_forums_topics_composite like_gallery_albums_composite like_gallery_images_composite

Public Member Functions

 add ($relId, $memberId, array $notifyOpts, $isAnon=0)
 allowedFrequencies ()
 buildNotificationData ($data, $type)
 excludeNotification ($row)
 getCount ($relId)
 getDataByAreaAndLastSentOlderThanDate ($date, $types=array(), $parseMembers=false, $sendMax=null)
 getDataByMemberIdAndArea ($memberId, $limit=500)
 getDataByMemberIdAndRelationshipId ($relId, $memberId, $checkNotVisibleToo=false)
 getDataByRelationshipId ($relId, $skipAnon=true, $ignoreData=array(), $followType=array())
 getDataForSetDialogue ($relid)
 getDataJoins ($field='l.like_rel_id')
 getNotifyType ()
 getTitleFromId ($relId)
 getUrlFromId ($relId)
 getVernacular ()
 init ()
 isLiked ($relId, $memberId, $checkNotVisibleToo=false)
 notificationCanSend ($metaData)
 remove ($relId, $memberId=null)
 removeByMemberId ($memberId)
 render ($view, $relId, $opts=array(), $memberId=null)
 sendDigestNotifications ($type, $sendMax=null)
 sendNotifications ($relId, $type, $notificationOpts=array(), &$sentToIds=array())
 skin ()
 templatePrefix ()
 toggleVisibility ($relId, $visible=true)

Protected Member Functions

 _cleanNotifyOptions (array $notifyOpts)
 _formatNameString (array $data)

Protected Attributes

 $_app
 $_area
 $cache
 $caches
 $DB
 $lang
 $likeCache = null
 $member
 $memberData
 $registry
 $request
 $settings

Detailed Description

Composite class, holds main functionality.

Author:
Matt

Member Function Documentation

_cleanNotifyOptions ( array $  notifyOpts) [protected]

Clean the notification options to make sure they're all nice and fluffy

Parameters:
array$notifyOptsNotification options
Returns:
array Cleaned notification options array
_formatNameString ( array $  data) [protected]

Formats the Bob, Bill, Joe and 2038 Others Hate You

Parameters:
array$dataLikes data
Returns:
string Formatted names
add ( relId,
memberId,
array $  notifyOpts,
isAnon = 0 
)

Add a like

Parameters:
integer$relIdRelationship ID
integer$memberIDMember ID of user being added
array$notifyOptsNotification options
integer$isAnonAnonymous flag
Returns:
boolean
buildNotificationData ( data,
type 
)

Builds the notification data via the app class

Parameters:
array$datalike_ DB data and like owner member data
string$typeTypes of notifications to send
Returns:
array array( notification_key, notification_url, email_template, email_subject, build_message_array )
See also:
allowedFrequencies()

Reimplemented in like_forums_topics_composite, and like_forums_forums_composite.

excludeNotification ( row)

Function to let plugins determine if a notification should not be sent. Return false to send notification, or true to skip sending it.

Parameters:
arrayNotification data
Returns:
bool

Reimplemented in like_forums_topics_composite.

getCount ( relId)

Return number of people who 'like' the item

Parameters:
integer$relIdRelationship ID
Returns:
integer
getDataByAreaAndLastSentOlderThanDate ( date,
types = array(),
parseMembers = false,
sendMax = null 
)

Get data based on an area and last sent greater than date [unix timestampe]

Parameters:
integer$dateUnix timestamp
array$typesArray of notification types (optional)
array$parseMembersParse extra data for each member and build display photo (false is default)
integer$sendMaxNull (use ipsRegistry::$setting or send INT only)
Returns:
mixed Array of likes data OR null
See also:
allowedFrequencies()
getDataByMemberIdAndArea ( memberId,
limit = 500 
)

Get data based on a member ID

Parameters:
integer$memberIdMember ID
integer$limitMax results
Returns:
mixed Array of likes data OR null
getDataByMemberIdAndRelationshipId ( relId,
memberId,
checkNotVisibleToo = false 
)

Get data based on a relationship ID and a member ID

Parameters:
mixed$relIdRelationship IDs (int|array)
integer$memberIdMember ID
boolean$checkNotVisibleTooreturn a match even if not visible to the user
Returns:
mixed Array of likes data OR null
getDataByRelationshipId ( relId,
skipAnon = true,
ignoreData = array(),
followType = array() 
)

Get data based on a relationship ID

Parameters:
integer$relIdRelationship ID
boolean$skipAnonSkip anonymous rows flag
array
arrayType of follow (immediate, none, offline, daily, etc)
Returns:
mixed Array of likes data OR null
getDataForSetDialogue ( relid)

Fetch form data for set dialogue

Parameters:
integer$relIdRelationship ID
Returns:
array
getDataJoins ( field = 'l.like_rel_id')

Fetches joins for fetching data

Parameters:
string$fieldDB field name (defaults to 'l.like_rel_id')
Returns:
array

Reimplemented in like_forums_topics_composite, and like_forums_forums_composite.

getTitleFromId ( relId)

Return the title based on the passed id

Parameters:
mixed$relIdRelationship ID or array of IDs
Returns:
mixed Title or array of titles

Reimplemented in like_gallery_albums_composite.

getUrlFromId ( relId)

Return the URL based on the passed id

Parameters:
mixed$relIdRelationship ID or array of IDs
Returns:
mixed URL or array of URLs

Reimplemented in like_gallery_albums_composite.

init ( )

Init all. Yes, it is.

Returns:
void
isLiked ( relId,
memberId,
checkNotVisibleToo = false 
)

Has this user made this item a like already dudes?

Parameters:
mixed$relIdRelationship IDs (int|array)
integer$memberIdMember ID
boolean$checkNotVisibleTooreturn a match even if not visible to the user
Returns:
boolean
notificationCanSend ( metaData)

Check notifications that are to be sent to make sure they're valid and that

Parameters:
array$metaDatalike_ DB data and like owner member data
Returns:
boolean

Reimplemented in like_forums_forums_composite, and like_forums_topics_composite.

remove ( relId,
memberId = null 
)

Removes a like

Parameters:
mixed$relIdRelationship IDs (int|array)
integer$memberIdOptional - If supplied, it'll remove that member rel. or it will remove all
Returns:
boolean
removeByMemberId ( memberId)

Removes all likes based on member ID

Parameters:
integer$memberIdMember ID
Returns:
boolean
render ( view,
relId,
opts = array(),
memberId = null 
)

Render a view

Parameters:
string$viewType of View
integer$relIdRelationship ID
array$optsOptions
integer$memberIdMember ID
Returns:
string Formatted HTML
sendDigestNotifications ( type,
sendMax = null 
)

Send digest notifications to anyone subscribed to item

Parameters:
string$typeTypes of notifications to send (Possible: daily, weekly)
integer$sendMaxNull (use ipsRegistry::$setting or send INT only)
Returns:
boolean
See also:
allowedFrequencies()
sendNotifications ( relId,
type,
notificationOpts = array(),
&$  sentToIds = array() 
)

Send notifications to anyone subscribed to item

Parameters:
integer$relIdRelationship ID
array$typeTypes of notifications to send (Possible: immediate, offline, daily, weekly)
array$notificationOptsNotification options [Keys: notification_key, notification_url, email_template, email_subject, build_message_array, from (optional), ignore_data( type => ids )]
array$sentToIdsPass a value by reference to get the ID numbers of members that were sent a notification
Returns:
boolean
See also:
allowedFrequencies()

Fetch the template prefix. This allows you to have two follow implementations in one skin file (i.e. skin_calendars -> eventLikeMoreDialog() and skin_calendars -> calendarLikeMoreDialog())

Returns:
string

Reimplemented in like_calendar_calendars_composite, and like_calendar_events_composite.

toggleVisibility ( relId,
visible = true 
)

Toggle visibility

Parameters:
mixed$relIdRelationship ID or array ids
boolean$visibleVisible (true) or not (false)
Returns:
boolean

Field Documentation

$_app [protected]

Application key

$_area [protected]

Area key

$likeCache = null [protected]

Cache object


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