Documentation/Index/VatNoteCostBeanBeforeSave: VatNoteCostBeforeSave.inc

Plik VatNoteCostBeforeSave.inc, 817 bytes (dodany przez TS, 8 years temu)
xx
Line 
1<?php
2
3/**
4 * VatNoteCostBeforeSave
5 *
6 * @author Tomasz Świenty
7 * @version 0.1
8 * @copyright Copyright (c) eDokumenty
9 */
10final class VatNoteCostBeforeSave {
11
12
13
14    public static function init($args) {
15
16        if (!isset($args['container'])) {
17            return FALSE;
18        }
19
20        if (!is_object($args['container']) OR !is_a($args['container'], 'Bean')) {
21            return FALSE;
22        }
23
24        // dane z beana z formularza
25        $data = $args['container']->data;
26       
27        // np walidacja pola uwagi
28        if (!isset($data['remark']) OR bs_empty_str($data['remark'])) {
29            throw new WidgetException('', 'Pole Opis wymaga wypełnienia');
30        }
31               
32    }
33
34}
35
36if (isset($args)) {
37    VatNoteCostBeforeSave::init($args);
38}
39
40?>