tangra logo
   
[ class tree: tangra_lib ] [ index: tangra_lib ] [ all elements ]
 

Class: Web_Event_Dispatcher

Source Location: /web_site/web_events_dispatcher.class.php

Class Web_Event_Dispatcher

Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From Tangra_Class

Tangra_Class::get_class_name()
Alias of get_class(). Exist because of historical reasons.
Tangra_Class::__set()
Overides PHP built-in method and just throws exception if called. Purpose - to "forbid" autosetting of nonexisting class properties.

[ Top ]
Property Summary
unknown_type   $default_event_action_pair   Default event-action pair
array   $event_action_pairs   Array containing event-action pairs
array   $order_arr   Array that contains prioritetes of events
Web_page   $page_pointer   Reference to Web_page object

[ Top ]
Method Summary
Web_Event_Dispatcher   __construct()   Constructor
void   add_wed_event_action_pair()   Adds new event-action pair
string   check_for_duplicate_captures()   Checks if there are duplicate captures
array   get_dispatch()   Returns array dispatch direction
array   get_event_action_pairs()   Returns event action pairs
boolean   is_event_registered()   Checks if event with name $event_name is already registered
void   set_default_event_action_pair()   Sets default event-action pair

[ Top ]
Properties
unknown_type   $default_event_action_pair [line 43]

Default event-action pair

API Tags:
Internal:  
Access:  private


[ Top ]
array   $event_action_pairs = array() [line 50]

Array containing event-action pairs

API Tags:
Internal:  
Access:  private


[ Top ]
array   $order_arr = array() [line 57]

Array that contains prioritetes of events

API Tags:
Internal:  
Access:  private


[ Top ]
Web_page   $page_pointer [line 36]

Reference to Web_page object

API Tags:
Internal:  
Access:  private


[ Top ]
Methods
Constructor __construct  [line 64]

  Web_Event_Dispatcher __construct( Web_Page $page_pointer  )

Constructor

Parameters:
Web_Page   $page_pointer:  Page that instantiates this object


[ Top ]
add_wed_event_action_pair  [line 89]

  void add_wed_event_action_pair( Web_Event $we, unknown_type $target_method, [integer $order = 10]  )

Adds new event-action pair

Parameters:
Web_Event   $we: 
unknown_type   $target_method:  Name of the Web_Page method that will be triggered if event occures
integer   $order:  Order of this event. Events will be evaluated ordered by their $order.

API Tags:
Access:  public

Information Tags:
Throws:  Tangra_Exception, TE_Key_Already_Exists

[ Top ]
check_for_duplicate_captures  [line 142]

  string check_for_duplicate_captures( )

Checks if there are duplicate captures


API Tags:
Return:  Capture label
Access:  public


[ Top ]
get_dispatch  [line 114]

  array get_dispatch( Web_Context $context  )

Returns array dispatch direction

Returns array: ['target'] - action of the event, method that will be triggered ['param'] - captured value/array of values

Parameters:
Web_Context   $context: 

API Tags:
Access:  public


[ Top ]
get_event_action_pairs  [line 188]

  array get_event_action_pairs( )

Returns event action pairs


API Tags:
Access:  public


[ Top ]
is_event_registered  [line 178]

  boolean is_event_registered( unknown_type $event_name  )

Checks if event with name $event_name is already registered

Parameters:
unknown_type   $event_name: 

API Tags:
Access:  public


[ Top ]
set_default_event_action_pair  [line 75]

  void set_default_event_action_pair( Web_Event $we, string $target_method  )

Sets default event-action pair

Parameters:
Web_Event   $we: 
string   $target_method:  Name of the Web_Page method that will be triggered if event occures


[ Top ]