<commit_before><?php
/**
 * Created by PhpStorm.
 * User: BBN
 * Date: 29/11/2014
 * Time: 02:45
 */

namespace bbn\Appui;

use bbn;
use bbn\X;
use Exception;

class Tag extends bbn\Models\Cls\Db
{

  use bbn\Models\Tts\Dbconfig;
  use bbn\Models\Tts\Cache;

  /**
   * @var array Db configuration
   */
  protected static $default_class_cfg = [
    'errors' => [],
    'table' => 'bbn_tags',
    'tables' => [
      'tags' => 'bbn_tags'
    ],
    'arch' => [
      'tags' => [
        'id' => 'id',
        'tag' => 'tag',
        'lang' => 'lang',
        'description' => 'description'
      ],
      'relations' => [
        'id_tag_orig' => 'tag',
        'id_tag_dest' => 'lang',
        'relationship' => 'relationship'
      ]
    ]
  ];

  protected $all;

  protected $lang;

  public function __construct(bbn\Db $db, string $lang = null)
  {
    $this->lang = $lang ?: 'en';
    parent::__construct($db);
    $this->_init_class_cfg();
    $this->cacheInit();
  }


  public function getAll(bool $force = false)
  {
    if (!$this->all || $force) {
      $table = $this->class_cfg['table'];
      $cf = $this->class_cfg['arch']['tags'];
      $this->all = $this->db->rselectAll(
        $table,
        [
          'value' => $cf['id'],
          'text' => $cf['tag']
        ], [], [
          'tag' => 'ASC'
        ]
      );
    }

    return $this->all;
  }<commit_msg>Made the allTags array unidimensional<commit_after><?php
/**
 * Created by PhpStorm.
 * User: BBN
 * Date: 29/11/2014
 * Time: 02:45
 */

namespace bbn\Appui;

use bbn;
use bbn\X;
use Exception;

class Tag extends bbn\Models\Cls\Db
{

  use bbn\Models\Tts\Dbconfig;
  use bbn\Models\Tts\Cache;

  /**
   * @var array Db configuration
   */
  protected static $default_class_cfg = [
    'errors' => [],
    'table' => 'bbn_tags',
    'tables' => [
      'tags' => 'bbn_tags'
    ],
    'arch' => [
      'tags' => [
        'id' => 'id',
        'tag' => 'tag',
        'lang' => 'lang',
        'description' => 'description'
      ],
      'relations' => [
        'id_tag_orig' => 'tag',
        'id_tag_dest' => 'lang',
        'relationship' => 'relationship'
      ]
    ]
  ];

  protected $all;

  protected $lang;

  public function __construct(bbn\Db $db, string $lang = null)
  {
    $this->lang = $lang ?: 'en';
    parent::__construct($db);
    $this->_init_class_cfg();
    $this->cacheInit();
  }


  public function getAll(bool $force = false)
  {
    if (!$this->all || $force) {
      $table = $this->class_cfg['table'];
      $cf = $this->class_cfg['arch']['tags'];
      $this->all = $this->db->getColumnValues(
        $table,
        $cf['tag'],
        [],
        ['tag' => 'ASC']
      );
    }

    return $this->all;
  }
{'fraction_non_alphanumeric': 0.1969974368363237, 'fraction_numerical': 0.008787989747345295, 'mean_word_length': 2.1187214611872145, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 55, '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': '731266', 'n_tokens_mistral': 1033, 'n_tokens_neox': 1000, 'n_words': 193}