Commit 8a2eb2ed authored by Shakarim Sapa's avatar Shakarim Sapa

- Добавлен метод получения всех условий имеющихся в системе;

 - Добавлено необязательное свойство name;
parent 059c98d4
...@@ -58,4 +58,16 @@ class Conditions { ...@@ -58,4 +58,16 @@ class Conditions {
// Если все условия верны, возвращаем true // Если все условия верны, возвращаем true
return true; return true;
} }
/**
* @return array
*/
public function getConditions(){
$data = array();
foreach(self::$config as $condition) {
$class = $condition['class']::init();
$data[$class::CONDITION_ID] = $class->getName();
}
return $data;
}
} }
\ No newline at end of file
...@@ -7,6 +7,8 @@ use common\modules\triggers\components\conditions\vendor\ConditionInterface; ...@@ -7,6 +7,8 @@ use common\modules\triggers\components\conditions\vendor\ConditionInterface;
class CheckEmailToOpening extends ConditionBase implements ConditionInterface { class CheckEmailToOpening extends ConditionBase implements ConditionInterface {
const CONDITION_ID = 1; const CONDITION_ID = 1;
public $name = 'Письмо было открыто';
/** /**
* @param null|string $conditionName * @param null|string $conditionName
* @return $this mixed * @return $this mixed
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment