Hoa central
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Hoa\Iterator\Directory Class Reference
Inheritance diagram for Hoa\Iterator\Directory:

Public Member Functions

 __construct ($path, $splFileInfoClass=null)
 
 current ()
 
 getRelativePath ()
 

Protected Member Functions

 setRelativePath ($path)
 

Protected Attributes

 $_splFileInfoClass = null
 
 $_relativePath = null
 

Detailed Description

Class .

Extending the SPL DirectoryIterator class.

Definition at line 47 of file Directory.php.

Constructor & Destructor Documentation

Hoa\Iterator\Directory::__construct (   $path,
  $splFileInfoClass = null 
)

Constructor. Please, see ::__construct() method. We add the $splFileInfoClass parameter.

Parameters
string$pathPath.
string$splFileInfoClassSplFileInfo classname.

Definition at line 73 of file Directory.php.

74  {
75  $this->_splFileInfoClass = $splFileInfoClass;
76  parent::__construct($path);
77  $this->setRelativePath($path);
78 
79  return;
80  }

Here is the call graph for this function:

Member Function Documentation

Hoa\Iterator\Directory::current ( )

Current. Please, see ::current() method.

Returns
mixed

Definition at line 88 of file Directory.php.

89  {
90  $out = parent::current();
91 
92  if (null !== $this->_splFileInfoClass &&
93  $out instanceof \SplFileInfo) {
94  $out->setInfoClass($this->_splFileInfoClass);
95  $out = $out->getFileInfo();
96 
97  if ($out instanceof \Hoa\Iterator\SplFileInfo) {
98  $out->setRelativePath($this->getRelativePath());
99  }
100  }
101 
102  return $out;
103  }

Here is the call graph for this function:

Hoa\Iterator\Directory::getRelativePath ( )

Get relative path (if given).

Returns
string

Definition at line 124 of file Directory.php.

125  {
126  return $this->_relativePath;
127  }

Here is the caller graph for this function:

Hoa\Iterator\Directory::setRelativePath (   $path)
protected

Set relative path.

Parameters
string$relativePathRelative path.
Returns
string

Definition at line 111 of file Directory.php.

112  {
113  $old = $this->_relativePath;
114  $this->_relativePath = $path;
115 
116  return $old;
117  }

Here is the caller graph for this function:

Member Data Documentation

Hoa\Iterator\Directory::$_relativePath = null
protected

Definition at line 61 of file Directory.php.

Hoa\Iterator\Directory::$_splFileInfoClass = null
protected

Definition at line 54 of file Directory.php.


The documentation for this class was generated from the following file: