PHPDevShell 3.1.3-Stable
PHP OOP RAD Development Framework
PHPDS_dependant Class Reference
Inheritance diagram for PHPDS_dependant:
botBlock controlPanel crud fileManager groupTree iana imaging mailer menuArray menuStructure orm pagination PHPDS_classFactory PHPDS_controller PHPDS_core PHPDS_db PHPDS_debug PHPDS_errorHandler PHPDS_legacyConnector PHPDS_login PHPDS_navigation PHPDS_notif PHPDS_pdoConnector PHPDS_query PHPDS_security PHPDS_tagger PHPDS_template PHPDS_user pluginManager timeZone userActions userPending views wysiwygEditor

Public Member Functions

 __construct ()
 construct ()
 PHPDS_dependance ($dependance=null)
 __get ($name)
 __set ($name, $value)
 __call ($name, $arguments)
 debugInstance ($domain=null)
 log ($data)
 _log ($data)
 info ($data)
 factory ($classname)
 factoryWith ($classname, array $params)
 singleton ($classname)
 singletonWith ($classname, array $params)

Protected Attributes

 $dependance
 $parent
 $privateFields = false

Constructor & Destructor Documentation

__construct ( )

magic constructor

parameter list is not explicit: we're expecting the LAST argument to be the dependence, other are fed to construct()

Author:
greg

Member Function Documentation

__call ( name,
arguments 
)

Magic php function used when a non-defined method is called. Here we mimics multi-inheritance by calling methods from "roots"

Parameters:
string$name
mixed$arguments
Returns:
mixed
__get ( name)

Magic php function, called when trying to access a non-defined field

When a method want a field which doesn't exist, we assume it's a data from the father

Version:
2.0
Author:
greg
Date:
20110818 (v2.0) (greg) added external access to private/protected fields either by accessor or read-only ; cleanup
20100805 (v1.0.2) (greg) removed direct access to fields to avoid giving public access to private/protected fields
20100426 (v1.0.1) (greg) change to use PHPDS_dependance() to get the proper top owner
Parameters:
$namestring name of the field to fetch
Returns:
mixed
__set ( name,
value 
)

Sets property names when none existant and makes them available in core.

Parameters:
type$name
type$value
Returns:
mixed
_log ( data)

DEPRECATED: alias for log()

Parameters:
$data
construct ( )

Empty function called by the actual constructor; meant to be overriden

Supposed to return false (exactly) in case of error, otherwise return the object itself

Returns:
boolean or object

Reimplemented in PHPDS_controller, PHPDS_errorHandler, PHPDS_query, mailer, orm, views, and botBlock.

debugInstance ( domain = null)

Create instance of PHPDS_debug.

Date:
20100412 (v1.0.1) (greg) deal with new sytle naming (starting with PHPDS_)
20100426 (v1.0.2) (greg) change to use PHPDS_dependance() to get the proper top owner
20110202 (v1.0.3) (greg) fixed a bug of using factoryWith(à instead of factory()
Version:
1.0.3
Author:
greg
Returns:
object

Reimplemented in PHPDS_legacyConnector, PHPDS_pdoConnector, and PHPDS_query.

factory ( classname)

Create a new instance of the given class and link it as dependant (variable number of argument)

Parameters:
string | array$classname,...name of the class to instanciate, or factory array parameter (see PHPDS->_factory() )
mixed... optionnal class specific parameters
Date:
20111219 (v1.2.1) (greg) rewrote signature description for phpDoc
20100922 (v1.2) (greg) created factoryWith()
20100217 Split into factory() and PHPDS._factory() so the latter can be called with an array of arguments
20091125 Added the dependance link as the last parameter of the constructor
Version:
1.2.1
Author:
greg
See also:
PHPDS_debug
PHPDS::_factory()
Returns:
instance of $classname
factoryWith ( classname,
array $  params 
)

Create a new instance of the given class and link it as dependant (variable number of argument)

Parameters:
string | array$classname,...name of the class to instanciate, or factory array parameter (see PHPDS->_factory() )
array$paramsoptionnal class specific parameters
Date:
20111219 (v1.0.2) (greg) rewrote signature description for phpDoc
20110915 (v1.0.1) (greg) moved class aliasing support to PHPDS skel
Version:
1.0.2
Author:
greg
Returns:
instance of $classname
info ( data)

DEPRECATED: alias for _log()

Parameters:
$data

Reimplemented in PHPDS_debug.

log ( data)

Send info data to the debug subsystem (console, firebug, ...)

The goal of this function is to be called all thourough the code to be able to track bugs.

Date:
20100928 (v1.1) (greg) this function send data with the DEBUG level
Version:
1.1
Parameters:
string$data
PHPDS_dependance ( dependance = null)

Inject the given dependency into $this, and/or returns the owner

The default behavior is to try to get the top owner, ie the main PHPDS instance. However the given parmeter is supposed to be the object from where the new object is created. That means you can override this to "catch" the real owner at this time.

Date:
20110202 (v1.1.1) (greg) added a check to prevent breaking on $this->dependancy if it's not an object
Version:
1.1.1
Author:
greg
Date:
20100426
Parameters:
object$dependance,the"owner", can be either PHPDS or PHPDS_dependant
Returns:
owner of $this
singleton ( classname)

Gives an instance of the class according to the singleton pattern i.e., the first time the class is asked for, an object is instanciated and every following class will return the same object

Parameters:
string$classnamename of the class to instanciate
mixed... optionnal class specific parameters
Date:
20111219 (v1.0) (greg) added
Version:
1.0
Author:
greg <greg@phpdevshell.org>
Returns:
instance of $classname
singletonWith ( classname,
array $  params 
)

Gives an instance of the class according to the singleton pattern i.e., the first time the class is asked for, an object is instanciated and every following class will return the same object

Parameters:
string$classnamename of the class to instanciate
Date:
20111219 (v1.0) (greg) added
Version:
1.0
Author:
greg <greg@phpdevshell.org>
Returns:
instance of $classname

Field Documentation

$dependance [protected]
$parent [protected]
$privateFields = false [protected]

The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables Enumerations