<?php
   
require APPPATH . 'libraries/REST_Controller.php';
     
class Productsubcategories extends REST_Controller {
    
	  /**
     * Get All Data from this method.
     *
     * @return Response
    */
    public function __construct() {
       parent::__construct();
       $this->load->model('common');
    }
       
    // User methods
	public function index_get($id = 0)
	{
        $data = $this->common->readdatacollection('ProductSubCategories');
        
        $this->response($data, REST_Controller::HTTP_OK);
	}
      
    
    public function create_post()
    {
        $input = $this->input->post();
        
        $this->common->addnewdatamodel('ProductSubCategories', $input);
     
        $this->response($input, REST_Controller::HTTP_OK);
    } 
     
    
    public function update_post($id)
    {
        $input = $this->input->post();
        $this->common->updatedatamodel('ProductSubCategories', $id, $input);
     
        $this->response($input, REST_Controller::HTTP_OK);
    }
     
    
    public function remove_delete($id)
    {
        $this->common->deletedatamodel('ProductSubCategories', $id);
       
        $this->response(['Product sub category deleted successfully.'], REST_Controller::HTTP_OK);
    }
    	
}