PluginProbe
Property Hive / 2.3.1
Property Hive v2.3.1
2.3.1 2.3.0 2.2.6 2.2.5 2.2.4 2.2.3 2.2.2 1.4.46 1.4.47 1.4.48 1.4.49 1.4.5 1.4.50 1.4.51 1.4.52 1.4.53 1.4.54 1.4.55 1.4.56 1.4.57 1.4.58 1.4.59 1.4.6 1.4.60 1.4.61 All 261 releases
propertyhive / includes / class-ph-third-party-contacts.php

class-ph-third-party-contacts.php in Property Hive 2.3.1, at includes/class-ph-third-party-contacts.php

65 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- Legacy public global class PH_Third_Party_Contacts; preserving the existing PH_* class name is required for plugin and extension compatibility.
19 class PH_Third_Party_Contacts {
20
21 private $categories;
22
23 public function __construct() {
24 $this->categories = apply_filters( 'propertyhive_third_party_contact_categories', array(
25 '1' => __( 'Accountant', 'propertyhive' ),
26 '2' => __( 'Architect', 'propertyhive' ),
27 '3' => __( 'Board Contractor', 'propertyhive' ),
28 '4' => __( 'Builder', 'propertyhive' ),
29 '5' => __( 'Cleaner', 'propertyhive' ),
30 '6' => __( 'Decorator', 'propertyhive' ),
31 '7' => __( 'Electrician', 'propertyhive' ),
32 '8' => __( 'Gas Engineer', 'propertyhive' ),
33 '9' => __( 'Plumbers', 'propertyhive' ),
34 '10' => __( 'Removals', 'propertyhive' ),
35 '11' => __( 'Roofer', 'propertyhive' ),
36 '12' => __( 'Solicitor', 'propertyhive' ),
37 '13' => __( 'Surveyor', 'propertyhive' ),
38 '14' => __( 'Other', 'propertyhive' ),
39 ) );
40 }
41
42 /**
43 * Auto-load in-accessible properties on demand.
44 * @param mixed $key
45 * @return mixed
46 */
47 public function __get( $key ) {
48 if ( 'categories' == $key ) {
49 return $this->get_categories();
50 }
51 }
52
53 public function get_categories() {
54 return $this->categories;
55 }
56
57 public function get_category( $category_id ) {
58 if ( isset( $this->categories[$category_id] ) )
59 {
60 return $this->categories[$category_id];
61 }
62 return false;
63 }
64
65 }