mirror of
https://github.com/sctn4elk/CustomerRewardsRESTAPI.git
synced 2025-01-09 15:24:30 -06:00
Fix broken methods
This commit is contained in:
parent
5e1bbf8817
commit
838bf4d5dd
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
header("Content-Type: application/json");
|
||||
|
||||
//require_once PROJECT_ROOT_PATH . "/Model/CustomerModel.php";
|
||||
/**
|
||||
* Description of CustomerController
|
||||
*
|
||||
|
@ -23,10 +23,10 @@ class CustomerController extends BaseController {
|
|||
public function processAction() {
|
||||
$this->strErrorDesc = '';
|
||||
$this->strErrorHeader = '';
|
||||
try {
|
||||
$this->customerModel = new CustomerModel();
|
||||
$this->requestMethod = $this->getServerRequestMethod();
|
||||
|
||||
try {
|
||||
$this->requestMethod = $this->getServerRequestMethod();
|
||||
//return var_dump($this->requestMethod);
|
||||
switch($this->action) {
|
||||
case "select":
|
||||
$response = $this->selectAction();
|
||||
|
@ -77,14 +77,18 @@ class CustomerController extends BaseController {
|
|||
return;
|
||||
}
|
||||
|
||||
require_once PROJECT_ROOT_PATH . "/Model/CustomerModel.php";
|
||||
$this->customerModel = new CustomerModel();
|
||||
//return var_dump($this->customerModel);
|
||||
$this->arrQueryStringParams = $this->getQueryStringParams();
|
||||
|
||||
if (isset($this->arrQueryStringParams['customer_id'])) {
|
||||
$response = $this->selectByIdAction();
|
||||
} else {
|
||||
$this->customerModel->limit = 10;
|
||||
//$this->customerModel->limit = 10;
|
||||
|
||||
if (isset($this->arrQueryStringParams['limit'])) {
|
||||
$customerModel->limit = $this->arrQueryStringParams['limit'];
|
||||
$this->customerModel->limit = $this->arrQueryStringParams['limit'];
|
||||
}
|
||||
$response = $this->customerModel->findAllCustomers();
|
||||
unset($this->customerModel->limit);
|
||||
|
|
|
@ -11,7 +11,7 @@ require_once PROJECT_ROOT_PATH . "/include/config.php";
|
|||
// include the base controller file
|
||||
require_once PROJECT_ROOT_PATH . "/Controller/Api/BaseController.php";
|
||||
// include the use model file
|
||||
require_once PROJECT_ROOT_PATH . "/Model/CustomerModel.php";
|
||||
require_once PROJECT_ROOT_PATH . "/Model/ImageModel.php";
|
||||
//require_once PROJECT_ROOT_PATH . "/Model/CustomerModel.php";
|
||||
//require_once PROJECT_ROOT_PATH . "/Model/ImageModel.php";
|
||||
// include the tests autoloader when in development
|
||||
//require_once __DIR__ . '/../vendor/autoload.php';
|
||||
|
|
|
@ -1,10 +1,4 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Scripting/PHPClass.php to edit this template
|
||||
*/
|
||||
|
||||
/**
|
||||
* Description of CustomerModel
|
||||
*
|
||||
|
@ -28,13 +22,13 @@
|
|||
* address_zip varchar(10)
|
||||
*/
|
||||
|
||||
//define('PD', 'D:\DEV\Git Repository\CustomerRewardsRESTAPI');
|
||||
define('PD', 'D:\DEV\Git Repository\CustomerRewardsRESTAPI');
|
||||
//require_once PROJECT_ROOT_PATH . "/Model/Database.php";
|
||||
require_once PD . "/Model/Database.php";
|
||||
require_once PD . "/Model/ModelTraits.php";
|
||||
//require_once PD . "/Model/ModelTraits.php";
|
||||
|
||||
class CustomerModel extends Database {
|
||||
use ModelTraits;
|
||||
//use ModelTraits;
|
||||
|
||||
public function findAllCustomers()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user