TargetLoaderAbstract is used for classes that chain from \Gems_Loader but are also a target themselves.

As these classes may need setting of values this subclass implements the checkRegistryRequestsAnswers() easy access to resources.

package Gems
subpackage Export
copyright Copyright (c) 2011 Erasmus MC
license New BSD License
since Class available since version 1.5
inherited_from \Gems_Loader_TargetLoaderAbstract

 Methods

__construct()

__construct(\type $container, array $dirs) 

Parameters

$container

\type

A container acting as source fro \MUtil_Registry_Source

$dirs

array

The directories where to look for requested classes

__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 one or more export classes

addExportClasses(array $stack) 

Parameters

$stack

array

classname / description array of sourceclasses

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)

Called after the check that all required registry values have been set correctly has run.

afterRegistry() : void
Inherited

Allows the loader to set resources.

answerRegistryRequest(string $name, mixed $resource) : boolean
Inherited

Parameters

$name

string

Name of resource to set

$resource

mixed

The resource.

Returns

booleanTrue if $resource was OK

Should be called after answering the request to allow the Target to check if all required registry values have been set correctly.

checkRegistryRequestsAnswers() : boolean
Inherited

Returns

booleanFalse if required values are missing.

getDefaults()

getDefaults() 

getExport()

getExport($type) : \Gems_Export_ExportInterface

Parameters

$type

Returns

\Gems_Export_ExportInterface

Returns all registered export classes

getExportClasses() : array

Returns

arrayOf classname => description

Returns all registered export models

getExportModelSources() : array

Returns

arrayOf classnames

Allows the loader to know the resources to set.

getRegistryRequests() : array
Inherited

Returns those object variables defined by the subclass but not at the level of this definition.

Can be overruled.

Returns

arrayof string names

Set the default options for the form

setDefaults(array $defaults) 

Parameters

$defaults

array

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

Filters the names that should not be requested.

filterRequestNames(string $name) : boolean
Inherited

Can be overriden.

Parameters

$name

string

Returns

boolean

 Properties

 

Is set to the calling controller to allow rendering the view

$controller : \Gems_Controller_Action

Default

null
 

The default values for the form. Defaults for a specific export-type should come from that class

$_defaults : array

Default

array('exportmodelsource' => 'AnswerExportModelSource', 'type' => 'ExcelExport')
 

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
 

This variable holds all registered export classes, may be changed in derived classes

$_exportClasses : array

Default

array('ExcelExport' => 'Excel (xlsx)', 'ExcelHtmlExport' => 'Excel HTML (xls)', 'SpssExport' => 'SPSS', 'CsvExport' => 'CSV', 'StataExport' => 'Stata (xml)')
 

Holds all registered export descriptions, which describe the models that can be exported

$_exportModelSources : array

Default

array('AnswerExportModelSource' => 'Answers')
 

$_loader

$_loader : \MUtil_Loader_PluginLoader

Default

 

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

$cascade : string

Default

'Export'
 

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

$cascade : string

Default

null