| 1 |
<?php |
| 2 |
|
| 3 |
if ( ! defined( 'ABSPATH' ) ) { |
| 4 |
exit; // Exit if accessed directly |
| 5 |
} |
| 6 |
|
| 7 |
/** |
| 8 |
* PropertyHive third party contacts |
| 9 |
* |
| 10 |
* The PropertyHive third party contacts class stores data regarding third party contacts. |
| 11 |
* |
| 12 |
* @class PH_Third_Party_Contacts |
| 13 |
* @version 1.0.0 |
| 14 |
* @package PropertyHive/Classes |
| 15 |
* @category Class |
| 16 |
* @author PropertyHive |
| 17 |
*/ |
| 18 |
class PH_Third_Party_Contacts { |
| 19 |
|
| 20 |
private $categories; |
| 21 |
|
| 22 |
public function __construct() { |
| 23 |
$this->categories = apply_filters( 'propertyhive_third_party_contact_categories', array( |
| 24 |
'1' => __( 'Accountant', 'propertyhive' ), |
| 25 |
'2' => __( 'Architect', 'propertyhive' ), |
| 26 |
'3' => __( 'Board Contractor', 'propertyhive' ), |
| 27 |
'4' => __( 'Builder', 'propertyhive' ), |
| 28 |
'5' => __( 'Cleaner', 'propertyhive' ), |
| 29 |
'6' => __( 'Decorator', 'propertyhive' ), |
| 30 |
'7' => __( 'Electrician', 'propertyhive' ), |
| 31 |
'8' => __( 'Gas Engineer', 'propertyhive' ), |
| 32 |
'9' => __( 'Plumbers', 'propertyhive' ), |
| 33 |
'10' => __( 'Removals', 'propertyhive' ), |
| 34 |
'11' => __( 'Roofer', 'propertyhive' ), |
| 35 |
'12' => __( 'Solicitor', 'propertyhive' ), |
| 36 |
'13' => __( 'Surveyor', 'propertyhive' ), |
| 37 |
'14' => __( 'Other', 'propertyhive' ), |
| 38 |
) ); |
| 39 |
} |
| 40 |
|
| 41 |
/** |
| 42 |
* Auto-load in-accessible properties on demand. |
| 43 |
* @param mixed $key |
| 44 |
* @return mixed |
| 45 |
*/ |
| 46 |
public function __get( $key ) { |
| 47 |
if ( 'categories' == $key ) { |
| 48 |
return $this->get_categories(); |
| 49 |
} |
| 50 |
} |
| 51 |
|
| 52 |
public function get_categories() { |
| 53 |
return $this->categories; |
| 54 |
} |
| 55 |
|
| 56 |
public function get_category( $category_id ) { |
| 57 |
if ( isset( $this->categories[$category_id] ) ) |
| 58 |
{ |
| 59 |
return $this->categories[$category_id]; |
| 60 |
} |
| 61 |
return false; |
| 62 |
} |
| 63 |
|
| 64 |
} |