wCMF  3.6
 All Classes Namespaces Files Functions Variables Groups Pages
ObjectFactory Class Reference

Public Member Functions

 getErrorMsg ()
 
getInstance ()
 
 getClassfileFromConfig ($className)
 
 loadClassDefinitionFromConfig ($section, $classEntry)
 
createInstanceFromConfig ($section, $classEntry)
 

Public Attributes

 $_errorMsg = ''
 

Detailed Description

ObjectFactory loads class definitions and instantiates classes.

wCMF - wemove Content Management Framework Copyright (C) 2005-2014 wemove digital solutions GmbH

Licensed under the terms of any of the following licenses at your choice:

See the license.txt file distributed with this work for additional information.

Id:
class.ObjectFactory.php 1462 2014-02-04 23:52:27Z iherwig
Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 29 of file class.ObjectFactory.php.

Member Function Documentation

ObjectFactory::getErrorMsg ( )

Get last error message.

Returns
The error string

Definition at line 37 of file class.ObjectFactory.php.

References $_errorMsg.

ObjectFactory::getClassfileFromConfig (   $className)

Get the class file for a given class name. This method looks up the class definition from 'classmapping' section.

Parameters
classNameThe name of the class.
Returns
Classfile on success, False else / error string provided by getErrorMsg()

Definition at line 60 of file class.ObjectFactory.php.

References InifileParser\getInstance().

Referenced by loadClassDefinitionFromConfig().

+ Here is the call graph for this function:

ObjectFactory::loadClassDefinitionFromConfig (   $section,
  $classEntry 
)

Load a class definition from a configuration entry. This method looks up the class name as value of $classEntry in $section of the main configuration file and takes class definition from 'classmapping' section. With this information it includes the desired class definition.

Parameters
sectionThe name of the section, where the class is defined.
classEntryThe name of the key in the section, where the class is defined.
Returns
Classname on success, False else / error string provided by getErrorMsg()

Definition at line 80 of file class.ObjectFactory.php.

References getClassfileFromConfig(), and InifileParser\getInstance().

Referenced by createInstanceFromConfig().

+ Here is the call graph for this function:

& ObjectFactory::createInstanceFromConfig (   $section,
  $classEntry 
)

Create an object from a configuration entry. This method looks up the class name as value of $classEntry in $section of the main configuration file and takes - if given - constructor parameters from the 'initparams' section and class definition from 'classmapping' section. With this information it constructs the desired object.

Parameters
sectionThe name of the section, where the class is defined.
classEntryThe name of the key in the section, where the class is defined.
Returns
A reference to an instance of the class, null if failed (error string provided by getErrorMsg()).

Definition at line 115 of file class.ObjectFactory.php.

References InifileParser\getInstance(), and loadClassDefinitionFromConfig().

+ Here is the call graph for this function:

Member Data Documentation

ObjectFactory::$_errorMsg = ''

Definition at line 31 of file class.ObjectFactory.php.

Referenced by getErrorMsg().


The documentation for this class was generated from the following file: