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 BeCallbackManager

Basic event manager for BEdita.

Located at libs/be_callback_manager.php

Methods summary

public boolean
# bind( string $eventName, mixed $listener )

Attaches a listener to an event.

Attaches a listener to an event.

Listeners can be either anonymous functions or pairs of class name (or object instance) / method name

Parameters

$eventName
Name of the event to be listened.
$listener
Callback or full qualified name of listener.

Returns

boolean
Success.

See

self::callListener() to see valid types of listener
public boolean
# unbind( string $eventName = null, mixed $listener = null )

Detaches a listener from an event.

Detaches a listener from an event.

If $eventName is null, the given $listener will be detached from any event it was attached to. If $listener is null, all listeners binded to the given $eventName will be detached from that event. If both parameters are empty, each end every listener is cleared from any event.

Parameters

$eventName
Name of the event to be unbinded.
$listener
Callback or full qualified name of callback.

Returns

boolean
Success.
public stdClass
# trigger( string $eventName, array $eventData = array() )

Triggers a new event, calling all listeners binded to that event in the order they were added.

Triggers a new event, calling all listeners binded to that event in the order they were added.

Passing data as an array will result in callbacks associated to the triggered event being called with array elements as arguments in the order they appear in that array. In addition to that, the $event object will be passed to those callbacks as last argument, thus allowing listeners to gain control on event propagation or modifying the event itself.

To stop the event propagation the listener method can return false or use $event->stopPropagation->__invoke()

Parameters

$eventName
Name of the event to be triggered.
$eventData
Data of the event.

Returns

stdClass
Class representing the event triggered, with name, data, result and stopped keys.
private mixed
# callListener( mixed $listener, array $data = array() )

Check if $listener is valid and call it To be valid a listener must be:

Check if $listener is valid and call it To be valid a listener must be:

  • a Closure
  • a string as ClassName::methodName (methodName should be static)
  • an array as array(instance of a class, 'methodName')
  • an array as array('ClassName', 'methodName') In this case:
    • if 'ClassName' is in the registry the instance is retrieved
    • else try to use it (methodName should be static)

Parameters

$listener
Callback or full qualified name of callback
$data
The data passed to listener.

Returns

mixed
the result of listener call

Throws

BeditaInternalErrorException
if the listener is not callable
private stdClass
# initEvent( string $eventName, array $eventData )

Initializes a new event.

Initializes a new event.

Parameters

$eventName
Event name.
$eventData
Event data.

Returns

stdClass
Event.

Properties summary

protected array $listeners

Array of currently attached listeners.

Array of currently attached listeners.

# array()
BEdita API doc | 4-cactus API documentation generated by ApiGen