/** * Get the path to the given node * * If the model is scoped and the id parameter is given it will automatically set the scope. For no id parameter * you will have to pass the scope. * * Example: array('scope' => 5) or array('id' => false, 'scope' => 5) * * @param AppModel $Model Model instance * @param mixed $id The ID of the record to read * @param mixed $fields Either a single string of a field name, or an array of field names * @param integer $recursive The number of levels deep to fetch associated records * @return array Array of nodes from top most parent to current node * @access public * @link http://book.cakephp.org/view/1350/getpath */ public function getpath($Model, $id = null, $fields = null, $recursive = null) { if ($this->scoped($Model)) { $id = $this->__setScopeFromId($Model, $id); if (empty($id)) { return false; } } return parent::getpath($Model, $id, $fields, $recursive); }