Back to ToolbarButton class

Method findOptionName

private static bool|string
findOptionName
(string $name)
Find field option name from accessors.
Parameters
  • string $name The field name.
Returns
  • bool|string
Since
  • 4.0.0
Class: ToolbarButton
Project: Joomla

Method findOptionName - Source code

/**
 * Find field option name from accessors.
 *
 * @param   string  $name  The field name.
 *
 * @return  boolean|string
 *
 * @since  4.0.0
 */
private static function findOptionName(string $name)
{
    $accessors = static::getAccessors();
    if (\in_array($name, $accessors, true)) {
        return $accessors[array_search($name, $accessors, true)];
    }
    // Getter with alias
    if (isset($accessors[$name])) {
        return $accessors[$name];
    }
    return false;
}
OSZAR »