org.puremvc.php.core
[ class tree: org.puremvc.php.core ] [ index: org.puremvc.php.core ] [ all elements ]

Class: View

Source Location: /core/View.php

Class Overview


A Singleton
implementation.


Author(s):

Implements interfaces:

Variables

Methods



Class Details

[line 37]
A Singleton
implementation.

In PureMVC, the

class assumes these responsibilities:
  • Maintain a cache of
    instances.
  • Provide methods for registering, retrieving, and removing
    1. IMediators
    .
  • Managing the observer lists for each
    in the application.
  • Providing a method for attaching
    1. IObservers
    to an
    's observer list.
  • Providing a method for broadcasting an
    .
  • Notifying the
    1. IObservers
    of a given
    when it broadcast.




Tags:

see:  org.puremvc.php.patterns.observer.Notification Notification
see:  org.puremvc.php.patterns.observer.Observer Observer
see:  org.puremvc.php.patterns.mediator.Mediator Mediator


[ Top ]


Class Variables

static $instance =

[line 47]



Tags:

access:  protected

Type:   mixed


[ Top ]

$mediatorMap =

[line 41]



Tags:

access:  protected

Type:   mixed


[ Top ]

$observerMap =

[line 44]



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


static method getInstance [line 88]

static the getInstance( )

View Singleton Factory method.



Tags:

return:  Singleton instance of
access:  public


[ Top ]

method hasMediator [line 193]

void hasMediator( mediatorName $mediatorName)

Check to see if a Mediator is registered with the View.



Tags:

access:  public


Parameters:

mediatorName   $mediatorName   name of the
instance to check for.

[ Top ]

method initializeView [line 79]

void initializeView( )

Initialize the Singleton View instance.

Called automatically by the constructor, this is your opportunity to initialize the Singleton instance in your subclass without overriding the constructor.




Tags:

access:  protected


[ Top ]

method notifyObservers [line 124]

void notifyObservers( $notification)

Notify the
  1. IObservers
for a particular
.

All previously attached

  1. IObservers
for this
's list are notified and are passed a reference to the
in the order in which they were registered.




Tags:

access:  public


Parameters:

notification   $notification   the
to notify
  1. IObservers
of.

[ Top ]

method registerMediator [line 153]

void registerMediator( $mediator, mediator 1)

Register an
instance with the
.

Registers the

so that it can be retrieved by name, and further interrogates the
for its
interests.

If the

returns any
names to be notified about, an
is created encapsulating the
instance's
  1. handleNotification
method and registering it as an
for all
  1. INotifications
the
is interested in.




Tags:

access:  public


Parameters:

mediator   1   a reference to the
instance
mediatorName   $mediator   the name to associate with this
instance

[ Top ]

method registerObserver [line 101]

void registerObserver( notificationName $notificationName, $observer)

Register an
to be notified of
  1. INotifications
with a given name.



Tags:

access:  public


Parameters:

notificationName   $notificationName   the name of the
  1. INotifications
to notify this
of
observer   $observer   the
to register

[ Top ]

method removeMediator [line 203]

void removeMediator( mediatorName $mediatorName)

Remove an
from the
.



Tags:

access:  public


Parameters:

mediatorName   $mediatorName   name of the
instance to be removed.

[ Top ]

method retrieveMediator [line 183]

the retrieveMediator( mediatorName $mediatorName)

Retrieve an
from the
.



Tags:

return:  
instance previously registered with the given
  1. mediatorName
.
access:  public


Parameters:

mediatorName   $mediatorName   the name of the
instance to retrieve.

[ Top ]


Documentation generated on Tue, 30 Sep 2008 08:05:46 -0700 by phpDocumentor 1.4.0