<commit_before><?php

namespace Portal\Data\Styles;

use Respect\Data\Styles\Standard;

/**
 * PortalStyle is a Respect/Relational database style that helps the object mapper (Respect/Relational) to understand how the
 * database columns are named and how to infer primary/foreign keys and such.
 * This style is intended to work with the Portal database, as accessed by the routelandia-server project.
 *
 * NOTE:
 *   This style was copied from the NorthWind style that comes with Respect/Relational and modified to work.
 */
class PortalStyle extends Standard
{
    /*
    public function realName($name)
    {
        return $name;
    }

    public function styledName($name)
    {
        return $name;
    }
    */

    public function composed($left, $right)
    {
        $left = $this->pluralToSingular($left);
        return "{$left}{$right}";
    }

    public function identifier($name)
    {
        return $this->pluralToSingular($name) . 'id';
    }

    public function remoteIdentifier($name)
    {
        return $this->pluralToSingular($name) . 'id';
    }
    /*
    public function isRemoteIdentifier($name)
    {
        return (strlen($name) - 2 === strripos($name, 'id'));
    }

    public function remoteFromIdentifier($name)
    {
        if ($this->isRemoteIdentifier($name)) {
            return $this->singularToPlural(substr($name, 0, -2));
        }
    }
    */

}

<commit_msg>Uncomment needed methods in database style<commit_after><?php

namespace Portal\Data\Styles;

use Respect\Data\Styles\Standard;

/**
 * PortalStyle is a Respect/Relational database style that helps the object mapper (Respect/Relational) to understand how the
 * database columns are named and how to infer primary/foreign keys and such.
 * This style is intended to work with the Portal database, as accessed by the routelandia-server project.
 *
 * NOTE:
 *   This style was copied from the NorthWind style that comes with Respect/Relational and modified to work.
 */
class PortalStyle extends Standard
{
    public function realName($name)
    {
        return $name;
    }

    public function styledName($name)
    {
        return $name;
    }

    public function composed($left, $right)
    {
        $left = $this->pluralToSingular($left);
        return "{$left}{$right}";
    }

    public function identifier($name)
    {
        return $this->pluralToSingular($name) . 'id';
    }

    public function remoteIdentifier($name)
    {
        return $this->pluralToSingular($name) . 'id';
    }

    public function isRemoteIdentifier($name)
    {
        return (strlen($name) - 2 === strripos($name, 'id'));
    }

    public function remoteFromIdentifier($name)
    {
        if ($this->isRemoteIdentifier($name)) {
            return $this->singularToPlural(substr($name, 0, -2));
        }
    }
}


{'fraction_non_alphanumeric': 0.11185840707964602, 'fraction_numerical': 0.0021238938053097347, 'mean_word_length': 2.77807486631016, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '4843482', 'n_tokens_mistral': 817, 'n_tokens_neox': 802, 'n_words': 239}