<commit_before><?php
namespace App\Model\Table;

use Cake\ORM\RulesChecker;
use Cake\Validation\Validator;

class AttributesTable
	extends AppTable
{

	protected $_contain = [ 'AttributesItems' => [ 'Items' ] ];

	public function initialize(array $config)
	{
		$this->table('attributes');
		$this->displayField('name');
		$this->primaryKey('id');
		$this->hasMany('AttributesItems', ['propertyName' => 'items']);
	}

	public function orderBy()
	{
		return	[ 'name' => 'ASC' ];
	}

	public function validationDefault(Validator $validator)
	{
		$validator->allowEmpty('id', 'create');
		$validator->allowEmpty('name');
		$validator->allowEmpty('category');
		$validator->notEmpty('code');

		$validator->add('id', 'valid', ['rule' => 'numeric']);
<commit_msg>attributes: stabilize sorting order<commit_after><?php
namespace App\Model\Table;

use Cake\ORM\RulesChecker;
use Cake\Validation\Validator;

class AttributesTable
	extends AppTable
{

	protected $_contain = [ 'AttributesItems' => [ 'Items' ] ];

	public function initialize(array $config)
	{
		$this->table('attributes');
		$this->displayField('name');
		$this->primaryKey('id');
		$this->hasMany('AttributesItems', ['propertyName' => 'items']);
	}

	public function orderBy()
	{
		return	[ 'name' => 'ASC', 'id' => 'ASC' ];
	}

	public function validationDefault(Validator $validator)
	{
		$validator->allowEmpty('id', 'create');
		$validator->allowEmpty('name');
		$validator->allowEmpty('category');
		$validator->notEmpty('code');

		$validator->add('id', 'valid', ['rule' => 'numeric']);

{'fraction_non_alphanumeric': 0.19342359767891681, 'fraction_numerical': 0.0, 'mean_word_length': 5.660944206008583, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 30, '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': '3728784', 'n_tokens_mistral': 518, 'n_tokens_neox': 497, 'n_words': 93}