Fluent::db_field_for_locale PHP Method

db_field_for_locale() public static method

Determine the DB field name to use for the given base field
public static db_field_for_locale ( string $field, string $locale )
$field string DB field name
$locale string Locale to use
    public static function db_field_for_locale($field, $locale)
    {
        return "{$field}_{$locale}";
    }

Usage Example

 public function augmentSQL(SQLQuery &$query, DataQuery &$dataQuery = null)
 {
     // When filtering my menu, swap out condition for locale specific condition
     $locale = Fluent::current_locale();
     $field = Fluent::db_field_for_locale("ShowInMenus", $locale);
     $query->replaceText("\"{$this->ownerBaseClass}\".\"ShowInMenus\"", "\"{$this->ownerBaseClass}\".\"{$field}\"");
 }
All Usage Examples Of Fluent::db_field_for_locale