Skip to content

Commit efae239

Browse files
committed
Fix #94 and also fix a bug for can't set QtyOnHand to 0
1 parent b12f1f2 commit efae239

File tree

6 files changed

+123
-116
lines changed

6 files changed

+123
-116
lines changed

Diff for: src/Core/CoreConstants.php

+3
Original file line numberDiff line numberDiff line change
@@ -402,4 +402,7 @@ public static function getRedirectURL(array $settings){
402402
public static function getCertPath(){
403403
return dirname(__FILE__) . "/OAuth/OAuth2/certs/cacert.pem"; //Pem certification Key Path
404404
}
405+
406+
//AutoLoader Settings
407+
const USE_AUTOLOADER = true;
405408
}

Diff for: src/Core/Http/Serialization/XmlObjectSerializer.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ public static function getPostXmlFromArbitraryEntity($entity, &$urlResource)
8383
private static function PhpObjFromXml($className, $xmlStr)
8484
{
8585
$className = trim($className);
86-
if (class_exists($className)) {
86+
if (class_exists($className, CoreConstants::USE_AUTOLOADER)) {
8787
$phpObj = new $className;
88-
} elseif (class_exists(CoreConstants::NAMEPSACE_DATA_PREFIX . $className)) {
88+
} elseif (class_exists(CoreConstants::NAMEPSACE_DATA_PREFIX . $className, CoreConstants::USE_AUTOLOADER)) {
8989
$className = CoreConstants::NAMEPSACE_DATA_PREFIX . $className;
9090
$phpObj = new $className;
9191
} else {

Diff for: src/Core/HttpClients/RestHandler.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
class RestHandler
2727
{
2828
/**
29-
* The contex
29+
* The Service context
3030
* @var ServiceContext
3131
*/
3232
protected $serviceContext;

Diff for: src/XSD2PHP/src/com/mikebevz/xsd2php/Bind.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function unmarshal($xml)
7373

7474
$className = $this->urnToPhpName($ns)."\\".$this->classPrefix.$name;
7575

76-
if (!class_exists($className)) {
76+
if (!class_exists($className, CoreConstants::USE_AUTOLOADER)) {
7777
throw new \RuntimeException('Class '.$className. ' is not found. Make sure it was included');
7878
}
7979

@@ -151,7 +151,7 @@ public function bindXml($xml, $model)
151151
*Vish Singh: Solution to Bug # IPP-4748
152152
*Add Check if the class Exists. @Hao
153153
*/
154-
if (class_exists($className)) {
154+
if (class_exists($className, CoreConstants::USE_AUTOLOADER)) {
155155
//Do nothing
156156
} elseif (class_exists(CoreConstants::NAMEPSACE_DATA_PREFIX . $className)) {
157157
$className = CoreConstants::NAMEPSACE_DATA_PREFIX . $className;

Diff for: src/XSD2PHP/src/com/mikebevz/xsd2php/Php2Xml.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
//namespace com\mikebevz\xsd2php;
33
namespace QuickBooksOnline\API\XSD2PHP\src\com\mikebevz\xsd2php;
44

5+
use QuickBooksOnline\API\Core\CoreConstants;
6+
57
/**
68
* Copyright 2010 Mike Bevz <[email protected]>
79
*
@@ -205,7 +207,7 @@ private function buildXml()
205207

206208
private function addProperty($docs, $dom)
207209
{
208-
if ($docs['value'] != '') {
210+
if (isset($docs['value'])) {
209211
$el = "";
210212

211213
if (array_key_exists('xmlNamespace', $docs)) {

0 commit comments

Comments
 (0)