1 | <?php |
||
18 | class MyLead extends AbstractNetwork implements NetworkInterface |
||
19 | { |
||
20 | /** |
||
21 | * @var object |
||
22 | */ |
||
23 | private $_network = null; |
||
24 | private $_username = ''; |
||
25 | private $_password = ''; |
||
26 | private $_idSite = ''; |
||
27 | |||
28 | /** |
||
29 | * @method __construct |
||
30 | */ |
||
31 | public function __construct(string $username, string $password, string $idSite='') |
||
40 | |||
41 | public function login(string $username, string $password,string $idSite=''): bool{ |
||
61 | |||
62 | /** |
||
63 | * @return bool |
||
64 | */ |
||
65 | public function checkLogin() : bool |
||
69 | |||
70 | /** |
||
71 | * @return array of Merchants |
||
72 | * @throws \Exception |
||
73 | */ |
||
74 | public function getMerchants() : array |
||
78 | |||
79 | /** |
||
80 | * @param null $merchantID |
||
81 | * @param int $page |
||
82 | * @param int $items_per_page |
||
83 | * @return DealsResultset array of Deal |
||
84 | * @throws \Exception |
||
85 | */ |
||
86 | public function getDeals($merchantID=NULL,int $page=0,int $items_per_page=100 ): DealsResultset |
||
91 | |||
92 | /** |
||
93 | * @param \DateTime $dateFrom |
||
94 | * @param \DateTime $dateTo |
||
95 | * @param array $arrMerchantID |
||
96 | * @return array of Transaction |
||
97 | * @throws \Exception |
||
98 | */ |
||
99 | public function getSales(\DateTime $dateFrom, \DateTime $dateTo, array $arrMerchantID = array()) : array |
||
130 | |||
131 | /** |
||
132 | * @param \DateTime $dateFrom |
||
133 | * @param \DateTime $dateTo |
||
134 | * @param int $merchantID |
||
135 | * @return array of Stat |
||
136 | */ |
||
137 | public function getStats(\DateTime $dateFrom, \DateTime $dateTo, int $merchantID = 0) : array |
||
141 | |||
142 | |||
143 | /** |
||
144 | * @param array $params |
||
145 | * @return ProductsResultset |
||
146 | * @throws \Exception |
||
147 | */ |
||
148 | public function getProducts(array $params = []): ProductsResultset |
||
152 | |||
153 | |||
154 | |||
155 | |||
156 | } |
||
157 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: