<commit_before><?php

namespace admin\models;

class TagRelation extends \yii\db\ActiveRecord
{
    public static function tableName()
    {
        return 'admin_tag_relation';
    }

    public function rules()
    {
        return [
            [['tag_id', 'table_name', 'pk_id'], 'safe'],
        ];
    }

    public static function getData($tableName, $pkId)
    {
        return self::find()->where(['table_name' => $tableName, 'pk_id' => $pkId])->asArray()->all();
    }<commit_msg>Adding a getData function for table names<commit_after><?php

namespace admin\models;

class TagRelation extends \yii\db\ActiveRecord
{
    public static function tableName()
    {
        return 'admin_tag_relation';
    }

    public function rules()
    {
        return [
            [['tag_id', 'table_name', 'pk_id'], 'safe'],
        ];
    }

    public static function getDataForRelation($tableName, $pkId)
    {
        return self::find()->where(['table_name' => $tableName, 'pk_id' => $pkId])->asArray()->all();
    }

    public static function getDataForTable($tableName)
    {
        return self::find()->where(['table_name' => $tableName])->asArray()->all();
    }
{'fraction_non_alphanumeric': 0.15798462852263023, 'fraction_numerical': 0.0, 'mean_word_length': 2.8426229508196723, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7132987', 'n_tokens_mistral': 364, 'n_tokens_neox': 358, 'n_words': 75}