function getParent($id) { $cats = new categories(); $cats->id = $id; $cats->find(true); return $cats->parent; }