public function getId($rule) { $tmp = array_search($rule, $this->rules, true); if (!empty($tmp)) { return $tmp; } else { RuleError::notExists($rule); return -1; } }