BEdita API doc | 4-cactus
  • Class
  • Tree
  • Deprecated
  • Download

Classes

  • Addon
  • AddressbookController
  • AddressbookShell
  • AdminController
  • Alias
  • Annotation
  • ApiAuthComponent
  • ApiBaseController
  • ApiFormatterComponent
  • ApiUploadComponent
  • ApiValidatorComponent
  • AppController
  • AppError
  • AppHelper
  • Application
  • AppModel
  • Area
  • AreasController
  • Audio
  • AuthenticationsController
  • BannedIp
  • BEAppModel
  • BEAppObjectModel
  • BeAuthComponent
  • BeAuthFacebookComponent
  • BeAuthGoogleComponent
  • BeAuthTwitterComponent
  • BeCallbackManager
  • BeConfigure
  • BeCustomPropertyComponent
  • BeditaAnnotationModel
  • BeditaBaseShell
  • BeditaCollectionModel
  • BeditaContentModel
  • BeditaExportFilter
  • BeditaImportFilter
  • BeditaObjectModel
  • BeditaProductModel
  • BeditaShell
  • BeditaSimpleObjectModel
  • BeditaSimpleStreamModel
  • BeditaStreamModel
  • BeEmbedFlashHelper
  • BeEmbedHtml5Helper
  • BeEmbedMediaHelper
  • BeErrorCode
  • BeExceptionHandler
  • BEFile
  • BeFileHandlerComponent
  • BeFormHelper
  • BeFrontHelper
  • BeHashComponent
  • BeHtmlHelper
  • BeLangTextComponent
  • BeLib
  • BeMailComponent
  • BEObject
  • BeObjectCache
  • BePaginatorToolbarHelper
  • BeSchema
  • BeSecurityComponent
  • BeSystem
  • BeSystemComponent
  • BeThumb
  • BeTimeHelper
  • BeToolbarHelper
  • BeTreeComponent
  • BeTreeHelper
  • BeUploadToObjComponent
  • BeurlHelper
  • BeVimeoComponent
  • BeYoutubeComponent
  • BuildFilterBehavior
  • CacheableBehavior
  • CacheShell
  • CallbackBehavior
  • CaptchaComponent
  • Caption
  • CaptionsBehavior
  • Card
  • CardsImportFilter
  • Category
  • CleanupDataTask
  • CleanupTask
  • Comment
  • CommentsController
  • CompactResultBehavior
  • Content
  • CreateIndexFieldsBehavior
  • DataShell
  • DataTransfer
  • DateItem
  • DbadminShell
  • DeleteDependentObjectBehavior
  • DeleteObjectBehavior
  • DeployShell
  • Document
  • DocumentsController
  • DumpModel
  • EditorialContentsShell
  • EditorNote
  • Event
  • EventLog
  • EventsController
  • FilesController
  • ForeignDependenceSaveBehavior
  • FrontendController
  • FrontendShell
  • GalleriesController
  • Gallery
  • GeoTag
  • GettextShell
  • Git
  • GravatarHelper
  • Group
  • HashJob
  • History
  • HomeController
  • Image
  • ImageInfoHelper
  • JsonExportFilter
  • JsonImportFilter
  • JsonView
  • LangText
  • Link
  • MailGroup
  • MailGroupCard
  • MailJob
  • MailLog
  • MailMessage
  • MailShell
  • MailTemplate
  • Mask
  • MediaShell
  • MigrateDumpModel
  • MigrateShell
  • Migration
  • MigrationBase
  • MigrationDateItemsShell
  • Module
  • ModulesController
  • ModuleShell
  • MultimediaController
  • NewsController
  • NewsletterController
  • NewsletterShell
  • NotifyBehavior
  • ObjectEditor
  • ObjectProperty
  • ObjectRelation
  • ObjectType
  • ObjectUser
  • PagesController
  • Permission
  • PermissionModule
  • PermsHelper
  • Product
  • Property
  • PropertyOption
  • PublicationShell
  • RedisShell
  • RelationCheck
  • RelationRepair
  • RelationShell
  • RelationStats
  • RemoveDummyNameBehavior
  • ResponseHandlerComponent
  • RestClientModel
  • Revision
  • RevisionObjectBehavior
  • SearchText
  • SearchTextSaveBehavior
  • Section
  • SectionDummy
  • SessionFilterComponent
  • SessionFilterHelper
  • ShortNews
  • SmartyView
  • SoapClientModel
  • SplitterSql
  • StatisticsController
  • Stream
  • StreamLog
  • StreamsController
  • Svn
  • TagsController
  • ThemeSmartyView
  • ThumbnailHelper
  • ThumbShell
  • TransactionComponent
  • TransactionFS
  • TranslationsController
  • Tree
  • TrHelper
  • User
  • UserProperty
  • UsersController
  • Utility
  • Version
  • Video
  • VimeoHelper
  • WebmarksController
  • XmlExportFilter
  • XmlImportFilter
  • XmlJsonConverter
  • XmlView
  • YoutubeHelper

Interfaces

  • ApiAuthInterface
  • MediaProviderInterface
  • UploadableInterface

