PHP Class ZF\Apigility\Admin\Model\ModuleVersioningModel

Author: Gabriel Somoza ([email protected])
Mostrar archivo Open project: zfcampus/zf-apigility-admin Class Usage Examples

Protected Properties

Property Type Description
$configResource ZF\Configuration\ConfigResource
$docsConfigResource null | ZF\Configuration\ConfigResource
$moduleNameFilter Zend\Filter\FilterChain

Public Methods

Method Description
__construct ( string $moduleName, string $configDirPath, string $srcPath, ZF\Configuration\ConfigResource $config, ZF\Configuration\ConfigResource $docsConfig = null, null | string $pathSpecType = null )
createVersion ( integer $version ) : true Create a new version for a module
createWithPathSpec ( string $moduleName, ModulePathSpec $pathSpec, ZF\Configuration\ConfigResource $config, ZF\Configuration\ConfigResource $docsConfig = null ) : static createWithPathSpec
getModuleVersions ( ) : array | boolean Get the versions of a module
setDefaultVersion ( integer $defaultVersion ) : boolean Updates the default version of a module that will be used if no version is specified by the API consumer.

Protected Methods

Method Description
changeVersionArray ( array $data, integer $previous, integer $version ) : array Change version in an array
changeVersionNamespace ( string $string, integer $previous, integer $version ) : string Change version in a namespace
getModuleNameFilter ( ) : Zend\Filter\FilterChain Filter for module names
recursiveCopy ( string $source, string $target, integer $previous, integer $version ) Copy file and folder recursively
updateConfigVersion ( string $file, integer $previous, integer $version ) : boolean Update a PHP configuration file from $previous to $version version
updateDocumentationVersion ( integer $previous, integer $version ) : true Update the documentation to add a new $version based on the $previous

Private Methods

Method Description
setConfigDirPath ( string $configDirPath ) : void
setPathSpecType ( string $pathSpecType ) : void
setVersionsPath ( string $srcPath ) : void Sets the path to the directory that contains each of the module's version. If the current module is a PSR-0 module then it automatically appends the module's namespace.

Method Details

__construct() public method

public __construct ( string $moduleName, string $configDirPath, string $srcPath, ZF\Configuration\ConfigResource $config, ZF\Configuration\ConfigResource $docsConfig = null, null | string $pathSpecType = null )
$moduleName string Name of the module. MUST be normalized.
$configDirPath string Path the the configuration folder, with one or more *.config.php files.
$srcPath string Path to the module's source folder for versions, resources & collections.
$config ZF\Configuration\ConfigResource
$docsConfig ZF\Configuration\ConfigResource
$pathSpecType null | string Whether the module uses a PSR-0 directory structure or not. Defaults to ModulePathSpec::PSR_0.

changeVersionArray() protected method

Change version in an array
protected changeVersionArray ( array $data, integer $previous, integer $version ) : array
$data array
$previous integer
$version integer
return array

changeVersionNamespace() protected method

Change version in a namespace
protected changeVersionNamespace ( string $string, integer $previous, integer $version ) : string
$string string
$previous integer
$version integer
return string

createVersion() public method

Create a new version for a module
public createVersion ( integer $version ) : true
$version integer
return true

createWithPathSpec() public static method

createWithPathSpec
public static createWithPathSpec ( string $moduleName, ModulePathSpec $pathSpec, ZF\Configuration\ConfigResource $config, ZF\Configuration\ConfigResource $docsConfig = null ) : static
$moduleName string
$pathSpec ModulePathSpec
$config ZF\Configuration\ConfigResource
$docsConfig ZF\Configuration\ConfigResource
return static

getModuleNameFilter() protected method

Filter for module names
protected getModuleNameFilter ( ) : Zend\Filter\FilterChain
return Zend\Filter\FilterChain

getModuleVersions() public method

Get the versions of a module
public getModuleVersions ( ) : array | boolean
return array | boolean

recursiveCopy() protected method

Copy file and folder recursively
protected recursiveCopy ( string $source, string $target, integer $previous, integer $version )
$source string
$target string
$previous integer
$version integer

setDefaultVersion() public method

Updates the default version of a module that will be used if no version is specified by the API consumer.
public setDefaultVersion ( integer $defaultVersion ) : boolean
$defaultVersion integer
return boolean

updateConfigVersion() protected method

Update a PHP configuration file from $previous to $version version
protected updateConfigVersion ( string $file, integer $previous, integer $version ) : boolean
$file string
$previous integer Previous version
$version integer New version
return boolean

updateDocumentationVersion() protected method

Update the documentation to add a new $version based on the $previous
protected updateDocumentationVersion ( integer $previous, integer $version ) : true
$previous integer Previous version
$version integer New version
return true

Property Details

$configResource protected_oe property

protected ConfigResource,ZF\Configuration $configResource
return ZF\Configuration\ConfigResource

$docsConfigResource protected_oe property

protected null|ConfigResource,ZF\Configuration $docsConfigResource
return null | ZF\Configuration\ConfigResource

$moduleNameFilter protected_oe property

protected FilterChain,Zend\Filter $moduleNameFilter
return Zend\Filter\FilterChain