/** * Similar in function to Model.all in Rails, it's just here for convenience. */ public static function all($fields = 'id', $conditions = null, $override_model_conditions = false) { include WCAPIDIR . "/_globals.php"; include WCAPIDIR . "/_model_static_attributes.php"; $sql = "\n SELECT\n categories.*,\n taxons.term_taxonomy_id,\n taxons.description,\n taxons.parent,\n taxons.count\n FROM\n wp_terms as categories,\n wp_term_taxonomy as taxons\n WHERE\n (taxons.taxonomy = 'product_cat') and\n (categories.term_id = taxons.term_id)\n "; $category = new Category(); $category->addQuery($sql); return $category; }