/** * A convenience method for returning a hierarchical array used for HTML select boxes * * For the scoped behavior you always have to pass the scope conditions with the conditions. * * @param AppModel $Model Model instance * @param mixed $conditions SQL conditions as a string or as an array('field' =>'value',...) * @param string $keyPath A string path to the key, i.e. "{n}.Post.id" * @param string $valuePath A string path to the value, i.e. "{n}.Post.title" * @param string $spacer The character or characters which will be repeated * @param integer $recursive The number of levels deep to fetch associated records * @return array An associative array of records, where the id is the key, and the display field is the value * @access public * @link http://book.cakephp.org/view/1348/generateTreeList */ public function generateTreeList($Model, $conditions = null, $keyPath = null, $valuePath = null, $spacer = '_', $recursive = null) { if ($this->scoped($Model)) { $this->__setScope($Model, $conditions); } return parent::generateTreeList($Model, $conditions, $keyPath, $valuePath, $spacer, $recursive); }