/** * {@inheritdoc} */ public function hasChildren() { // Use attached repository if possible if ($this->getRepository()) { return $this->getRepository()->hasChildren($this->getRepositoryPath()); } $iterator = new RecursiveDirectoryIterator($this->getFilesystemPath()); $iterator->rewind(); return $iterator->valid(); }
public function __construct($filesystemPath, $repositoryPath, $flags = null) { parent::__construct($filesystemPath, $flags); $this->repositoryPath = rtrim($repositoryPath, '/'); $this->flags = $flags; }
/** * {@inheritdoc} */ public function hasChildren($path) { $filesystemPath = $this->getFilesystemPath($path); if (!is_dir($filesystemPath)) { return false; } $iterator = new RecursiveDirectoryIterator($filesystemPath); $iterator->rewind(); return $iterator->valid(); }