<commit_before><?php

namespace Emergence\People;

use DB;
use HandleBehavior;

class User extends Person
{
    public static $minPasswordLength = 5;
    public static $usernameGenerator = 'flast';
    public static $onPasswordSet;

    public static $defaultClass = __CLASS__;
    public static $subClasses = array(__CLASS__);
    public static $singularNoun = 'user';
    public static $pluralNoun = 'users';

    // ActiveRecord configuration
    public static $fields = array(
        'Username' => array(
            'unique' => true
            ,'includeInSummary' => true
        )
        ,'Password' => array(
            'type' => 'string'
            ,'excludeFromData' => true
        )
        ,'AccountLevel' => array(
            'type' => 'enum'
            ,'values' => array('Disabled','Contact','User','Staff','Administrator','Developer')
            ,'default' => 'User'
        )
    );

    public static $searchConditions = array(
        'Username' => array(
            'qualifiers' => array('any','username','uname','user')
            ,'points' => 3
            ,'sql' => 'Username LIKE "%%%s%%"'
        )
        ,'AccountLevel' => array(
            'qualifiers' => array('accountlevel')
            ,'points' => 2
            ,'sql' => 'AccountLevel LIKE "%%%s%%"'
        )
    );

    public static $validators = array(
        'Username' => array(
            'validator' => 'handle'
            ,'required' => true
            ,'errorMessage' => 'Username can only contain letters, numbers, hyphens, and underscores.'
        )
        ,'AccountLevel' => array(
            'validator' => 'selection'
            ,'choices' => array() // filled dynamically in __classLoaded
            ,'required' => false
        )
    );

    public static function __classLoaded()
    {
        // merge User classes into valid Person classes, but not again when child classes are loaded
        if (get_called_class() == __CLASS__) {
            Person::$subClasses = static::$subClasses = array_merge(Person::$subClasses, static::$subClasses);
            self::$validators['AccountLevel']['choices'] = self::$fields['AccountLevel']['values'];
        }

        // finish ActiveRecord initialization
        parent::__classLoaded();
    }

    function getValue($name)
    {<commit_msg>Add empty dynamicFields to User class for config customization<commit_after><?php

namespace Emergence\People;

use DB;
use HandleBehavior;

class User extends Person
{
    public static $minPasswordLength = 5;
    public static $usernameGenerator = 'flast';
    public static $onPasswordSet;

    public static $defaultClass = __CLASS__;
    public static $subClasses = array(__CLASS__);
    public static $singularNoun = 'user';
    public static $pluralNoun = 'users';

    // ActiveRecord configuration
    public static $fields = array(
        'Username' => array(
            'unique' => true
            ,'includeInSummary' => true
        )
        ,'Password' => array(
            'type' => 'string'
            ,'excludeFromData' => true
        )
        ,'AccountLevel' => array(
            'type' => 'enum'
            ,'values' => array('Disabled','Contact','User','Staff','Administrator','Developer')
            ,'default' => 'User'
        )
    );

    public static $searchConditions = array(
        'Username' => array(
            'qualifiers' => array('any','username','uname','user')
            ,'points' => 3
            ,'sql' => 'Username LIKE "%%%s%%"'
        )
        ,'AccountLevel' => array(
            'qualifiers' => array('accountlevel')
            ,'points' => 2
            ,'sql' => 'AccountLevel LIKE "%%%s%%"'
        )
    );

    public static $validators = array(
        'Username' => array(
            'validator' => 'handle'
            ,'required' => true
            ,'errorMessage' => 'Username can only contain letters, numbers, hyphens, and underscores.'
        )
        ,'AccountLevel' => array(
            'validator' => 'selection'
            ,'choices' => array() // filled dynamically in __classLoaded
            ,'required' => false
        )
    );

    public static $dynamicFields = [];

    public static function __classLoaded()
    {
        // merge User classes into valid Person classes, but not again when child classes are loaded
        if (get_called_class() == __CLASS__) {
            Person::$subClasses = static::$subClasses = array_merge(Person::$subClasses, static::$subClasses);
            self::$validators['AccountLevel']['choices'] = self::$fields['AccountLevel']['values'];
        }

        // finish ActiveRecord initialization
        parent::__classLoaded();
    }

    function getValue($name)
    {
{'fraction_non_alphanumeric': 0.14158352791339418, 'fraction_numerical': 0.0012736149437486733, 'mean_word_length': 2.2654192654192653, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3731281', 'n_tokens_mistral': 1271, 'n_tokens_neox': 1213, 'n_words': 319}