<commit_before><?php
namespace app\models;
class Layer extends \app\models\Table
{
    function __construct()
    {
        parent::__construct("settings.geometry_columns_view");
    }

    public function getValueFromKey($_key_, $column)
    {
        $rows = $this->getRecords();
        $rows = $rows['data'];
        foreach ($rows as $row) {
            foreach ($row as $field => $value) {
                if ($field == "_key_" && $value == $_key_) {
                    return ($row[$column]);
                }
            }
        }
    }

    function getAll($schema = false, $auth)
    {
        $where = ($auth) ?
            "(authentication<>'foo')" :
            "(authentication='Write' OR authentication='None')";
        $sql = ($schema) ?
            "SELECT * FROM settings.geometry_columns_view WHERE {$where} AND _key_ LIKE '{$schema}%' order by sort_id" :
            "SELECT * FROM settings.geometry_columns_view WHERE {$where} order by sort_id";
        $result = $this->execQuery($sql);
        if (!$this->PDOerror) {
            while ($row = $this->fetchRow($result, "assoc")) {
                $arr = array();
                $primeryKey = $this->getPrimeryKey("{$row['f_table_schema']}.{$row['f_table_name']}");
                foreach ($row as $key => $value) {
                    $value = ($key == "layergroup" && (!$value))? "Default group":$value;
                    $arr = $this->array_push_assoc($arr, $key, $value);
                    $arr = $this->array_push_assoc($arr, "pkey", $primeryKey['attname']);<commit_msg>Override GEOMETRY type<commit_after><?php
namespace app\models;
class Layer extends \app\models\Table
{
    function __construct()
    {
        parent::__construct("settings.geometry_columns_view");
    }

    public function getValueFromKey($_key_, $column)
    {
        $rows = $this->getRecords();
        $rows = $rows['data'];
        foreach ($rows as $row) {
            foreach ($row as $field => $value) {
                if ($field == "_key_" && $value == $_key_) {
                    return ($row[$column]);
                }
            }
        }
    }

    function getAll($schema = false, $auth)
    {
        $where = ($auth) ?
            "(authentication<>'foo')" :
            "(authentication='Write' OR authentication='None')";
        $sql = ($schema) ?
            "SELECT * FROM settings.geometry_columns_view WHERE {$where} AND _key_ LIKE '{$schema}%' order by sort_id" :
            "SELECT * FROM settings.geometry_columns_view WHERE {$where} order by sort_id";
        $result = $this->execQuery($sql);
        if (!$this->PDOerror) {
            while ($row = $this->fetchRow($result, "assoc")) {
                $arr = array();
                $primeryKey = $this->getPrimeryKey("{$row['f_table_schema']}.{$row['f_table_name']}");
                foreach ($row as $key => $value) {
                    if ($key == "type" && $value == "GEOMETRY") {
                        $def = json_decode($row['def']);
                        if (($def->geotype) && $def->geotype != "Default") {
                            $value = "MULTI" . $def->geotype;
                        }
                    }
                    $value = ($key == "layergroup" && (!$value))? "Default group":$value;
                    $arr = $this->array_push_assoc($arr, $key, $value);
                    $arr = $this->array_push_assoc($arr, "pkey", $primeryKey['attname']);
{'fraction_non_alphanumeric': 0.16914119359534208, 'fraction_numerical': 0.0, 'mean_word_length': 1.9242553191489362, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 26, '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': '192790', 'n_tokens_mistral': 1004, 'n_tokens_neox': 972, 'n_words': 209}