1 <?php
2
3 namespace rpf\api\module;
4 use rpf\api\apiModule;
5
6 7 8 9 10
11 class bbOrder_readDisposition extends apiModule
12 {
13 const rpcMethod = 'bbOrder::readDisposition';
14
15 16 17 18
19 public function setFilterOrderId($oeid = 0)
20 {
21 return $this->addParam('oeid', (int) $oeid);
22 }
23
24 25 26 27
28 public function setFilterAccountable($accountable = false)
29 {
30 return $this->addParam('return_accountable', (bool) $accountable);
31 }
32
33 34 35 36
37 public function setFilterActive($active = false)
38 {
39 return $this->addParam('return_active', (bool) $active);
40 }
41
42
43 protected function getPatchedResult($result = array())
44 {
45 46 47
48 if (strpos($result['so_type'], 'hosting_zusatz_exchange_') === 0)
49 {
50 $regex = "/^(\\S*@\\S*\\.\\S{2,8})/";
51 preg_match($regex, $result['name'], $matches);
52 $result['_patch_exchange_account'] = $matches[1];
53 }
54
55 56 57
58 else if($result['so_type'] == 'ssl')
59 {
60 $regEx = "/(\\S*\\.\\S*\\.\\S*)/";
61 preg_match($regEx, $row['descr'], $domain);
62 $result['_patch_ssldomain'] = $domain[1];
63 }
64 }
65
66
67
68
69 public function getDisposition($ordNr = false)
70 {
71 if ($ordNr !== false && isset($this->disposition[$ordNr]))
72 {
73 return $this->disposition[$ordNr];
74 }
75 else if (!empty($this->disposition))
76 {
77 return $this->disposition;
78 }
79 else
80 {
81 throw new \Exception('We don\'t have any dispositions', 404);
82 }
83 }
84 }