HCE Project DC service web UI  0.2
Hierarchical Cluster Engine DC service web UI
 All Classes Namespaces Files Functions Variables Pages
AccountTypesLimitsSite.php
Go to the documentation of this file.
1 <?php
2 
3 abstract class AccountTypesLimitsSite extends CFormModel
4 {
10  public $priority;
11  public $maxURLs;
12  public $maxResources;
14  public $maxErrors;
17  public $requestDelay;
18 
24  private $__key = 'Site';
25 
31  public function validateSite()
32  {
33  if (isset($_POST)) {
34  $attributes = $_POST;
35  } elseif (isset($_GET)) {
36  $attributes = $_GET;
37  }
38  if (empty($attributes)) {
39  return false;
40  }
41 
42  $this->attributes = $attributes;
43  if (!$this->validate()) {
44  return false;
45  }
46 
47  return true;
48  }
49 
55  public function rules()
56  {
57  $userId = Yii::app()->user->id;
58  $key = $this->__getAccountTypesLimitsKey();
59  $rules = AccountTypesLimits::model()->getAccountTypesLimitsList($userId, $key);
60 
61  return $rules;
62  }
63 
69  protected function __getAccountTypesLimitsKey()
70  {
71  return $this->__key;
72  }
73 }