Skip to content

Commit

Permalink
Merge pull request #9 from zoho/beta
Browse files Browse the repository at this point in the history
5.0.0
  • Loading branch information
raja-7453 authored Mar 30, 2022
2 parents 5c40d62 + 1edb90b commit 0f9c37c
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 6 deletions.
76 changes: 76 additions & 0 deletions src/com/zoho/crm/api/dc/JPDataCenter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?php
namespace com\zoho\crm\api\dc;

use com\zoho\crm\api\dc\DataCenter;

/**
* This class represents the properties of Zoho CRM in Japan Domain.
*/
class JPDataCenter extends DataCenter
{
private static $PRODUCTION = null;

private static $SANDBOX = null;

private static $DEVELOPER = null;

private static $JP = null;

/**
* This Environment class instance represents the Zoho CRM Production Environment in Japan Domain.
* @return Environment A Environment class instance.
*/
public static function PRODUCTION()
{
self::$JP = new JPDataCenter();

if (self::$PRODUCTION == null)
{
self::$PRODUCTION = DataCenter::setEnvironment("https://www.zohoapis.jp", self::$JP->getIAMUrl(), self::$JP->getFileUploadUrl(), "jp_prd");
}

return self::$PRODUCTION;
}

/**
* This Environment class instance represents the Zoho CRM Sandbox Environment in Japan Domain.
* @return Environment A Environment class instance.
*/
public static function SANDBOX()
{
self::$JP = new JPDataCenter();

if (self::$SANDBOX == null)
{
self::$SANDBOX = DataCenter::setEnvironment("https://sandbox.zohoapis.jp", self::$JP->getIAMUrl(), self::$JP->getFileUploadUrl(), "jp_sdb");
}

return self::$SANDBOX;
}

/**
* This Environment class instance represents the Zoho CRM Developer Environment in Japan Domain.
* @return Environment A Environment class instance.
*/
public static function DEVELOPER()
{
self::$JP = new JPDataCenter();

if (self::$DEVELOPER == null)
{
self::$DEVELOPER = DataCenter::setEnvironment("https://developer.zohoapis.jp", self::$JP->getIAMUrl(), self::$JP->getFileUploadUrl(), "jp_dev");
}

return self::$DEVELOPER;
}

public function getIAMUrl()
{
return "https://accounts.zoho.jp/oauth/v2/token";
}

public function getFileUploadUrl()
{
return "https://content.zohoapis.jp";
}
}
8 changes: 5 additions & 3 deletions src/com/zoho/crm/api/util/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ class Constants

const REQUIRED = "required";

const REQUIRED_IN_UPDATE = "required_in_update";
const REQUIRED_IN_UPDATE = "required-in-update";

const MANDATORY_KEY_ERROR = "Value missing or null for mandatory key(s) ";

Expand Down Expand Up @@ -440,7 +440,7 @@ class Constants

const CONSENT_LOOKUP = "consent_lookup";

const SKIP_MANDATORY = "skip_mandatory";
const SKIP_MANDATORY = "skip-mandatory";

const SE_MODULE = "se_module";

Expand All @@ -466,7 +466,7 @@ class Constants

const FORM_REQUEST_EXCEPTION = "Exception in forming request body : ";

const SDK_VERSION = "4.0.0";
const SDK_VERSION = "5.0.0";

const API_CALL_EXCEPTION = "Exception in current API call execution : ";

Expand Down Expand Up @@ -685,5 +685,7 @@ class Constants
const SKIP_MODULES = array("deals");

const PHP = "php_";

const OWNER_LOOKUP = "ownerlookup";
}
?>
2 changes: 1 addition & 1 deletion src/com/zoho/crm/api/util/JSONConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ public function findRatio($className, $responseJson)
$keyName = $memberDetail[Constants::NAME];
}

if ($keyName != null && array_key_exists($keyName, $responseJson) && (is_array($responseJson[$keyName]) || $responseJson[$keyName] != null))
if ($keyName != null && array_key_exists($keyName, $responseJson) && (is_array($responseJson[$keyName]) || $responseJson[$keyName] !== null))
{
$keyData = $responseJson[$keyName];

Expand Down
2 changes: 1 addition & 1 deletion src/com/zoho/crm/api/util/Utility.php
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ public static function setDataType($fieldDetail, $field, $moduleAPIName)
$fieldDetail[Constants::LOOKUP] = true;
}

if(strtolower($apiType) == Constants::CONSENT_LOOKUP)
if(strtolower($apiType) == Constants::CONSENT_LOOKUP || strtolower($apiType) == Constants::OWNER_LOOKUP)
{
$fieldDetail[Constants::SKIP_MANDATORY] = true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/resources/JSONDetails.json

Large diffs are not rendered by default.

0 comments on commit 0f9c37c

Please sign in to comment.