_t('options', 'consistent'), self::TYPE_BINARY => _t('options', 'binary'), ]; return $names[$typeID] ?? ''; } /** * Get group id by keyword * @param string $keyword * @return int id or 0 */ public static function keywordToID(string $keyword): int { return (int)static::where('keyword', '=', $keyword)->value('id'); } /** * Group options * @return HasMany */ public function options(): HasMany { return $this->hasMany('bff\db\options\models\Option', 'group_id'); } }