|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* Finance module for HiPanel |
|
5
|
|
|
* |
|
6
|
|
|
* @link https://github.com/hiqdev/hipanel-module-finance |
|
7
|
|
|
* @package hipanel-module-finance |
|
8
|
|
|
* @license BSD-3-Clause |
|
9
|
|
|
* @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/) |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
namespace hipanel\modules\finance\models; |
|
13
|
|
|
|
|
14
|
|
|
use Yii; |
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* Class DomainResource |
|
18
|
|
|
* @package hipanel\modules\finance\models |
|
19
|
|
|
*/ |
|
20
|
|
|
class DomainResource extends Resource |
|
21
|
|
|
{ |
|
22
|
|
|
public static function index() |
|
23
|
|
|
{ |
|
24
|
|
|
return 'resources'; |
|
25
|
|
|
} |
|
26
|
|
|
|
|
27
|
|
|
public static function type() |
|
28
|
|
|
{ |
|
29
|
|
|
return 'resource'; |
|
30
|
|
|
} |
|
31
|
|
|
|
|
32
|
|
|
const TYPE_DOMAIN_REGISTRATION = 'dregistration'; |
|
33
|
|
|
const TYPE_DOMAIN_TRANSFER = 'dtransfer'; |
|
34
|
|
|
const TYPE_DOMAIN_RENEWAL = 'drenewal'; |
|
35
|
|
|
const TYPE_DOMAIN_DELETE_AGP = 'ddelete_agp'; |
|
36
|
|
|
const TYPE_DOMAIN_RESTORE_EXPIRED = 'drestore_expired'; |
|
37
|
|
|
const TYPE_DOMAIN_RESTORE_DELETED = 'drestore_deleted'; |
|
38
|
|
|
|
|
39
|
|
|
const TYPE_PREMIUM_DNS = 'premium_dns'; |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* @return array |
|
43
|
|
|
*/ |
|
44
|
|
|
public function getAvailableTypes() |
|
45
|
|
|
{ |
|
46
|
|
|
return [ |
|
47
|
|
|
static::TYPE_DOMAIN_REGISTRATION => Yii::t('hipanel/finance/tariff', 'Registration'), |
|
48
|
|
|
static::TYPE_DOMAIN_TRANSFER => Yii::t('hipanel/finance/tariff', 'Transfer'), |
|
49
|
|
|
static::TYPE_DOMAIN_RENEWAL => Yii::t('hipanel/finance/tariff', 'Renewal'), |
|
50
|
|
|
static::TYPE_DOMAIN_DELETE_AGP => Yii::t('hipanel/finance/tariff', 'Delete in AGP'), |
|
51
|
|
|
static::TYPE_DOMAIN_RESTORE_EXPIRED => Yii::t('hipanel/finance/tariff', 'Restoring expired'), |
|
52
|
|
|
static::TYPE_DOMAIN_RESTORE_DELETED => Yii::t('hipanel/finance/tariff', 'Restoring deleted'), |
|
53
|
|
|
]; |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
public function getServiceTypes() |
|
57
|
|
|
{ |
|
58
|
|
|
return [ |
|
59
|
|
|
static::TYPE_PREMIUM_DNS => Yii::t('hipanel/finance/tariff', 'Premium DNS') |
|
60
|
|
|
]; |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
|
|
64
|
|
|
public function isTypeCorrect() |
|
65
|
|
|
{ |
|
66
|
|
|
return isset($this->getAvailableTypes()[$this->type]); |
|
|
|
|
|
|
67
|
|
|
} |
|
68
|
|
|
} |
|
69
|
|
|
|
Since your code implements the magic getter
_get, this function will be called for any read access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.