/** * Return price of product * @return integer price of product */ public function get_price($id) { // Creating instance of model and fetching data $products = new Product_Model(); $data = $products->get_one($id); if (!isset($data['price'])) { return NULL; } else { return $data['price']; } }