Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
condition_asset_status.inc
1 <?php
17 require_once SQ_CORE_PACKAGE_PATH.'/system/conditions/condition/condition.inc';
18 
33 {
34 
35 
42  function __construct($assetid=0)
43  {
44  parent::__construct($assetid);
45 
46  }//end constructor
47 
48 
58  public static function evaluate(Asset $asset, Array $condition_data)
59  {
60  $required_statii = explode(',', $condition_data['status']);
61  $current_status = $asset->status;
62 
63  $status_in_list = FALSE;
64 
65  foreach ($required_statii as $required_status) {
66 
67  if (!is_numeric($required_status)) {
68  $required_status = get_status_value(trim($required_status));
69  }//end if
70 
71  if ($current_status == $required_status) {
72  $status_in_list = TRUE;
73  }//end if
74 
75 
76  }//end foreach
77 
78  return $status_in_list;
79 
80  }//end evaluate()
81 
82 
83 
84 
85 }//end class
86 ?>