| 1 | <?php |
||
| 4 | class RangedAggregation { |
||
| 5 | |||
| 6 | private static $ranged_aggregations = array(); |
||
| 7 | |||
| 8 | |||
| 9 | /** |
||
| 10 | * @param string $title |
||
| 11 | * @param string $field |
||
| 12 | */ |
||
| 13 | public function __construct($title, $field) { |
||
| 19 | |||
| 20 | |||
| 21 | /** |
||
| 22 | * @param double $from |
||
| 23 | * @param double $to |
||
| 24 | * @param string $name |
||
| 25 | */ |
||
| 26 | public function addRange($from, $to, $name) { |
||
| 29 | |||
| 30 | |||
| 31 | public function getRangeAgg() { |
||
| 34 | |||
| 35 | |||
| 36 | public function getFilter($chosenName) { |
||
| 57 | |||
| 58 | |||
| 59 | public static function getByTitle($title) { |
||
| 62 | |||
| 63 | |||
| 64 | public static function getTitles() { |
||
| 67 | } |
||
| 68 |
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: