<?php
class Category extends AppModel {

	var $actsAs = array('Default', 'Tree');
	 
	var $hasOne = array(
		'Image' => 'Upload jpeg jpg png gif'
	);

	public $cache = false;


# ~ Before category find - - - - - - - - - - - - - - - - - - - - - - - - - - - #
	public function beforeFind($query = array()) {
		# Ensure that no deleted category is shown
		if(empty($query['conditions'][$this->alias . '.is_deleted']) && empty($query['all'])) {
			$query['conditions'][$this->alias . '.is_deleted'] = false;
		}
		return $query;
	}

}
