| 1 | = [wiki:DeployerGuide Przewodnik wdrożeniowca] > Usuwanie produktu = |
| 2 | |
| 3 | |
| 4 | ''' Definicja parametrów: ''' |
| 5 | {{{ |
| 6 | #!php |
| 7 | <?php |
| 8 | |
| 9 | /** |
| 10 | * Usuwa produkt produkt |
| 11 | * |
| 12 | * @param data Array - Tablica z parametrami |
| 13 | * @param data['symbol'] Text - symbol produktu musi być unikalny w obrębie jednostki |
| 14 | * |
| 15 | * @return Int - id produktu jeśli sukces (depository:depoid), 0 w razie niepowodzenia |
| 16 | * |
| 17 | * @throws Exception - SoapFault |
| 18 | */ |
| 19 | Int deleteProduct(Array data) |
| 20 | |
| 21 | ?> |
| 22 | }}} |
| 23 | |
| 24 | ''' Przykłady wywołań: ''' |
| 25 | {{{ |
| 26 | #!php |
| 27 | |
| 28 | // Plik MyService.php umieszczony w apps/edokumenty. |
| 29 | // MyService.php |
| 30 | <?php |
| 31 | |
| 32 | define('EDOK_API_LOGIN', 'developer'); |
| 33 | define('EDOK_API_PASSWORD', 'developer'); |
| 34 | define('DEFAULT_ENTITY_SYMBOL', 'demo'); |
| 35 | |
| 36 | require_once('./classes/eDokumentyApi/EDokApiClient.inc'); |
| 37 | |
| 38 | $options = array( |
| 39 | 'location' => 'http://{host}:{port}/eDokumentyApi.php', |
| 40 | "uri" => "eDokumentyAPI", |
| 41 | 'encoding'=>'UTF-8' |
| 42 | ); |
| 43 | |
| 44 | $client = new EDokApiClient(NULL, $options); |
| 45 | $client->setUser(EDOK_API_LOGIN); |
| 46 | $client->setPass(md5(EDOK_API_PASSWORD)); |
| 47 | $header = new SoapHeader('eDokumentyAPI', 'entity_symbol', DEFAULT_ENTITY_SYMBOL); |
| 48 | $client->__setSoapHeaders($header); |
| 49 | |
| 50 | |
| 51 | |
| 52 | ?> |
| 53 | }}} |