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

use Cake\ORM\Query;
use Cake\ORM\Table;
use Cake\Validation\Validator;

/**
 * Clubs Model
 */
class ClubsTable extends Table {

/**
 * Initialize method
 *
 * @param array $config The configuration for the Table.
 * @return void
 */
	public function initialize(array $config) {
		$this->table('clubs');
		$this->displayField('name');
		$this->primaryKey('id');
		$this->addBehavior('Timestamp');

		$this->belongsTo('Leagues', [
			'foreignKey' => 'league_id',
		]);
		$this->hasMany('Players', [
			'foreignKey' => 'club_id',
		]);
		$this->hasMany('Teams', [
			'foreignKey' => 'club_id',
		]);
	}

/**
 * Default validation rules.
 *
 * @param \Cake\Validation\Validator $validator
 * @return \Cake\Validation\Validator
 */
	public function validationDefault(Validator $validator) {
		$validator
			->add('id', 'valid', ['rule' => 'uuid'])
			->allowEmpty('id', 'create')

			->validatePresence('name', 'create')
			->notEmpty('name', 'Please name this club')

			->allowEmpty('alt_name')

			->allowEmpty('image')
			->add('image', ['rule' => ['extension', ['gif', 'jpeg', 'png', 'jpg']]])

			->allowEmpty('image_dir')

			->add('league_id', 'valid', ['rule' => 'uuid'])
			->validatePresence('league_id', 'create')
			->notEmpty('league_id');

		return $validator;
	}



}<commit_msg>Commented out a non-working validation rule<commit_after><?php
namespace App\Model\Table;

use Cake\ORM\Query;
use Cake\ORM\Table;
use Cake\Validation\Validator;

/**
 * Clubs Model
 */
class ClubsTable extends Table {

/**
 * Initialize method
 *
 * @param array $config The configuration for the Table.
 * @return void
 */
	public function initialize(array $config) {
		$this->table('clubs');
		$this->displayField('name');
		$this->primaryKey('id');
		$this->addBehavior('Timestamp');

		$this->belongsTo('Leagues', [
			'foreignKey' => 'league_id',
		]);
		$this->hasMany('Players', [
			'foreignKey' => 'club_id',
		]);
		$this->hasMany('Teams', [
			'foreignKey' => 'club_id',
		]);
	}

/**
 * Default validation rules.
 *
 * @param \Cake\Validation\Validator $validator
 * @return \Cake\Validation\Validator
 */
	public function validationDefault(Validator $validator) {
		$validator
			->add('id', 'valid', ['rule' => 'uuid'])
			->allowEmpty('id', 'create')

			->validatePresence('name', 'create')
			->notEmpty('name', 'Please name this club')

			->allowEmpty('alt_name')

			->allowEmpty('image')
//			->add('image', ['rule' => ['extension', ['gif', 'jpeg', 'png', 'jpg']]])

			->allowEmpty('image_dir')

			->add('league_id', 'valid', ['rule' => 'uuid'])
			->validatePresence('league_id', 'create')
			->notEmpty('league_id');

		return $validator;
	}



}
{'fraction_non_alphanumeric': 0.21054572271386432, 'fraction_numerical': 0.0, 'mean_word_length': 4.187380497131931, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 51, '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': '7196559', 'n_tokens_mistral': 1014, 'n_tokens_neox': 903, 'n_words': 183}