root/tags/RELEASE_0_1_2/examples/EmptyConstructorClass.php

Revision 23, 461 bytes (checked in by schst, 2 years ago)

Added example that shows the use of an empty constructor.

Line 
1 <?php
2 /**
3  * Example class to highlight that it is possible to
4  * not pass any data to the constructor.
5  *
6  * @package     XJConfForPHP
7  * @subpackage  examples
8  * @author      Stephan Schmidt
9  */
10 class EmptyConstructorClass {
11     private $dataFromConstructor;
12
13     public function __construct($data = null) {
14         $this->dataFromConstructor = $data;
15     }
16
17     public function getDataFromConstructor() {
18         return $this->dataFromConstructor;
19     }
20 }
21 ?>
Note: See TracBrowser for help on using the browser.