Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
filecontroller.php
1<?php
2
4
6
13{
15 private $file;
16
18 private $loader;
19
25 public function delete()
26 {
27 $this->getOutputFile()->remove();
28 }
29
39 public function configureFile($id, $moduleId, $dir, $name)
40 {
41 $this->getOutputFile()->setId($id)->setModuleId($moduleId)->setDir($dir)->setName($name);
42 return $this;
43 }
44
48 public function getLoader()
49 {
50 if (!$this->loader)
51 {
52 $this->loader = new Loader($this->getOutputFile());
53 }
54
55 return $this->loader;
56 }
57
63 protected function getOutputFile()
64 {
65 if (!$this->file)
66 {
67 $this->file = new Output\File();
68 }
69
70 $this->setOutput($this->file);
71
72 return $this->file;
73 }
74
81 public function setOutput(Output\Base $output)
82 {
83 if (! $output instanceof Output\File)
84 {
85 throw new ArgumentException('Output File expected.');
86 }
87
88 parent::setOutput($output);
89 return $this;
90 }
91
97 public function getOutput()
98 {
99 if (!$this->output)
100 {
101 $this->output = new Output\File();
102 }
103
104 return $this->output;
105 }
106}
configureFile($id, $moduleId, $dir, $name)