1 | <?php |
||
20 | 1 | abstract class BaseExport extends Component implements IResponse |
|
21 | { |
||
22 | |||
23 | const ID = 'export'; |
||
24 | |||
25 | /** @var int */ |
||
26 | protected $fetchLimit = 100000; |
||
27 | |||
28 | /** @var array */ |
||
29 | 1 | protected $header = []; |
|
30 | |||
31 | /** @var callable */ |
||
32 | protected $customData; |
||
33 | 1 | ||
34 | /** @var string */ |
||
35 | private $title; |
||
36 | |||
37 | /** |
||
38 | * @param string $label |
||
39 | */ |
||
40 | public function __construct($label = NULL) |
||
45 | |||
46 | protected function attached($presenter) |
||
53 | |||
54 | /** |
||
55 | * @return void |
||
56 | 1 | */ |
|
57 | abstract protected function printData(); |
||
58 | |||
59 | /** |
||
60 | * @param \Nette\Http\IResponse $httpResponse |
||
61 | * @param string $label |
||
62 | * @return void |
||
63 | */ |
||
64 | abstract protected function setHttpHeaders(\Nette\Http\IResponse $httpResponse, $label); |
||
65 | |||
66 | /** |
||
67 | * @param string $title |
||
68 | * @return self |
||
69 | */ |
||
70 | public function setTitle($title) |
||
75 | |||
76 | /** |
||
77 | * @return string |
||
78 | */ |
||
79 | public function getTitle() |
||
83 | |||
84 | /** |
||
85 | * Sets a limit which will be used in order to retrieve data from datasource. |
||
86 | * @param int $limit |
||
87 | * @return \Grido\Components\Export |
||
88 | */ |
||
89 | public function setFetchLimit($limit) |
||
94 | |||
95 | /** |
||
96 | * @return int |
||
97 | */ |
||
98 | public function getFetchLimit() |
||
102 | |||
103 | /** |
||
104 | * Sets a custom header of result CSV file (list of field names). |
||
105 | * @param array $header |
||
106 | * @return \Grido\Components\Export |
||
107 | */ |
||
108 | public function setHeader(array $header) |
||
113 | |||
114 | /** |
||
115 | * Sets a callback to modify output data. This callback must return a list of items. (array) function($datasource) |
||
116 | * DEBUG? You probably need to comment lines started with $httpResponse->setHeader in Grido\Components\Export.php |
||
117 | * @param callable $callback |
||
118 | * @return \Grido\Components\Export |
||
119 | */ |
||
120 | public function setCustomData($callback) |
||
125 | |||
126 | /** |
||
127 | * @internal |
||
128 | */ |
||
129 | public function handleExport() |
||
134 | |||
135 | /*************************** interface \Nette\Application\IResponse ***************************/ |
||
136 | |||
137 | /** |
||
138 | * Sends response to output. |
||
139 | * @param \Nette\Http\IRequest $httpRequest |
||
140 | * @param \Nette\Http\IResponse $httpResponse |
||
141 | * @return void |
||
142 | */ |
||
143 | public function send(\Nette\Http\IRequest $httpRequest, \Nette\Http\IResponse $httpResponse) |
||
154 | } |
||
155 |
Since your code implements the magic setter
_set
, this function will be called for any write access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.