Exceptions

  • BeditaAjaxException
  • BEditaAllowURLException
  • BeditaBadRequestException
  • BeditaConflictException
  • BEditaDeleteStreamObjException
  • BeditaException
  • BEditaFileExistException
  • BeditaForbiddenException
  • BeditaFrontAccessException
  • BeditaHashException
  • BEditaInfoException
  • BeditaInternalErrorException
  • BEditaIOException
  • BeditaLengthRequiredException
  • BeditaMailException
  • BEditaMediaProviderException
  • BeditaMethodNotAllowedException
  • BEditaMIMEException
  • BeditaNotFoundException
  • BeditaNotImplementedException
  • BeditaPublicationException
  • BeditaRuntimeException
  • BEditaSaveStreamObjException
  • BeditaServiceUnavailableException
  • BeditaUnauthorizedException
  • BEditaUploadPHPException
  • BEditaURLException

Class ObjectRelation

Object relations model

Model
Extended by AppModel
Extended by BEAppModel
Extended by ObjectRelation
Located at models/object_relation.php

Methods summary

public
# afterFind( $results )
private static string[]
# prepareAll( )

Escape all arguments that have been passed to this function.

Escape all arguments that have been passed to this function.

Returns

string[]
public array|false
# createRelation( integer $id, integer $objectId, string $switch, integer $priority, boolean $bidirectional = true, array|null $params = array() )

Create relation between objects

Create relation between objects

TODO: sql query, not working with cake ->save() .. why??

cake->save() doesn't work beacuse of table structure. It should be id primary key, object_id, related_object_id, switch, priority)

Parameters

$id
The left object id
$objectId
The right object id
$switch
The switch name
$priority
The relation priority
$bidirectional
If the relation is bidirectional
$params
The additional relation params

Returns

array|false
$this->query() output - false on error
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

Create direct and inverse relation using $switch and $inverseSwitch names

Parameters

$id
Left relation element id
$objectId
Right relation element id
$switch
Direct name
$inverseSwitch
name
$priority
The relation priority
$params
The addtional relation params

Returns

array|false
public boolean
# deleteRelation( integer $id, integer $objectId = null, string $switch = null, boolean $bidirectional = true )

delete relation between objects

delete relation between objects

Parameters

$id
$objectId
$switch
$bidirectional

Returns

boolean
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

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

Parameters

$id
$objectId
$switch
$bidirectional,…

Returns

boolean
public boolean
# deleteObjectRelation( integer $id, string $switch, string $inverseSwitch = null )

delete a specific relation to an object

delete a specific relation to an object

Parameters

$id
  • object id
$switch
  • relation direct name
$inverseSwitch
  • relation inverse name, null if name ids the same

Returns

boolean
public false
# updateRelationPriority( integer $id, integer $objectId, string $switch, integer $priority )

Updates priority of a relation between objects.

Updates priority of a relation between objects.

Parameters

$id
$objectId
$switch
$priority

Returns

false
on failure
public false
# updateRelationParams( integer $id, integer $objectId, string $switch, array $params = array() )

Updates parameters of a relation between objects.

Updates parameters of a relation between objects.

Parameters

$id
$objectId
$switch
$params

Returns

false
on failure
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

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

Parameters

$id
the main object id
$objectId
the related object id
$switch
the relation name
$set
array of fields to update

Returns

boolean
public true
# relationExists( integer $id, integer $objectId, string $switch )

Check object relation existence

Check object relation existence

Parameters

$id
$objectId
$switch

Returns

true
if relation exists, false otherwise
public priority
# relationPriority( integer $id, integer $objectId, string $switch )

Get current priority for a specific relation

Get current priority for a specific relation

Parameters

$id
$objectId
$switch

Returns

priority
value or false if field is NULL or relation missing
public parameters
# relationParams( integer $id, integer $objectId, string $switch, boolean $assoc = true )

Get current parameters for a specific relation

Get current parameters for a specific relation

Parameters

$id
$objectId
$switch
$assoc
true to return an associative array, false to return an object (default: true)

Returns

parameters
as an associative array or object, or false if field is NULL or relation missing
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

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

array returned is like array('relation_name' => 'relation label', ...)

Parameters

$objectType
Object type name or object type id
$orderBy
sort relations returned

Returns

array

See

self::sortRelations() for $orderBy example
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.

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.

Example

$relations = array('attach' => array(), 'seealso' => array(), ....)
$orderBy = array('seealso')

return

array('seealso' => array(), 'attach' => array(), ...)

Parameters

$relations
$orderBy

Returns

array
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

passed an array of BEdita objects add 'num_of_relations_name' key with the number of each relations passed in options applied to objects

Parameters

$objects
$options

list of options accepted - relations: array of relation name as array('attach', 'seealso')

Returns

array
$objects
public boolean
# isValid( string $name, string $objectType )

Check if relation $name is valid for object type $objectType Return true if it's valid, false otherwise

Check if relation $name is valid for object type $objectType Return true if it's valid, false otherwise

Parameters

$name
the relation name (it can be also the inverse name)
$objectType
the object type name

Returns

boolean
public string|false
# inverseOf( string $name, array $relations = array() )

Return the inverse name of relation named $name Passing an array of relation ($relation) it searches inside that else search in all relations.

Return the inverse name of relation named $name Passing an array of relation ($relation) it searches inside that else search in all relations.

Parameters

$name
a direct or inverse relation name
$relations
an array of relations on which search

Returns

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()

Methods inherited from AppModel

apiTransformer()

Properties summary

Properties inherited from BEAppModel

$actsAs, $driver, $eQ, $modelBindings, $sQ

Properties inherited from AppModel

$apiTransformerOptions

BEdita API doc | 4-cactus API documentation generated by ApiGen