1 | <?php |
||
6 | class PdoActiveSalesmen implements ContainerInterface, \IteratorAggregate, \Countable |
||
7 | { |
||
8 | /** |
||
9 | * @var \PDO |
||
10 | */ |
||
11 | public $pdo; |
||
12 | |||
13 | public $table = "salesmen"; |
||
14 | |||
15 | public $salesmen = array(); |
||
16 | |||
17 | public function __construct (\PDO $pdo, $table, SalesmanInterface $salesman = null) |
||
50 | |||
51 | |||
52 | /** |
||
53 | * @implements ContainerInterface |
||
54 | */ |
||
55 | public function has ($aussendienst_nummer) { |
||
58 | |||
59 | |||
60 | /** |
||
61 | * @implements ContainerInterface |
||
62 | */ |
||
63 | public function get ($aussendienst_nummer) { |
||
71 | |||
72 | |||
73 | /** |
||
74 | * @return Iterator |
||
75 | */ |
||
76 | public function getIterator() |
||
80 | |||
81 | |||
82 | /** |
||
83 | * @return int |
||
84 | */ |
||
85 | public function count() |
||
89 | } |
||
90 |
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: