Extends
lithium\core\Adaptable
Gets the names of the adapter configurations that respond to a specific priority. The list
of adapter configurations returned will be used to write a message with the given priority.
Parameters
- string $priority The priority level of a message to be written.
- string $message The message to write to the adapter.
- array $options Adapter-specific options.
Returns
array Returns an array of names of configurations which are set up to respond to the message priority specified in `$priority`, or configured to respond to _all_ message priorities.Source
protected static function _configsByPriority($priority, $message, array $options = array()) {
$configs = array();
$key = 'priority';
foreach (array_keys(static::$_configurations) as $name) {
$config = static::config($name);
$nameMatch = ($config[$key] === true || $config[$key] === $priority);
$arrayMatch = (is_array($config[$key]) && in_array($priority, $config[$key]));
if ($nameMatch || $arrayMatch) {
$method = static::adapter($name)->write($priority, $message, $options);
$method ? $configs[$name] = $method : null;
}
}
return $configs;
}