Class ObjectRelation
Object relations model
- Model
- AppModel
- BEAppModel
- ObjectRelation
Methods summary
public
|
|
private static
string[]
|
|
public
array|false
|
#
createRelation( integer $id, integer $objectId, string $switch, integer $priority, boolean $bidirectional = true, array|null $params = array() )
Create relation between objects |
public
array|false
|
#
createRelationAndInverse( integer $id, integer $objectId, string $switch, $inverseSwitch = null, integer $priority = null, array|null $params = array() )
Create direct and inverse relation using $switch and $inverseSwitch names |
public
boolean
|
#
deleteRelation( integer $id, integer $objectId = null, string $switch = null, boolean $bidirectional = true )
delete relation between objects |
public
boolean
|
#
deleteRelationAndInverse( integer $id, integer $objectId = null, string $switch = null, boolean $bidirectional,… )
Delete relations If $objectId is defined remove relations between $id and $objectId else remove all relations of $id If $switch is defined remove relation $switch and its inverse |
public
boolean
|
#
deleteObjectRelation( integer $id, string $switch, string $inverseSwitch = null )
delete a specific relation to an object |
public
false
|
#
updateRelationPriority( integer $id, integer $objectId, string $switch, integer $priority )
Updates priority of a relation between objects. |
public
false
|
#
updateRelationParams( integer $id, integer $objectId, string $switch, array $params = array() )
Updates parameters of a relation between objects. |
public
boolean
|
#
updateRelation( integer $id, integer $objectId, string $switch, array $set )
Update a relation using an array of fields to update $set can contains 'params' and 'priority' If $set['params'] is defined then params is also updated in the inverse relation |
public
true
|
|
public
priority
|
#
relationPriority( integer $id, integer $objectId, string $switch )
Get current priority for a specific relation |
public
parameters
|
#
relationParams( integer $id, integer $objectId, string $switch, boolean $assoc = true )
Get current parameters for a specific relation |
public
array
|
#
availableRelations( string|integer $objectType, array $orderBy = array() )
Returns array of available relations for an $objectType relations with 'hidden' => true are excluded If 'inverse' relation is defined ('inverse' => 'inverseName'), then types on 'right' side will have 'inverseName' relation |
public
array
|
#
sortRelations( array $relations, array $orderBy )
Sort $relations using $orderBy array $relations must be an array with relation name as keys $orderBy must be an array with a list of relation. The order of that list is used to sort the relations. |
public
array
|
#
countRelations( array $objects, array $options )
passed an array of BEdita objects add 'num_of_relations_name' key with the number of each relations passed in options applied to objects |
public
boolean
|
|
public
string|false
|
Methods inherited from BEAppModel
am()
,
buildQueryStatement()
,
checkDate()
,
checkDuration()
,
checkFloat()
,
checkNumber()
,
containLevel()
,
email()
,
fieldsString()
,
findObjects()
,
findObjectsAfterFilter()
,
findObjectsClauses()
,
findObjectsCount()
,
getBindingsLevel()
,
getDefaultDateFormat()
,
getDriver()
,
getEndQuote()
,
getLimitClausole()
,
getStartQuote()
,
setBindingsLevel()
,
setupDbParams()
,
toolbar()