| 1 | <?php |
||
| 9 | class QueryCommand extends Command implements SQLResultInterface |
||
| 10 | { |
||
| 11 | public $query; |
||
| 12 | public $fields; |
||
| 13 | public $insertId; |
||
| 14 | public $affectedRows; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var int |
||
| 18 | */ |
||
| 19 | protected $id = self::QUERY; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @override |
||
| 23 | * @inheritDoc |
||
| 24 | */ |
||
| 25 | public function getSQL() |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @override |
||
| 32 | * @inheritDoc |
||
| 33 | */ |
||
| 34 | public function getRows() |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @override |
||
| 41 | * @inheritDoc |
||
| 42 | */ |
||
| 43 | public function getFields() |
||
| 47 | } |
||
| 48 |
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: