\Phabstractic\Loader\ResourceModuleInterface

The Module Interface

Expands on the leaf interface to implement common Module functions having to do with paths and path identifiers

CHANGELOG

1.0: Created ModuleInterface - February 21st, 2014 1.1: Refactored ModuleInterface to DirectoryInterface - February 27th, 2014 1.2: Wrapped ModuleInterface to DirectoryInterface - February 27th, 2014 2.0: Refactored for Primus 2 Integration - October 20th, 2015 3.0: removed default arguments to path methods reformatted for inclusion in phabstractic - August 2nd, 2016

Summary

Methods
Constants
getModuleIdentifier()
setModuleIdentifier()
getPath()
setPath()
getModules()
addModule()
removeModule()
removeModuleByIdentifier()
isSubModule()
isSubModuleByIdentifier()
addToModuleIdentityPath()
getModulesAsArray()
getFromModuleIdentityPath()
getModuleIdentityPaths()
pathBelongsTo()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

getModuleIdentifier()

getModuleIdentifier() : string

Retrieve the module identifier

Returns

string

setModuleIdentifier()

setModuleIdentifier(  $newIdentifier) : boolean

Set the module identifier

Parameters

$newIdentifier

Returns

boolean

getPath()

getPath() : string

Retrieve the corresponding path

Like getData

Returns

string

setPath()

setPath(string  $path) 

Set the corresponding path

Like setData

Parameters

string $path

getModules()

getModules() : array

Retrieve all the connected Modules

Like getLeaves

Returns

array

addModule()

addModule(\Phabstractic\Loader\Resource\Phabstractic\Loader\Resource\ModuleInterface  $module) 

Add a Module to this Module's 'directory'.

Remember that the passed ModuleName will become the LOCAL identifier

Like addLeaf

Parameters

\Phabstractic\Loader\Resource\Phabstractic\Loader\Resource\ModuleInterface $module

removeModuleByIdentifier()

removeModuleByIdentifier(  $moduleName) 

Remove a Module from this Module's 'directory'

Like removeLeaf but using identifier

Parameters

$moduleName

isSubModule()

isSubModule(  $module) 

Does this Module exist in the local array?

Like isLeaf

Parameters

$module

isSubModuleByIdentifier()

isSubModuleByIdentifier(string  $moduleName) 

Does this Module identifier exist in the local array?

Like isLeaf

Parameters

string $moduleName

The local Module identifier

addToModuleIdentityPath()

addToModuleIdentityPath(string  $path, \Phabstractic\Loader\Resource\Phabstractic\Loader\Resource\ModuleInterface  $newModule) 

Parse the path from this module and add new module

Parameters

string $path
\Phabstractic\Loader\Resource\Phabstractic\Loader\Resource\ModuleInterface $newModule

getModulesAsArray()

getModulesAsArray() : array

Return module structure from this module as array

See above, does the reverse. This is a good way to see how the above is formatted.

Returns

array

getFromModuleIdentityPath()

getFromModuleIdentityPath(string  $path) : \Phabstractic\Loader\Resource\Phabstractic\Loader\Resource\LeafInterface|\Phabstractic\Loader\Resource\Phabstractic\Data\Types\None

Retrieve a Module using a path and a root

This starts at a given root Module, and then parses the path (delimited by \'s) until it reaches the intended module. The path refers to identifiers as stored in the identifier of the actual module

Parameters

string $path

The path to the desired Folder (this\is\a\path)

Returns

\Phabstractic\Loader\Resource\Phabstractic\Loader\Resource\LeafInterface|\Phabstractic\Loader\Resource\Phabstractic\Data\Types\None —

A reference, none on failure

getModuleIdentityPaths()

getModuleIdentityPaths() 

Get Module Identifier Paths

This returns a list of all terminating paths

Ex:

[] Module1\Module2\Module3 [] Module1\Module4 [] Module1\Module5\Module6\Module7

pathBelongsTo()

pathBelongsTo(  $path) 

Returns a module path that contains the data

NOTE: Only returns the first instance it finds

Okay, this returns a modue path to the module that contains the associated path

Parameters

$path

The path to find