<commit_before><?php
namespace DDPro\Admin\DataTable\Columns;

use DDPro\Admin\Config\ConfigInterface;
use DDPro\Admin\Validator;
use Illuminate\Database\DatabaseManager as DB;
use Log;

/**
 * Class Factory
 *
 * The DataTable manages the table view in the model index page.  Each column in the
 * DataTable is represented by a Column object.
 *
 * This class builds Column objects, which can either be one of the base Column class
 * or one of the Laravel relationship classes (e.g. Illuminate\Database\Eloquent\Relations\HasMany,
 * etc).
 *
 * ### Example
 *
 * <code>
 * $columns_array = $columnFactory->getColumns();
 * </code>
 *
 * @see Column
 * @see DDPro\Admin\DataTable\DataTable
 * @link https://github.com/ddpro/admin/blob/master/docs/columns.md
 */
class Factory
{

    /**
     * The validator instance
     *
     * @var \DDPro\Admin\Validator
     */
    protected $validator;

    /**
     * The config instance
     *
     * @var \DDPro\Admin\Config\ConfigInterface
     */
    protected $config;

    /**
     * The config instance
     *
     * @var \Illuminate\Database\DatabaseManager
     */
    protected $db;

    /**
     * The column objects
     *
     * @var array
     */
    protected $columns = [];

    /**
     * The export column objects
     *
     * @var array
     */
    protected $exportColumns = [];

    /**
     * The column options arrays
     *
     * @var array
     */
    protected $columnOptions = [];

    /**
     * The included column (used for pulling a certain range of selects from the DB)
     *
     * @var array
     */
    protected $includedColumns = [];

    /**
     * The relationship columns
     *
     * @var array
     */
    protected $relatedColumns = [];

    /**
     * The computed columns (either an accessor or a select was supplied)
     *
     * @var array
     */
    protected $computedColumns = [];

    /**
     * The class name of a BelongsTo relationship
     *
     * @var string
     */
    const BELONGS_TO = 'Illuminate\\Database\\Eloquent\\Relations\\BelongsTo';

    /**
     * The class name of a BelongsToMany relationship
     *
     * @var string
     */
    const BELONGS_TO_MANY = 'Illuminate\\Database\\Eloquent\\Relations\\BelongsToMany';

    /**
     * The class name of a HasMany relationship
     *
     * @var string
     */
    const HAS_MANY = 'Illuminate\\Database\\Eloquent\\Relations\\HasMany';

    /**
     * The class name of a HasOne relationship
     *
     * @var string
     */
    const HAS_ONE = 'Illuminate\\Database\\Eloquent\\Relations\\HasOne';

    /**
     * Create a new action Factory instance
     *
     * @param \DDPro\Admin\Validator 				$validator
     * @param \DDPro\Admin\Config\ConfigInterface	$config
     * @param \Illuminate\Database\DatabaseManager 				$db
     */
    public function __construct(Validator $validator, ConfigInterface $config, DB $db)
    {
        Log::debug(__CLASS__ . ':' . __TRAIT__ . ':' . __FILE__ . ':' . __LINE__ . ':' . __FUNCTION__ . ':' .
            'ColumnFactory constructor, config = ' . print_r($config, true));

        // set the config, and then validate it<commit_msg>Debugging slow issue on drawing columns<commit_after><?php
namespace DDPro\Admin\DataTable\Columns;

use DDPro\Admin\Config\ConfigInterface;
use DDPro\Admin\Validator;
use Illuminate\Database\DatabaseManager as DB;
use Log;

/**
 * Class Factory
 *
 * The DataTable manages the table view in the model index page.  Each column in the
 * DataTable is represented by a Column object.
 *
 * This class builds Column objects, which can either be one of the base Column class
 * or one of the Laravel relationship classes (e.g. Illuminate\Database\Eloquent\Relations\HasMany,
 * etc).
 *
 * ### Example
 *
 * <code>
 * $columns_array = $columnFactory->getColumns();
 * </code>
 *
 * @see Column
 * @see DDPro\Admin\DataTable\DataTable
 * @link https://github.com/ddpro/admin/blob/master/docs/columns.md
 */
class Factory
{

    /**
     * The validator instance
     *
     * @var \DDPro\Admin\Validator
     */
    protected $validator;

    /**
     * The config instance
     *
     * @var \DDPro\Admin\Config\ConfigInterface
     */
    protected $config;

    /**
     * The config instance
     *
     * @var \Illuminate\Database\DatabaseManager
     */
    protected $db;

    /**
     * The column objects
     *
     * @var array
     */
    protected $columns = [];

    /**
     * The export column objects
     *
     * @var array
     */
    protected $exportColumns = [];

    /**
     * The column options arrays
     *
     * @var array
     */
    protected $columnOptions = [];

    /**
     * The included column (used for pulling a certain range of selects from the DB)
     *
     * @var array
     */
    protected $includedColumns = [];

    /**
     * The relationship columns
     *
     * @var array
     */
    protected $relatedColumns = [];

    /**
     * The computed columns (either an accessor or a select was supplied)
     *
     * @var array
     */
    protected $computedColumns = [];

    /**
     * The class name of a BelongsTo relationship
     *
     * @var string
     */
    const BELONGS_TO = 'Illuminate\\Database\\Eloquent\\Relations\\BelongsTo';

    /**
     * The class name of a BelongsToMany relationship
     *
     * @var string
     */
    const BELONGS_TO_MANY = 'Illuminate\\Database\\Eloquent\\Relations\\BelongsToMany';

    /**
     * The class name of a HasMany relationship
     *
     * @var string
     */
    const HAS_MANY = 'Illuminate\\Database\\Eloquent\\Relations\\HasMany';

    /**
     * The class name of a HasOne relationship
     *
     * @var string
     */
    const HAS_ONE = 'Illuminate\\Database\\Eloquent\\Relations\\HasOne';

    /**
     * Create a new action Factory instance
     *
     * @param \DDPro\Admin\Validator 				$validator
     * @param \DDPro\Admin\Config\ConfigInterface	$config
     * @param \Illuminate\Database\DatabaseManager 				$db
     */
    public function __construct(Validator $validator, ConfigInterface $config, DB $db)
    {
        Log::debug(__CLASS__ . ':' . __TRAIT__ . ':' . __FILE__ . ':' . __LINE__ . ':' . __FUNCTION__ . ':' .
            'ColumnFactory constructor, config title = ' . $config->getOption('title'));

        // set the config, and then validate it
{'fraction_non_alphanumeric': 0.12094861660079051, 'fraction_numerical': 0.0, 'mean_word_length': 2.199797673242286, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 10, 'https://': 2, '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': '4102775', 'n_tokens_mistral': 1896, 'n_tokens_neox': 1865, 'n_words': 498}