src/Api/Controller/Customer.php
public function getId($iId = null)
    {
        $oInput = Factory::service('Input');
        $iId    = (int) $iId ?: (int) $oInput->get('id');

        if (empty($iId)) {
            throw new ApiException('Invalid Customer ID', 404);
        }

        $oCustomerModel = Factory::model('Customer', 'nails/module-invoice');
        $oCustomer      = $oCustomerModel->getById($iId);

        if (empty($oCustomer)) {
            throw new ApiException('Invalid Customer ID', 404);
        }

        return Factory::factory('ApiResponse', 'nails/module-api')
                      ->setData($this->formatCustomer($oCustomer));
    }
public function getId($iId = null)
    {
        $oInput = Factory::service('Input');
        $iId    = (int) $iId ?: (int) $oInput->get('id');

        if (empty($iId)) {
            throw new ApiException('Invalid Customer ID', 404);
        }

        $oCustomerModel = Factory::model('Customer', 'nails/module-invoice');
        $oCustomer      = $oCustomerModel->getById($iId);

        if (empty($oCustomer)) {
            throw new ApiException('Invalid Customer ID', 404);
        }

        return Factory::factory('ApiResponse', 'nails/module-api')
                      ->setData($this->formatCustomer($oCustomer));
    }
public function getId ( $ iId = null ) { $ oInput = Factory :: service ( 'Input' ) ; $ iId = ( int ) $ iId ? : ( int ) $ oInput -> get ( 'id' ) ; if ( empty ( $ iId ) ) { throw new ApiException ( 'Invalid Customer ID' , 404 ) ; } $ oCustomerModel = Factory :: model ( 'Customer' , 'nails/module-invoice' ) ; $ oCustomer = $ oCustomerModel -> getById ( $ iId ) ; if ( empty ( $ oCustomer ) ) { throw new ApiException ( 'Invalid Customer ID' , 404 ) ; } return Factory :: factory ( 'ApiResponse' , 'nails/module-api' ) -> setData ( $ this -> formatCustomer ( $ oCustomer ) ) ; }
Returns a customer by their ID

@param  string $iId The customer's ID

@return array
Returns a customer by their ID