class-base.php
1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
/**
* File Description:
* Base abstract class to be inherited by other classes
*
* @link https://wordpress.org/plugins/broken-link-checker/
* @since 2.0.0
*
* @author WPMUDEV (https://wpmudev.com)
* @package WPMUDEV_BLC\Core\Utils\Abstracts
*
* @copyright (c) 2022, Incsub (http://incsub.com)
*/
namespace WPMUDEV_BLC\Core\Utils\Abstracts;
// Abort if called directly.
defined( 'WPINC' ) || die;
/**
* Class Base
*
* @package WPMUDEV_BLC\Core\Utils\Abstracts
*/
abstract class Base extends Singleton {
/**
* Getter method.
*
* Allows access to extended site properties.
*
* @param string $key Property to get.
*
* @return mixed Value of the property. Null if not available.
* @since 2.0.0
*/
public function __get( $key ) {
// If set, get it.
if ( isset( $this->{$key} ) ) {
return $this->{$key};
}
return null;
}
/**
* Setter method.
*
* Set property and values to class.
*
* @param string $key Property to set.
* @param mixed $value Value to assign to the property.
*
* @since 2.0.0
*/
public function __set( $key, $value ) {
$this->{$key} = $value;
}
}