|
UNA
|
Public Member Functions | |
| init () | |
| getType () | |
| getTable () | |
| isProfileInitiator () | |
| isProfileContent () | |
| checkAllowedConnect ($iInitiator, $iContent, $isPerformAction=false, $isMutual=false, $isInvertResult=false, $isSwap=false, $isCheckExists=true) | |
| checkAllowedAddConnection ($iInitiator, $iContent, $isPerformAction=false, $isMutual=false, $isInvertResult=false, $isSwap=false, $isCheckExists=true) | |
| checkAllowedRemoveConnection ($iInitiator, $iContent, $isPerformAction=false, $isMutual=false, $isInvertResult=false, $isSwap=false, $isCheckExists=true) | |
| actionAdd ($iContent=0, $iInitiator=false) | |
| actionRemove ($iContent=0, $iInitiator=false) | |
| actionReject ($iContent=0, $iInitiator=false) | |
| outputActionResult ($mixed, $sFormat='json') | |
| addConnection ($iInitiator, $iContent, $aParams=array()) | |
| onAdded ($iInitiator, $iContent, $iMutual) | |
| removeConnection ($iInitiator, $iContent) | |
| onRemoved ($iInitiator, $iContent, $iMutual) | |
| getConnectionsAsArray ($sContentType, $iId1, $iId2, $isMutual=false, $iStart=0, $iLimit=BX_CONNECTIONS_LIST_LIMIT, $iOrder=BX_CONNECTIONS_ORDER_NONE) | |
| getCommonContent ($iInitiator1, $iInitiator2, $isMutual=false, $iStart=0, $iLimit=BX_CONNECTIONS_LIST_LIMIT, $iOrder=BX_CONNECTIONS_ORDER_NONE) | |
| getCommonContentCount ($iInitiator1, $iInitiator2, $isMutual=false) | |
| getConnectedContentCount ($iInitiator, $isMutual=false, $iFromDate=0) | |
| getConnectedContentCountExt ($iInitiator, $isMutual=false, $aParams=[]) | |
| getConnectedInitiatorsCount ($iContent, $isMutual=false) | |
| getConnectedContent ($iInitiator, $isMutual=false, $iStart=0, $iLimit=BX_CONNECTIONS_LIST_LIMIT, $iOrder=BX_CONNECTIONS_ORDER_NONE) | |
| getConnectedContentByType ($iInitiator, $mixedType, $isMutual=false, $iStart=0, $iLimit=BX_CONNECTIONS_LIST_LIMIT, $iOrder=BX_CONNECTIONS_ORDER_NONE) | |
| getConnectedContentSince ($iInitiator, $iDate, $isMutual=false, $iStart=0, $iLimit=BX_CONNECTIONS_LIST_LIMIT, $iOrder=BX_CONNECTIONS_ORDER_NONE) | |
| getConnectedInitiators ($iContent, $isMutual=false, $iStart=0, $iLimit=BX_CONNECTIONS_LIST_LIMIT, $iOrder=BX_CONNECTIONS_ORDER_NONE) | |
| getConnectedInitiatorsByType ($iContent, $mixedType, $isMutual=false, $iStart=0, $iLimit=BX_CONNECTIONS_LIST_LIMIT, $iOrder=BX_CONNECTIONS_ORDER_NONE) | |
| getConnectedInitiatorsSince ($iContent, $iDate, $isMutual=false, $iStart=0, $iLimit=BX_CONNECTIONS_LIST_LIMIT, $iOrder=BX_CONNECTIONS_ORDER_NONE) | |
| getConnectionsAsSQLParts ($sContentType, $sContentTable, $sContentField, $iId1, $iId2, $isMutual=false) | |
| getCommonContentAsSQLParts ($sContentTable, $sContentField, $iInitiator1, $iInitiator2, $isMutual=false) | |
| getConnectedContentAsSQLParts ($sContentTable, $sContentField, $iInitiator, $isMutual=false) | |
| getConnectedContentAsSQLPartsExt ($sContentTable, $sContentField, $iInitiator, $isMutual=false) | |
| getConnectedContentAsSQLPartsMultiple ($sContentTable, $sContentField, $sInitiatorTable, $sInitiatorField, $isMutual=false) | |
| getConnectedInitiatorsAsSQLParts ($sInitiatorTable, $sInitiatorField, $iContent, $isMutual=false) | |
| getConnectedInitiatorsAsSQLPartsMultiple ($sInitiatorTable, $sInitiatorField, $sContentTable, $sContentField, $isMutual=false) | |
| getConnectionsAsCondition ($sContentType, $sContentField, $iId1, $iId2, $isMutual=false) | |
| getCommonContentAsCondition ($sContentField, $iInitiator1, $iInitiator2, $iMutual=false) | |
| getConnectedContentAsCondition ($sContentField, $iInitiator, $iMutual=false) | |
| getConnectedInitiatorsAsCondition ($sContentField, $iContent, $iMutual=false) | |
| isConnected ($iInitiator, $iContent, $isMutual=false) | |
| isConnectedNotMutual ($iInitiator, $iContent) | |
| getConnection ($iInitiator, $iContent) | |
| getConnectionById ($iId) | |
| onDeleteInitiatorAndContent ($iId) | |
| onDeleteInitiator ($iIdInitiator) | |
| onDeleteContent ($iIdContent) | |
| onModuleDeleteInitiatorAndContent ($sTable, $sFieldId) | |
| onModuleDeleteInitiator ($sTable, $sFieldId) | |
| onModuleDeleteContent ($sTable, $sFieldId) | |
| onModuleProfileDeleteInitiatorAndContent ($sModuleName) | |
| onModuleProfileDeleteInitiator ($sModuleName) | |
| onModuleProfileDeleteContent ($sModuleName) | |
Static Public Member Functions | |
| static | getObjectInstance ($sObject) |
Protected Member Functions | |
| __construct ($aObject) | |
| _action ($iInitiator, $iContent, $sMethod, $sErrorKey, $isMutual=false, $isInvert=false) | |
| _checkAllowedConnect ($iInitiator, $iContent, $isPerformAction=false, $isMutual=false, $isInvertResult=false, $isSwap=false, $isCheckExists=true) | |
| _checkAllowedConnectInitiator ($oInitiator, $isPerformAction=false) | |
| _checkAllowedConnectContent ($oContent) | |
| _isTriggerable ($mixedMutual) | |
| _updateTriggerValue ($iInitiator, $iContent, $iValue) | |
| _getTriggerValueByContentType ($sContentType, $iParticipantId) | |
| _getTriggerObject ($sType, $iInitiator, $iContent) | |
Protected Attributes | |
| $_oQuery | |
| $_sObject | |
| $_aObject | |
| $_iInitiator | |
| $_iContent | |
| $_sType | |
| $_bMutual | |
| $_aTriggerTypes | |
Connection is usefull when you need to organize some sorts of connections between different content, for example: friends, contacts, favorites, block lists, subscriptions, etc.
Two types of connections are supported one way connections (block list, favourites) and mutual (friends).
For automatic handling of connections (like, add/remove connection in frontend) refer to JS function:
Step 1: Add record to 'sys_objects_connection' table:
Step 2: Create table for connections:
Check if two profiles are friends:
Get mutual content IDs (friends IDs)
|
protected |
Constructor
| $aObject | array of connection options |
Reimplemented in BxBaseConnection, BxBaseConnectionFriend, BxBaseConnectionRelation, BxBaseConnectionSubscription, BxBaseModGroupsConnectionFans, BxCoursesConnectionFans, BxDolConnectionBan, BxDolConnectionFriend, BxDolConnectionRelation, BxDolConnectionSubscription, BxEventsConnectionFans, BxGroupsConnectionFans, BxJobsConnectionFans, BxOrgsConnectionFans, BxSpacesConnectionFans, BxTemplConnection, BxTemplConnectionFriend, BxTemplConnectionRelation, and BxTemplConnectionSubscription.
|
protected |
Should be overwritten in Connection class which uses triggerable fields.
Reimplemented in BxBaseModGroupsConnectionFans.
| BxDolConnection::actionAdd | ( | $iContent = 0, | |
| $iInitiator = false ) |
Add new connection.
| $iContent | content to make connection to, in most cases some content id, or other profile id in case of friends |
Reimplemented in BxDolConnectionRelation.
| BxDolConnection::actionReject | ( | $iContent = 0, | |
| $iInitiator = false ) |
Reject connection request. This method is wrapper for
| $iContent | content to make connection to, in most cases some content id, or other profile id in case of friends |
Reimplemented in BxBaseModGroupsConnectionFans.
| BxDolConnection::actionRemove | ( | $iContent = 0, | |
| $iInitiator = false ) |
Remove connection. This method is wrapper for
| $iContent | content to make connection to, in most cases some content id, or other profile id in case of friends |
Reimplemented in BxBaseModGroupsConnectionFans, and BxDolConnectionRelation.
| BxDolConnection::addConnection | ( | $iInitiator, | |
| $iContent, | |||
| $aParams = array() ) |
Add new connection.
| $iInitiator | initiator of the connection, in most cases some profile id |
| $iContent | content to make connection to, in most cases some content id, or other profile id in case of friends |
connection_before_addinitiator - [int] by ref, profile id who is creating the connection, can be overridden in hook processingcontent - [int] by ref, profile id with whom the connection is creating, can be overridden in hook processingmutual - [int] by ref, if the relation is mutual or not, can be overridden in hook processingobject - [object] an instance of connection object, object_name - [string] connection object nameoverride_result - [boolean] by ref, stop adding and return specified result
It's equivalent to '{object_name}', 'connection_before_add' - hook before connection was added. Connection params can be overridden
Reimplemented in BxDolConnectionBan, and BxDolConnectionRelation.
| BxDolConnection::checkAllowedConnect | ( | $iInitiator, | |
| $iContent, | |||
| $isPerformAction = false, | |||
| $isMutual = false, | |||
| $isInvertResult = false, | |||
| $isSwap = false, | |||
| $isCheckExists = true ) |
Check whether connection between Initiator and Content can be established.
Reimplemented in BxDolConnectionRelation.
| BxDolConnection::getCommonContent | ( | $iInitiator1, | |
| $iInitiator2, | |||
| $isMutual = false, | |||
| $iStart = 0, | |||
| $iLimit = BX_CONNECTIONS_LIST_LIMIT, | |||
| $iOrder = BX_CONNECTIONS_ORDER_NONE ) |
Get common content IDs between two initiators
| $iInitiator1 | one initiator |
| $iInitiator2 | second initiator |
| $isMutual | get mutual connections only |
| BxDolConnection::getCommonContentAsCondition | ( | $sContentField, | |
| $iInitiator1, | |||
| $iInitiator2, | |||
| $iMutual = false ) |
Get necessary condition array to use connections in search classes
| $sContentField | content table field name |
| $iInitiator | initiator of the connection |
| $iMutual | get mutual connections only |
| BxDolConnection::getCommonContentAsSQLParts | ( | $sContentTable, | |
| $sContentField, | |||
| $iInitiator1, | |||
| $iInitiator2, | |||
| $isMutual = false ) |
Get necessary parts of SQL query to use connections in other queries
| $sContentTable | content table or alias |
| $sContentField | content table field or field alias |
| $iInitiator | initiator of the connection |
| $isMutual | get mutual connections only |
| BxDolConnection::getCommonContentCount | ( | $iInitiator1, | |
| $iInitiator2, | |||
| $isMutual = false ) |
Get common content count between two initiators
| $iInitiator1 | one initiator |
| $iInitiator2 | second initiator |
| $isMutual | get mutual connections only |
| BxDolConnection::getConnectedContent | ( | $iInitiator, | |
| $isMutual = false, | |||
| $iStart = 0, | |||
| $iLimit = BX_CONNECTIONS_LIST_LIMIT, | |||
| $iOrder = BX_CONNECTIONS_ORDER_NONE ) |
Get connected content IDs
| $iInitiator | initiator of the connection |
| $isMutual | get mutual connections only |
| BxDolConnection::getConnectedContentAsCondition | ( | $sContentField, | |
| $iInitiator, | |||
| $iMutual = false ) |
Get necessary condition array to use connections in search classes
| $sContentField | content table field name |
| $iInitiator | initiator of the connection |
| $iMutual | get mutual connections only |
Reimplemented in BxJobsConnectionFans.
| BxDolConnection::getConnectedContentAsSQLParts | ( | $sContentTable, | |
| $sContentField, | |||
| $iInitiator, | |||
| $isMutual = false ) |
Get necessary parts of SQL query to use connections in other queries
| $sContentTable | content table or alias |
| $sContentField | content table field or field alias |
| $iInitiator | initiator of the connection |
| $isMutual | get mutual connections only |
| BxDolConnection::getConnectedContentAsSQLPartsMultiple | ( | $sContentTable, | |
| $sContentField, | |||
| $sInitiatorTable, | |||
| $sInitiatorField, | |||
| $isMutual = false ) |
Get necessary parts of SQL query to use connections in other queries
| $sContentTable | content table or alias |
| $sContentField | content table field or field alias |
| $sInitiatorTable | initiator table or alias |
| $sInitiatorField | initiator table field or field alias |
| $iInitiator | initiator of the connection |
| $isMutual | get mutual connections only |
| BxDolConnection::getConnectedContentByType | ( | $iInitiator, | |
| $mixedType, | |||
| $isMutual = false, | |||
| $iStart = 0, | |||
| $iLimit = BX_CONNECTIONS_LIST_LIMIT, | |||
| $iOrder = BX_CONNECTIONS_ORDER_NONE ) |
Get connected content IDs for specified type
| $iInitiator | initiator of the connection |
| $mixedType | type of content or an array of types |
| $isMutual | get mutual connections only |
| BxDolConnection::getConnectedContentCount | ( | $iInitiator, | |
| $isMutual = false, | |||
| $iFromDate = 0 ) |
Get connected content count
| $iInitiator | initiator of the connection |
| $isMutual | get mutual connections only |
| BxDolConnection::getConnectedContentCountExt | ( | $iInitiator, | |
| $isMutual = false, | |||
| $aParams = [] ) |
Get connected content count
| $iInitiator | initiator of the connection |
| $isMutual | get mutual connections only |
| $aParams | additional params |
| BxDolConnection::getConnectedContentSince | ( | $iInitiator, | |
| $iDate, | |||
| $isMutual = false, | |||
| $iStart = 0, | |||
| $iLimit = BX_CONNECTIONS_LIST_LIMIT, | |||
| $iOrder = BX_CONNECTIONS_ORDER_NONE ) |
Get connected content IDs for specified type
| $iInitiator | initiator of the connection |
| $iDate | get connections appeared since this date |
| $isMutual | get mutual connections only |
| BxDolConnection::getConnectedInitiators | ( | $iContent, | |
| $isMutual = false, | |||
| $iStart = 0, | |||
| $iLimit = BX_CONNECTIONS_LIST_LIMIT, | |||
| $iOrder = BX_CONNECTIONS_ORDER_NONE ) |
Get connected initiators IDs
| $iContent | content of the connection |
| $isMutual | get mutual connections only |
Reimplemented in BxJobsConnectionFans.
| BxDolConnection::getConnectedInitiatorsAsCondition | ( | $sContentField, | |
| $iContent, | |||
| $iMutual = false ) |
Get necessary condition array to use connections in search classes
| $sContentField | content table field name |
| $iInitiator | initiator of the connection |
| $iMutual | get mutual connections only |
| BxDolConnection::getConnectedInitiatorsAsSQLParts | ( | $sInitiatorTable, | |
| $sInitiatorField, | |||
| $iContent, | |||
| $isMutual = false ) |
Get necessary parts of SQL query to use connections in other queries
| $sInitiatorTable | initiator table or alias |
| $sInitiatorField | initiator table field or field alias |
| $iContent | content of the connection |
| $isMutual | get mutual connections only |
| BxDolConnection::getConnectedInitiatorsAsSQLPartsMultiple | ( | $sInitiatorTable, | |
| $sInitiatorField, | |||
| $sContentTable, | |||
| $sContentField, | |||
| $isMutual = false ) |
Get necessary parts of SQL query to use connections in other queries
| $sInitiatorTable | initiator table or alias |
| $sInitiatorField | initiator table field or field alias |
| $sContentTable | content table or alias |
| $sContentField | content table field or field alias |
| $isMutual | get mutual connections only |
| BxDolConnection::getConnectedInitiatorsByType | ( | $iContent, | |
| $mixedType, | |||
| $isMutual = false, | |||
| $iStart = 0, | |||
| $iLimit = BX_CONNECTIONS_LIST_LIMIT, | |||
| $iOrder = BX_CONNECTIONS_ORDER_NONE ) |
Get connected initiators IDs
| $iContent | content of the connection |
| $mixedType | type of content or an array of types |
| $isMutual | get mutual connections only |
| BxDolConnection::getConnectedInitiatorsCount | ( | $iContent, | |
| $isMutual = false ) |
Get connected initiators count
| $iContent | content of the connection |
| $isMutual | get mutual connections only |
Reimplemented in BxJobsConnectionFans.
| BxDolConnection::getConnectedInitiatorsSince | ( | $iContent, | |
| $iDate, | |||
| $isMutual = false, | |||
| $iStart = 0, | |||
| $iLimit = BX_CONNECTIONS_LIST_LIMIT, | |||
| $iOrder = BX_CONNECTIONS_ORDER_NONE ) |
Get connected initiators IDs
| $iContent | content of the connection |
| $iDate | get connections appeared since this date |
| $isMutual | get mutual connections only |
| BxDolConnection::getConnectionsAsArray | ( | $sContentType, | |
| $iId1, | |||
| $iId2, | |||
| $isMutual = false, | |||
| $iStart = 0, | |||
| $iLimit = BX_CONNECTIONS_LIST_LIMIT, | |||
| $iOrder = BX_CONNECTIONS_ORDER_NONE ) |
Compound function, which calls getCommonContent, getConnectedContent or getConnectedInitiators depending on $sContentType
| $sContentType | content type to get BX_CONNECTIONS_CONTENT_TYPE_CONTENT, BX_CONNECTIONS_CONTENT_TYPE_INITIATORS or BX_CONNECTIONS_CONTENT_TYPE_COMMON |
| $iId1 | one content or initiator |
| $iId2 | second content or initiator only in case of BX_CONNECTIONS_CONTENT_TYPE_COMMON content type |
| $isMutual | get mutual connections only |
| BxDolConnection::getConnectionsAsCondition | ( | $sContentType, | |
| $sContentField, | |||
| $iId1, | |||
| $iId2, | |||
| $isMutual = false ) |
Similar to getConnectionsAsArray, but for getCommonContentAsCondition, getConnectedContentAsCondition or getConnectedInitiatorsAsCondition methods
| BxDolConnection::getConnectionsAsSQLParts | ( | $sContentType, | |
| $sContentTable, | |||
| $sContentField, | |||
| $iId1, | |||
| $iId2, | |||
| $isMutual = false ) |
Similar to getConnectionsAsArray, but for getCommonContentAsSQLParts, getConnectedContentAsSQLParts or getConnectedInitiatorsAsSQLParts methods
|
static |
Get connection object instance by object name
| $sObject | object name |
Implements iBxDolFactoryObject.
| BxDolConnection::getTable | ( | ) |
Get connection table. return string with table name.
| BxDolConnection::getType | ( | ) |
Get connection type. return BX_CONNECTIONS_TYPE_ONE_WAY or BX_CONNECTIONS_TYPE_MUTUAL
| BxDolConnection::init | ( | ) |
Init something here if it's needed.
Reimplemented in BxBaseModGroupsConnectionFans.
| BxDolConnection::isConnected | ( | $iInitiator, | |
| $iContent, | |||
| $isMutual = false ) |
Check if initiator and content are connected. In case if friends this function in conjunction with isMutual parameter can be used to check pending friend requests.
| $iInitiator | initiator of the connection |
| $iContent | connected content or other profile id in case of friends |
| BxDolConnection::isConnectedNotMutual | ( | $iInitiator, | |
| $iContent ) |
Check if initiator and content are connected but connetion is not mutual, for checking pending connection requests. This method makes sense only when type of connection is mutual.
| $iInitiator | initiator of the connection |
| $iContent | connected content or other profile id in case of friends |
| BxDolConnection::isProfileContent | ( | ) |
Checks whether connection's Content is profile or not. return boolean.
| BxDolConnection::isProfileInitiator | ( | ) |
Checks whether connection's Initiator is profile or not. return boolean.
| BxDolConnection::onAdded | ( | $iInitiator, | |
| $iContent, | |||
| $iMutual ) |
Call socket.
Update recommendations.
| BxDolConnection::onDeleteContent | ( | $iIdContent | ) |
Must be called when some content is deleted which can have connections as 'content', to delete any associated data
| $iIdInitiator | initiator id |
connection_removed_allcontent - [int] profile id with whom the connection was createdobject - [object] an instance of relation, | BxDolConnection::onDeleteInitiator | ( | $iIdInitiator | ) |
Must be called when some content is deleted which can have connections as 'initiator', to delete any associated data
| $iIdInitiator | initiator id |
connection_removed_allinitiator - [int] profile id who created the connectionobject - [object] an instance of relation, | BxDolConnection::onDeleteInitiatorAndContent | ( | $iId | ) |
Must be called when some content is deleted which can have connections as 'content' or as 'initiator', to delete any associated data
| $iId | which can be as conetnt ot initiator |
| BxDolConnection::onModuleDeleteContent | ( | $sTable, | |
| $sFieldId ) |
Must be called when module (which can have connections as 'content') is deleted, to delete any associated data. This method call may be automated via
| $sTable | table name with data which have assiciations with the connection |
| $sFieldId | id field name which is associated with the connection |
| BxDolConnection::onModuleDeleteInitiator | ( | $sTable, | |
| $sFieldId ) |
Must be called when module (which can have connections as 'initiator') is deleted, to delete any associated data. This method call may be automated via
| $sTable | table name with data which have assiciations with the connection |
| $sFieldId | id field name which is associated with the connection |
| BxDolConnection::onModuleDeleteInitiatorAndContent | ( | $sTable, | |
| $sFieldId ) |
Must be called when module (which can have connections as 'content' or as 'initiator') is deleted, to delete any associated data. This method call may be automated via
| $sTable | table name with data which have assiciations with the connection |
| $sFieldId | id field name which is associated with the connection |
| BxDolConnection::onModuleProfileDeleteContent | ( | $sModuleName | ) |
Must be called when module (which can have connections as 'content' with 'sys_profiles' table) is deleted, to delete any associated data. This method call may be automated via
| $sModuleName | module name to delete connections for |
| BxDolConnection::onModuleProfileDeleteInitiator | ( | $sModuleName | ) |
Must be called when module (which can have connections as 'initiator' with 'sys_profiles' table) is deleted, to delete any associated data. This method call may be automated via
| $sModuleName | module name to delete connections for |
| BxDolConnection::onModuleProfileDeleteInitiatorAndContent | ( | $sModuleName | ) |
Must be called when module (which can have connections as 'content' or as 'initiator' with 'sys_profiles' table) is deleted, to delete any associated data. This method call may be automated via
| $sModuleName | module name to delete connections for |
| BxDolConnection::onRemoved | ( | $iInitiator, | |
| $iContent, | |||
| $iMutual ) |
Call socket.
| BxDolConnection::removeConnection | ( | $iInitiator, | |
| $iContent ) |
Remove connection.
| $iInitiator | initiator of the connection |
| $iContent | connected content or other profile id in case of friends |
connection_before_removeinitiator - [int] by ref, profile id who is removing the connection, can be overridden in hook processingcontent - [int] by ref, profile id with whom the connection is removing, can be overridden in hook processingmutual - [int] by ref, if the relation is mutual or not, can be overridden in hook processingobject - [object] an instance of relation, It's equivalent to '{object_name}', 'connection_before_remove' - hook before connection was removed. Connection params can be overridden