1 | <?php |
||
8 | class PdoAllSalesmen implements ContainerInterface, \IteratorAggregate, \Countable |
||
9 | { |
||
10 | /** |
||
11 | * @var \PDO |
||
12 | */ |
||
13 | public $pdo; |
||
14 | |||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | public $php_salesman_class; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | public $table = "salesmen"; |
||
24 | |||
25 | /** |
||
26 | * Holds all retrieved SalesmenInterface instances |
||
27 | * @var SalesmanInterface[] |
||
28 | */ |
||
29 | public $salesmen = array(); |
||
30 | |||
31 | /** |
||
32 | * @param \PDO $pdo PDO handler |
||
33 | * @param string $table The table name to use |
||
34 | * @param SalesmanInterface|null $salesman Class or object template to work with |
||
35 | */ |
||
36 | public function __construct (\PDO $pdo, $table, SalesmanInterface $salesman = null) |
||
73 | |||
74 | |||
75 | /** |
||
76 | * @return array |
||
77 | */ |
||
78 | public function __debugInfo() { |
||
85 | |||
86 | /** |
||
87 | * @implements ContainerInterface |
||
88 | */ |
||
89 | public function has ($aussendienst_nummer) { |
||
95 | |||
96 | |||
97 | /** |
||
98 | * @implements ContainerInterface |
||
99 | */ |
||
100 | public function get ($aussendienst_nummer) { |
||
112 | |||
113 | |||
114 | /** |
||
115 | * @return Iterator |
||
116 | */ |
||
117 | public function getIterator() |
||
121 | |||
122 | |||
123 | /** |
||
124 | * @return int |
||
125 | */ |
||
126 | public function count() |
||
130 | } |
||
131 |
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: