Source for file Folder.php
Documentation is available at Folder.php
* "THE BEER-WARE LICENSE" (Revision 42):
* "Sven Strittmatter" <ausserirdisch@sven-space.de> wrote this file.
* As long as you retain this notice you can do whatever you want with
* this stuff. If we meet some day, and you think this stuff is worth it,
* you can buy me a beer in return.
* @package MediaSearch_File
* @copyright Copyright (c) 2009 Sven Strittmatter
* @see MediaSearch_File_Abstract
require_once('MediaSearch/File/Abstract.php');
* Concrete implementation of a folder. Objects of this type are nodes
* in a file tree. A folder can have some files as chields. Theese could
* be files or folders. This is the composite part of the composite
* @package MediaSearch_File
* @copyright Copyright (c) 2009 Sven Strittmatter
* Contains any number of child
* MediaSearch_File_Abstract objects.
* @see MediaSearch_File_Abstract
* Adds files as childs to the node.
* @param MediaSearch_File_Abstract $file
public function addFile(MediaSearch_File_Abstract $file) {
* Returns whether this node has childs or not.
return (count($this->files) > 0);
* Implements MediaSearch_Interface_Visitable.
* Lets the visitor visit all files if there are any.
* @param MediaSearch_Interface_Visitor $visitor
public function acceptVisitor(MediaSearch_File_Visitor $visitor) {
$file->acceptVisitor($visitor);
* Returns the files if there are any
|