DeployerGuide/Customization/ProcessAutomation/PluginsCommands: DeletePropertiesCommand.inc

Plik DeletePropertiesCommand.inc, 1.9 KB (dodany przez JP, 12 years temu)
xx
Line 
1<?php
2require_once(COMMANDS_DIR.'AbsCommand.inc');
3require_once(LIB_PATH.'util/Strings.inc');
4
5/**
6 *
7 *
8 * @uses AbsCommand
9 * @uses ICommand
10 * @final
11 */
12final class DeletePropertiesCommand extends AbsCommand implements ICommand {
13
14
15
16    /**
17     * getDescription
18     *
19     * @static
20     * @access public
21     * @return void
22     */
23    public static function getDescription() {
24
25        return Translator::translate('Usuń przypisania parametrów procedury');
26
27    }
28
29
30
31    /**
32     * getExpandedDescription
33     *
34     * @param string $params
35     * @static
36     * @access public
37     * @return void
38     */
39    public static function getExpandedDescription($params = NULL) {
40
41        return Translator::translate('Komenda służy do usunięcia parametrów procedury');
42
43    }
44
45
46
47    /**
48     * getCommandApi
49     *
50     * @param string $params
51     * @static
52     * @access public
53     * @return void
54     */
55    public static function getCommandApi($params = NULL) {
56
57        $api = array(
58        );
59
60        return $api;
61
62    }
63
64
65
66    /**
67     * execute
68     *
69     * @param Bean $bean
70     * @param string $params
71     * @access public
72     * @return void
73     */
74    public function execute(Bean $bean, $params) {
75
76        if (!($bean instanceof Document)) {
77            $this->setMessage(Translator::translate('Komenda może być wykonana jedynie dla dokumentu.'), 'WARNING');
78            $this->setMessage(Translator::translate('Komenda nie została wykonana.'), 'ERROR');
79            throw new CommandException($this);
80        }
81
82                $data['doc_id'] = $bean->get('doc_id');
83        $test = $this->db->delete('bpm_property_values', 'id____ = 1 AND procid=(
84           SELECT procid FROM documents WHERE doc_id = '.$data['doc_id'].' LIMIT 1)');         
85
86        $this->setMessage(Translator::translate('Komenda została wykonana poprawnie.'.$test), 'SUCCESS');
87
88        return TRUE;
89
90    }
91
92} // class RegisterDocumentCommand
93
94?>