コード例 #1
0
 /**
  * {@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();
 }
コード例 #2
0
 /**
  * {@inheritdoc}
  */
 public function hasChildren($path)
 {
     $filesystemPath = $this->getFilesystemPath($path);
     if (!is_dir($filesystemPath)) {
         return false;
     }
     $iterator = new RecursiveDirectoryIterator($filesystemPath);
     $iterator->rewind();
     return $iterator->valid();
 }