<commit_before><?php

namespace CL\Luna;

use CL\LunaCore\Save\AbstractSaveRepo;
use CL\LunaCore\Model\Models;
use CL\Luna\Rel\DbRelInterface;
use CL\Luna\Query;
use CL\Atlas\DB;

/*
 * @author     <NAME>
 * @copyright  (c) 2014 Clippings Ltd.
 * @license    http://www.opensource.org/licenses/isc-license.txt
 */
abstract class AbstractDbRepo extends AbstractSaveRepo
{
    private $table;
    private $db = 'default';
    private $fields = array();

    public function __construct($modelClass)
    {
        parent::__construct($modelClass);

        $properties = $this->getModelReflection()->getProperties();

        foreach ($properties as $property) {
            $this->fields []= $property->getName();
        }

        $this->table = $this->getModelReflection()->getShortName();
    }

    public function getTable()
    {
        $this->initializeOnce();

        return $this->table;
    }

    public function setTable($table)
    {
        $this->table = (string) $table;

        return $this;
    }

    public function getDb()<commit_msg>:lipstick: Only access public properties with getProperties<commit_after><?php

namespace CL\Luna;

use CL\LunaCore\Save\AbstractSaveRepo;
use CL\LunaCore\Model\Models;
use CL\Luna\Rel\DbRelInterface;
use CL\Luna\Query;
use CL\Atlas\DB;
use ReflectionProperty;

/*
 * @author     <NAME>
 * @copyright  (c) 2014 Clippings Ltd.
 * @license    http://www.opensource.org/licenses/isc-license.txt
 */
abstract class AbstractDbRepo extends AbstractSaveRepo
{
    private $table;
    private $db = 'default';
    private $fields = array();

    public function __construct($modelClass)
    {
        parent::__construct($modelClass);

        $properties = $this->getModelReflection()->getProperties(ReflectionProperty::IS_PUBLIC);

        foreach ($properties as $property) {
            $this->fields []= $property->getName();
        }

        $this->table = $this->getModelReflection()->getShortName();
    }

    public function getTable()
    {
        $this->initializeOnce();

        return $this->table;
    }

    public function setTable($table)
    {
        $this->table = (string) $table;

        return $this;
    }

    public function getDb()
{'fraction_non_alphanumeric': 0.1360144600090375, 'fraction_numerical': 0.0036150022593764122, 'mean_word_length': 2.89103690685413, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6400876', 'n_tokens_mistral': 678, 'n_tokens_neox': 655, 'n_words': 139}