Class Rename

Summary

Fully Qualified Name: Zend\Filter\File\Rename
Extends: AbstractFilter

Description

Methods

Name Description Defined By
__construct() Class constructor Rename
addFile() Adds a new file or directory as target to the existing ones Rename
filter() Defined by Zend\Filter\Filter Rename
getFile() Returns the files to rename and their new name and location Rename
getNewName() Returns only the new filename without moving it But existing files will be erased when the overwrite option is true Rename
setFile() Sets a new file or directory as target, deleting existing ones Rename

Method Details

__construct()

Class constructor

Options argument may be either a string, a Zend\Config\Config object, or an array. If an array or Zend\Config\Config object, it accepts the following keys: 'source' => Source filename or directory which will be renamed 'target' => Target filename or directory, the new name of the source file 'overwrite' => Shall existing files be overwritten ? 'randomize' => Shall target files have a random postfix attached?

Parameter Name Type Description
$options string|array|\Traversable Target

Returns:

addFile()

Adds a new file or directory as target to the existing ones

Array accepts the following keys: 'source' => Source filename or directory which will be renamed 'target' => Target filename or directory, the new name of the sourcefile 'overwrite' => Shall existing files be overwritten? 'randomize' => Shall target files have a random postfix attached?

Parameter Name Type Description
$options string|array Old

Returns: \Rename

filter()

Defined by Zend\Filter\Filter

Renames the file $value to the new name set before Returns the file $value, removing all but digit characters

Parameter Name Type Description
$value string|array Full

Returns: string|array The new filename which has been set

getFile()

Returns the files to rename and their new name and location

Returns: array

getNewName()

Returns only the new filename without moving it But existing files will be erased when the overwrite option is true

Parameter Name Type Description
$value string Full
$source bool Return

Returns: string The new filename which has been set

setFile()

Sets a new file or directory as target, deleting existing ones

Array accepts the following keys: 'source' => Source filename or directory which will be renamed 'target' => Target filename or directory, the new name of the sourcefile 'overwrite' => Shall existing files be overwritten? 'randomize' => Shall target files have a random postfix attached?

Parameter Name Type Description
$options string|array Old

Returns: self

Top