<commit_before><?php
namespace Phwoolcon\Model;

use Phwoolcon\Model;

/**
 * Class User
 * @package Phwoolcon\Model
 *
 * @method UserProfile|false getUserProfile()
 * @method $this setUserProfile(UserProfile $profile)
 */
class User extends Model
{
    protected $_table = 'users';

    protected function assignUserProfile()
    {
        return $this->setUserProfile(new UserProfile);
    }

    public function getRememberToken()
    {
        return ($profile = $this->getUserProfile()) ? $profile->getData('remember_token') : null;
    }

    public function initialize()
    {
        $this->hasOne('id', UserProfile::class, 'user_id', ['alias' => 'user_profile']);
        parent::initialize();<commit_msg>feat: flexible users profile model<commit_after><?php
namespace Phwoolcon\Model;

use Phalcon\Di;
use Phwoolcon\Model;

/**
 * Class User
 * @package Phwoolcon\Model
 *
 * @property Di $_dependencyInjector
 * @property Di $_dependencyInjector
 * @method UserProfile|false getUserProfile()
 * @method $this setUserProfile(UserProfile $profile)
 */
class User extends Model
{
    protected $_table = 'users';

    protected function assignUserProfile()
    {
        return $this->setUserProfile($this->_dependencyInjector->get(UserProfile::class));
    }

    public function getRememberToken()
    {
        return ($profile = $this->getUserProfile()) ? $profile->getData('remember_token') : null;
    }

    public function initialize()
    {
        $class = UserProfile::class;
        $this->_dependencyInjector->has($class) and $class = $this->_dependencyInjector->getRaw($class);
        $this->hasOne('id', $class, 'user_id', ['alias' => 'user_profile']);
        parent::initialize();
{'fraction_non_alphanumeric': 0.1411833626244874, 'fraction_numerical': 0.0, 'mean_word_length': 3.8939828080229226, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '2312890', 'n_tokens_mistral': 501, 'n_tokens_neox': 494, 'n_words': 108}