Methods summary
public
|
#
__construct( array|Zend_Config $options )
Constructor
Parameters
- $options
array|Zend_Config Configuration options for resource autoloader
|
public
mixed
|
#
__call( string $method, array $args )
Overloading: methods
Allow retrieving concrete resource object instances using
'get<Resourcename>()' syntax. Example:
$loader = new Zend_Loader_Autoloader_Resource(array(
'namespace' => 'Stuff_',
'basePath' => '/path/to/some/stuff',
))
$loader->addResourceType('Model', 'models', 'Model');
$foo = $loader->getModel('Foo');
Parameters
- $method
string
- $args
array
Returns
mixed
Throws
|
public
False
|
#
getClassPath( string $class )
Helper method to calculate the correct class path
Helper method to calculate the correct class path
Parameters
Returns
False if not matched other wise the correct path
|
public
mixed
|
#
autoload( string $class )
Attempt to autoload a class
Attempt to autoload a class
Parameters
Returns
mixed False if not matched, otherwise result if include operation
Implementation of
|
public
Zend_Loader_Autoloader_Resource
|
#
setOptions( array $options )
Set class state from options
Set class state from options
Parameters
Returns
|
public
Zend_Loader_Autoloader_Resource
|
#
setNamespace( string $namespace )
Set namespace that this autoloader handles
Set namespace that this autoloader handles
Parameters
Returns
|
public
string
|
#
getNamespace( )
Get namespace this autoloader handles
Get namespace this autoloader handles
Returns
string
|
public
Zend_Loader_Autoloader_Resource
|
#
setBasePath( string $path )
Set base path for this set of resources
Set base path for this set of resources
Parameters
Returns
|
public
string
|
#
getBasePath( )
Get base path to this set of resources
Get base path to this set of resources
Returns
string
|
public
Zend_Loader_Autoloader_Resource
|
#
addResourceType( string $type, string $path, null|string $namespace = null )
Add resource type
Parameters
- $type
string identifier for the resource type being loaded
- $path
string path relative to resource base path containing the resource types
- $namespace
null|string sub-component namespace to append to base namespace that qualifies this
resource type
Returns
|
public
Zend_Loader_Autoloader_Resource
|
#
addResourceTypes( array $types )
Add multiple resources at once
Add multiple resources at once
$types should be an associative array of resource type => specification
pairs. Each specification should be an associative array containing minimally
the 'path' key (specifying the path relative to the resource base path) and
optionally the 'namespace' key (indicating the subcomponent namespace to append
to the resource namespace).
As an example:
$loader->addResourceTypes(array(
'model' => array(
'path' => 'models',
'namespace' => 'Model',
),
'form' => array(
'path' => 'forms',
'namespace' => 'Form',
),
));
Parameters
Returns
|
public
Zend_Loader_Autoloader_Resource
|
#
setResourceTypes( array $types )
Overwrite existing and set multiple resource types at once
Overwrite existing and set multiple resource types at once
Parameters
Returns
See
|
public
array
|
#
getResourceTypes( )
Retrieve resource type mappings
Retrieve resource type mappings
Returns
array
|
public
boolean
|
#
hasResourceType( string $type )
Is the requested resource type defined?
Is the requested resource type defined?
Parameters
Returns
boolean
|
public
Zend_Loader_Autoloader_Resource
|
#
removeResourceType( string $type )
Remove the requested resource type
Remove the requested resource type
Parameters
Returns
|
public
Zend_Loader_Autoloader_Resource
|
|
public
Zend_Loader_Autoloader_Resource
|
#
setDefaultResourceType( string $type )
Set default resource type to use when calling load()
Set default resource type to use when calling load()
Parameters
Returns
|
public
string|null
|
#
getDefaultResourceType( )
Get default resource type to use when calling load()
Get default resource type to use when calling load()
Returns
string|null
|
public
object
|
#
load( string $resource, string $type = null )
Object registry and factory
Object registry and factory
Loads the requested resource of type $type (or uses the default resource type
if none provided). If the resource has been loaded previously, returns the
previous instance; otherwise, instantiates it.
Parameters
- $resource
string
- $type
string
Returns
object
Throws
|