Bitrix-D7  20.0.0
directoryentry.php
См. документацию.
1 <?php
2 namespace Bitrix\Main\IO;
3 
4 abstract class DirectoryEntry
5  extends FileSystemEntry
6 {
7  public function __construct($path, $siteId = null)
8  {
10  }
11 
12  public function create()
13  {
14  if ($this->isExists())
15  return;
16 
17  $arMissingDirs = array($this->getName());
18  $dir = $this->getDirectory();
19  while (!$dir->isExists())
20  {
21  $arMissingDirs[] = $dir->getName();
22  $dir = $dir->getDirectory();
23  }
24 
25  $arMissingDirs = array_reverse($arMissingDirs);
26  foreach ($arMissingDirs as $dirName)
27  $dir = $dir->createSubdirectory($dirName);
28  }
29 
30  /**
31  * @return FileSystemEntry[]
32  */
33  abstract public function getChildren();
34 
35  /**
36  * @param string $path
37  * @return DirectoryEntry
38  */
39  abstract public function createSubdirectory($name);
40 
41  public function isDirectory()
42  {
43  return true;
44  }
45 
46  public function isFile()
47  {
48  return false;
49  }
50 
51  public function isLink()
52  {
53  return false;
54  }
55 }
Bitrix\Main\IO\FileSystemEntry\$path
$path
Definition: filesystementry.php:8
Bitrix\Main\IO\DirectoryEntry\isLink
isLink()
Definition: directoryentry.php:51
Bitrix\Main\IO\DirectoryEntry\create
create()
Definition: directoryentry.php:12
Bitrix\Main\IO\FileSystemEntry\$siteId
$siteId
Definition: filesystementry.php:11
Bitrix\Main\IO\DirectoryEntry\isFile
isFile()
Definition: directoryentry.php:46
Bitrix\Main\IO\DirectoryEntry\getChildren
getChildren()
Bitrix\Main\IO\FileSystemEntry
Definition: filesystementry.php:6
Bitrix\Sender\Connector\__construct
__construct(Base $connector)
Constructor.
Definition: resultview.php:40
Bitrix\Main\IO\DirectoryEntry
Definition: directoryentry.php:4
Bitrix\Main\IO
Definition: main/lib/io/directory.php:2
Bitrix\Main\IO\FileSystemEntry\getDirectory
getDirectory()
Definition: filesystementry.php:71
Bitrix\Main\IO\DirectoryEntry\__construct
__construct($path, $siteId=null)
Definition: directoryentry.php:7
Bitrix\Main\IO\DirectoryEntry\isDirectory
isDirectory()
Definition: directoryentry.php:41
Bitrix\Main\IO\DirectoryEntry\createSubdirectory
createSubdirectory($name)
Bitrix\Main\IO\FileSystemEntry\getName
getName()
Definition: filesystementry.php:56
Bitrix\Main\IO\FileSystemEntry\isExists
isExists()