<commit_before><?php

class Crunchbutton_Category extends Cana_Table {
	public function restaurant() {
		return Restaurant::o($this->id_restaurant);
	}
	
	public function dishes() {
		if (!isset($this->_dishes)) {
			$this->_dishes = Dish::q('select * from dish where id_category="'.$this->id_category.'"');
		}
		return $this->_dishes;
	}
	
	public function exports() {
		$out = $this->properties();
		foreach ($this->dishes() as $dish) {
			$out['_dishes'][$dish->id_dish] = $dish->exports();
		}
		return $out;
	}

	public function __construct($id = null) {
		parent::__construct();
		$this
			->table('category')<commit_msg>hide inactive dishes<commit_after><?php

class Crunchbutton_Category extends Cana_Table {
	public function restaurant() {
		return Restaurant::o($this->id_restaurant);
	}
	
	public function dishes() {
		if (!isset($this->_dishes)) {
			$this->_dishes = Dish::q('select * from dish where id_category="'.$this->id_category.'" and dish.active=1');
		}
		return $this->_dishes;
	}
	
	public function exports() {
		$out = $this->properties();
		foreach ($this->dishes() as $dish) {
			$out['_dishes'][$dish->id_dish] = $dish->exports();
		}
		return $out;
	}

	public function __construct($id = null) {
		parent::__construct();
		$this
			->table('category')
{'fraction_non_alphanumeric': 0.18266978922716628, 'fraction_numerical': 0.00078064012490242, 'mean_word_length': 4.525862068965517, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, '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': '2354163', 'n_tokens_mistral': 476, 'n_tokens_neox': 432, 'n_words': 89}