1 | <?php |
||
18 | class Priloha extends FlexiBeeRW |
||
19 | { |
||
20 | |||
21 | /** |
||
22 | * Evidence užitá objektem. |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | public $evidence = 'priloha'; |
||
27 | |||
28 | /** |
||
29 | * Evidence s přílohami |
||
30 | * |
||
31 | * @var array |
||
32 | */ |
||
33 | public static $relatedEvidence = [ |
||
34 | 'prodejka' => 'doklFak', 'pohledavka' => 'doklFak', 'zavazek' => 'doklFak', |
||
35 | 'faktura-prijata' => 'doklFak', 'faktura-vydana' => 'doklFak', |
||
36 | 'interni-doklad' => 'doklInt', 'pokladni-pohyb' => 'doklInt', 'vzajemny-zapocet' => 'doklInt', |
||
37 | 'banka' => 'doklInt', |
||
38 | 'poptavka-vydana' => 'doklObch', 'poptavka-prijata' => 'doklObch', 'objednavka-prijata' => 'doklObch', |
||
39 | 'nabidka-vydana' => 'doklObch', |
||
40 | 'objednavka-vydana' => 'doklObch', 'nabidka-prijata' => 'doklObch', |
||
41 | 'skladovy-pohyb' => 'doklSklad', |
||
42 | 'cenik' => 'cenik', |
||
43 | 'adresar' => 'adresar', 'kontakt' => 'kontakt' |
||
44 | ]; |
||
45 | |||
46 | /** |
||
47 | * Přilož Soubor |
||
48 | * |
||
49 | * @param string $filepath |
||
50 | * @param array $attachmentData |
||
51 | */ |
||
52 | public function attachFile($filepath, $attachmentData = []) |
||
70 | |||
71 | /** |
||
72 | * Obtain url for Attachment Download |
||
73 | * |
||
74 | * @return string url |
||
75 | */ |
||
76 | public static function getDownloadUrl($object) |
||
80 | |||
81 | /** |
||
82 | * Obtain first attachment for given object |
||
83 | * |
||
84 | * @param FlexiBeeRO $object |
||
85 | * @return array |
||
86 | */ |
||
87 | public static function getFirstAttachment($object) |
||
92 | |||
93 | /** |
||
94 | * Send "download" headers first and then file itself |
||
95 | * |
||
96 | * @param FlexiBeeRO $object |
||
97 | * @param int|string $attachmentID |
||
98 | */ |
||
99 | public static function download($object, $attachmentID = null) |
||
111 | |||
112 | public static function saveToFile($object, $filename, $attachmentID = null) |
||
116 | |||
117 | /** |
||
118 | * Add Attachment from File |
||
119 | * |
||
120 | * @param FlexiBeeRW $object |
||
121 | * @param string $filename |
||
122 | * |
||
123 | * @return int HTTP response code |
||
124 | */ |
||
125 | public static function addAttachmentFromFile($object, $filename) |
||
129 | |||
130 | /** |
||
131 | * Add Attachment related to current $object content |
||
132 | * |
||
133 | * @param FlexiBeeRW $object |
||
134 | * @param string $filename |
||
135 | * @param string $attachment Body |
||
136 | * @param string $contentType Attachment Content-Type |
||
137 | * |
||
138 | * @return int HTTP Response code |
||
139 | */ |
||
140 | public static function addAttachment($object, $filename, $attachment, $contentType) |
||
150 | |||
151 | /** |
||
152 | * Obtain Record related attachments list |
||
153 | * |
||
154 | * @param FlexiBeeRO $object |
||
155 | * @return array |
||
156 | */ |
||
157 | public static function getAttachmentsList($object) |
||
168 | |||
169 | } |
||
170 |
According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.
}
To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.