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

Class: MacroCommand

Source Location: /patterns/command/MacroCommand.php

Class Overview

Notifier
   |
   ..MacroCommand

A base
implementation that executes other
s.


Author(s):

Implements interfaces:

Methods


Child classes:

StartApplicationCommand
The
prepares the view first so that it is ready to display data when the model is done loading.

Inherited Variables

Inherited Methods


Class Details

[line 46]
A base
implementation that executes other
s.

A

maintains an list of
Class references called SubCommands.

When

is called, the
instantiates and calls
on each of its SubCommands turn. Each SubCommand will be passed a reference to the original
that was passed to the
's
method.

Unlike

, your subclass should not override
, but instead, should override the
method, calling
once for each SubCommand to be executed.




Tags:

see:  org.puremvc.patterns.command.SimpleCommand SimpleCommand
see:  org.puremvc.patterns.observer.Notification Notification
see:  org.puremvc.core.controller.Controller Controller


[ Top ]


Class Methods


constructor __construct [line 62]

MacroCommand __construct( )

Constructor.

You should not need to define a constructor, instead, override the

method.

If your subclass does define a constructor, be sure to call

  1. super()
.




Tags:

access:  public


Overrides Notifier::__construct() (parent method not documented)

[ Top ]

method addSubCommand [line 104]

void addSubCommand( commandClassRef $commandClassRef)

Add a SubCommand.

The SubCommands will be called in First In/First Out (FIFO) order.




Tags:

access:  protected


Parameters:

commandClassRef   $commandClassRef   a reference to the
  1. Class
of the
.

[ Top ]

method execute [line 118]

void execute( $notification)

Execute this
's SubCommands.

The SubCommands will be called in First In/First Out (FIFO) order.




Tags:

access:  public


Parameters:

notification   $notification   the
object to be passsed to each SubCommand.

[ Top ]

method initializeMacroCommand [line 91]

void initializeMacroCommand( )

Initialize the
.

In your subclass, override this method to initialize the

's SubCommand list with
class references like this:

<listing> // Initialize MyMacroCommand override protected function initializeMacroCommand( ) : void { addSubCommand( com.me.myapp.controller.FirstCommand ); addSubCommand( com.me.myapp.controller.SecondCommand ); addSubCommand( com.me.myapp.controller.ThirdCommand ); } </listing> Note that SubCommands may be any

implementor,
s or
  1. SimpleCommands
are both acceptable.




Tags:

access:  protected


Overridden in child classes as:

StartApplicationCommand::initializeMacroCommand()
The
  1. initializeMacroCommand
is overridden to add references to instances of SimpleCommand that should be executed.

[ Top ]


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