LoaderAbstract is used for classes that chain from \Gems_Loader and that thus allow projects to overrule the original implementation.

I.e if you create a class _Model or _Util, that class is loaded automatically instead of \Gems_Model or \Gems_Util. _Model should be a subclass of \Gems_Model.

You can set more than one overrule level. I.e. you can specify the class chain Demopulse, Pulse, Gems. The loader will then always look first in Demopulse, then in Pulse and lastly in Gems.

The class inherits from \MUtil_Registry_Source as the chained classes may have values that should be set automatically, e.g. from \Zend_Registry.

package Gems
subpackage Mail
copyright Copyright (c) 2013 Erasmus MC
license New BSD License
since Class available since version 1.6.2
inherited_from \Gems_Loader_LoaderAbstract

 Methods

__construct()

__construct(mixed $container, array $dirs) 
Inherited

Parameters

$container

mixed

A container acting as source for \MUtil_Registry_Source

$dirs

array

The directories where to look for requested classes

__get()

__get($name) 
Inherited

Parameters

$name

Add prefixed paths to the registry of paths

addPrefixPath(string $prefix, $path, boolean $prepend = true) : \Gems_Loader_LoaderAbstract
Inherited

Parameters

$prefix

string

$path

$prepend

boolean

Put path at the beginning of the stack (has no effect when prefix / dir already set)

Returns

\Gems_Loader_LoaderAbstract(continuation pattern)

Return the mail elements helper class

getMailElements() : \Gems_Mail_MailElements

Returns

\Gems_Mail_MailElements

Get default mailform

getMailForm() : \Gems_Mail_MailForm

Returns

\Gems_Mail_MailForm

Get the possible mailtargets

getMailTargets() : Array

Returns

Arraymailtargets

Get the correct mailer class from the given target

getMailer(\[type] $target = null, $id = false, $orgId = false) : \Gems_Mail_MailerAbstract

Parameters

$target

\[type]

mailtarget (lowercase)

$id

$orgId

Returns

\Gems_Mail_MailerAbstractclass

Add a subdirectory / sub name to a list of class load paths

_cascadedDirs(array $dirs, string $cascade, boolean $fullClassnameFallback = true) : array
Inherited

Parameters

$dirs

array

prefix => path

$cascade

string

The sub directories to cascade to

$fullClassnameFallback

boolean

Allows full class name specification instead of just plugin name part

Returns

arrayprefix => path

Returns $this->$name, creating the item if it does not yet exist.

_getClass(string $name, string $className = null, array $arguments = array()) : mixed
Inherited

Parameters

$name

string

The $name of the variable to store this object in.

$className

string

Class name or null if the same as $name, prepending $this->_dirs.

$arguments

array

Class initialization arguments.

Returns

mixedInstance of $className

Create or loads the class. When only loading, this function returns a StaticCall object that can be invoked lazely.

_loadClass(string $name, boolean $create = false, array $arguments = array()) : mixed
Inherited
see
see

Parameters

$name

string

The class name, minus the part in $this->_dirs.

$create

boolean

Create the object, or only when an \MUtil_Registry_TargetInterface instance.

$arguments

array

Class initialization arguments.

Returns

mixedA class instance or a \MUtil_Lazy_StaticCall object

 Properties

 

The prefix/path location to look for classes.

$_dirs : array

Default

The standard value is

  • => application/classes
  • Gems => library/Gems/classes

But an alternative could be:

  • Demopulse => application/classes
  • Pulse => application/classes
  • Gems => library/Gems/classes
 

$_loader

$_loader : \MUtil_Loader_PluginLoader

Default

 

Allows sub classes of \Gems_Loader_LoaderAbstract to specify the subdirectory where to look for.

$cascade : string

Default

'Mail'
inherited_from \Gems_Loader_LoaderAbstract::cascade
 

Allows sub classes of \Gems_Loader_LoaderAbstract to specify the subdirectory where to look for.

$cascade : string

Default

null
 

$db

$db : \Zend_Db_Adapter_Abstract

Default

 

Define the mail target options

$mailTargets : array

Default

array('staff' => 'Staff', 'respondent' => 'Respondent', 'token' => 'Token', 'staffPassword' => 'Password reset')