/** * Returns an array of template names */ public static function templateNamesArrayForList() { $astResponseTypes = astPhoneTemplateModel::all(); foreach ($astResponseTypes as $astResponseType) { $astArrayForList[$astResponseType->PHONE_TEMPLATE_ID] = $astResponseType->TEMPLATE_NAME; } return $astArrayForList; }
/** * Returns an array of templates with the parameter. */ public static function parameterToTemplates($parameter) { $templatesWithParameter = []; $templates = astPhoneTemplateModel::all(); foreach ($templates as $template) { $parameters = astPhoneTemplateModel::astXMLFullParametersToArray($template); if (in_array($parameter, $parameters)) { array_push($templatesWithParameter, $template->TEMPLATE_NAME); } } return $templatesWithParameter; }