_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 83 13k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q255700 | Xsd2Php.loadIncludes | test | public function loadIncludes($dom, $filepath = '', $namespace = '')
{
$xpath = new \DOMXPath($dom);
$query = "//*[local-name()='include' and namespace-uri()='http://www.w3.org/2001/XMLSchema']";
$includes = $xpath->query($query);
foreach ($includes as $entry) {
$parent =... | php | {
"resource": ""
} |
q255701 | Xsd2Php.getXML | test | public function getXML()
{
try {
$xsl = new \XSLTProcessor();
$xslDom = new \DOMDocument();
$xslDom->load(dirname(__FILE__) . "/xsd2php2.xsl");
$xsl->registerPHPFunctions();
$xsl->importStyleSheet($xslDom);
$dom = $xsl->transformToDo... | php | {
"resource": ""
} |
q255702 | Xsd2Php.savePhpFiles | test | private function savePhpFiles($dir, $createDirectory = false)
{
if (!file_exists($dir) && $createDirectory === false) {
throw new \RuntimeException($dir." does not exist");
}
if (!file_exists($dir) && $createDirectory === true) {
//@todo Implement Recursive mkdir
... | php | {
"resource": ""
} |
q255703 | Xsd2Php.namespaceToPhp | test | public function namespaceToPhp($xmlNS)
{
$ns = $xmlNS;
$ns = $this->expandNS($ns);
if (preg_match('/urn:/', $ns)) {
//@todo check if there are any components of namespace which are
$ns = preg_replace('/-/', '_', $ns);
$ns = preg_replace('/urn:/', '', $ns);... | php | {
"resource": ""
} |
q255704 | OAuth2AccessToken.setBaseURL | test | public function setBaseURL($baseURL){
if(strcasecmp($baseURL, CoreConstants::DEVELOPMENT_SANDBOX) == 0){
$this->baseURL = CoreConstants::SANDBOX_DEVELOPMENT;
}else if(strcasecmp($baseURL, CoreConstants::PRODUCTION_QBO) == 0){
$this->baseURL = CoreConstants::QBO_BASEURL;
}else{
... | php | {
"resource": ""
} |
q255705 | OAuth2AccessToken.getRefreshTokenValidationPeriodInSeconds | test | public function getRefreshTokenValidationPeriodInSeconds(){
if(isset($this->refreshTokenValidationPeriod) && !empty($this->refreshTokenValidationPeriod))
{
return $this->refreshTokenValidationPeriod;
}else{
throw new SdkException("The validation period for OAuth 2 refresh Token is no... | php | {
"resource": ""
} |
q255706 | OAuth2AccessToken.getAccessTokenValidationPeriodInSeconds | test | public function getAccessTokenValidationPeriodInSeconds(){
if(isset($this->accessTokenValidationPeriod) && !empty($this->accessTokenValidationPeriod))
{
return $this->accessTokenValidationPeriod;
}else{
throw new SdkException("The validation period for OAuth 2 access Token is not set... | php | {
"resource": ""
} |
q255707 | OAuth2AccessToken.getRefreshToken | test | public function getRefreshToken(){
if(isset($this->refresh_token) && !empty($this->refresh_token)) return $this->refresh_token;
else throw new SdkException("The OAuth 2 Refresh Token is not set in the Access Token Object.");
} | php | {
"resource": ""
} |
q255708 | OAuth2AccessToken.getAccessToken | test | public function getAccessToken(){
if(isset($this->accessTokenKey) && !empty($this->accessTokenKey)) return $this->accessTokenKey;
else throw new SdkException("The OAuth 2 Access Token is not set in the Access Token Object.");
} | php | {
"resource": ""
} |
q255709 | OAuth2AccessToken.updateAccessToken | test | public function updateAccessToken($tokenExpiresTime, $refreshToken, $refreshTokenExpiresTime, $accessToken){
$this->setAccessToken($accessToken);
$this->setRefreshToken($refreshToken);
$this->setAccessTokenValidationPeriodInSeconds($tokenExpiresTime);
$this->setRefreshTokenValidationPeriodIn... | php | {
"resource": ""
} |
q255710 | XmlObjectSerializer.getPostXmlFromArbitraryEntity | test | public static function getPostXmlFromArbitraryEntity($entity, &$urlResource)
{
if (null==$entity) {
return false;
}
$xmlElementName = XmlObjectSerializer::cleanPhpClassNameToIntuitEntityName(get_class($entity));
$xmlElementName = trim($xmlElementName);
$urlResour... | php | {
"resource": ""
} |
q255711 | XmlObjectSerializer.PhpObjFromXml | test | private static function PhpObjFromXml($className, $xmlStr)
{
$className = trim($className);
if (class_exists($className, CoreConstants::USE_AUTOLOADER)) {
$phpObj = new $className;
} elseif (class_exists(CoreConstants::NAMEPSACE_DATA_PREFIX . $className, CoreConstants::USE_AUTOLO... | php | {
"resource": ""
} |
q255712 | XmlObjectSerializer.ParseArbitraryResultObjects | test | private static function ParseArbitraryResultObjects($responseXml, $bLimitToOne)
{
if (!$responseXml) {
return null;
}
$resultObject = null;
$resultObjects = null;
$responseXmlObj = simplexml_load_string($responseXml);
foreach ($responseXmlObj as $oneXmlO... | php | {
"resource": ""
} |
q255713 | BaseCurl.setupOption | test | public function setupOption($k, $v){
if($this->isCurlSet()){
curl_setopt($this->curl, $k, $v);
} else {
throw new SdkException("cURL instance is not set when calling setup Option.");
}
} | php | {
"resource": ""
} |
q255714 | BaseCurl.versionOfTLS | test | public function versionOfTLS(){
$tlsVersion = "";
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "https://www.howsmyssl.com/a/check");
curl_setopt($curl, CURLOPT_SSLVERSION, 6);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$curlVersionResponse = curl_exec($curl);
if(... | php | {
"resource": ""
} |
q255715 | IdsExceptionManager.HandleException | test | public static function HandleException($errorMessage=null, $errorCode=null, $source=null, $innerException=null)
{
$message = implode(", ", array($errorMessage, $errorCode, $source));
throw new IdsException($message);
} | php | {
"resource": ""
} |
q255716 | MetadataExtractor.verifyVariableType | test | private function verifyVariableType($value)
{
// if value can be mapped to simple type
if (in_array(strtolower($value), array("string","float","double","boolean", "integer"))) {
return new SimpleEntity(strtolower($value));
}
// generate names
// try it
foreach ... | php | {
"resource": ""
} |
q255717 | MetadataExtractor.generateObjectNames | test | private function generateObjectNames($value)
{
$reversiveStack = array();
$reversiveStack[] = $value; // add original value. It will be called last
$reversiveStack[] = $this->removeArrayBrackets($value); //
$reversiveStack[] = $this->getIntuitName($this->removeArrayBrackets($value));... | php | {
"resource": ""
} |
q255718 | MetadataExtractor.completeProperty | test | private function completeProperty($a, ReflectionProperty $p)
{
if (!$a instanceof AbstractEntity) {
throw new InvalidArgumentException("Expected instance of AbstractEntity here");
}
$a->setName($p->getName());
$a->setClass($p->getDeclaringClass());
} | php | {
"resource": ""
} |
q255719 | Bind.unmarshal | test | public function unmarshal($xml)
{
// Get all namespaces
$this->dom = new \DOMDocument();
if ($this->debug) {
$this->dom->formatOutput = true;
}
$this->dom->loadXML($xml);
$this->namespaces = $this->getDocNamespaces($this->dom);
// Find targetNam... | php | {
"resource": ""
} |
q255720 | CoreHelper.GetSerializer | test | public static function GetSerializer($serviceContext, $isRequest)
{
$serviceContext->IppConfiguration->Logger->RequestLog->Log(TraceLevel::Info, "GetSerializer");
$serializer = null;
if ($isRequest) {
switch ($serviceContext->IppConfiguration->Message->Request->SerializationForm... | php | {
"resource": ""
} |
q255721 | CoreHelper.GetCompressor | test | public static function GetCompressor($serviceContext, $isRequest)
{
$compressor = null;
if ($isRequest) {
switch ($serviceContext->IppConfiguration->Message->Request->CompressionFormat) {
case CompressionFormat::GZip:
$compressor = new GZipCompressor()... | php | {
"resource": ""
} |
q255722 | CoreHelper.GetRequestLogging | test | public static function GetRequestLogging($serviceContext)
{
$requestLogger = null;
try {
if (isset($serviceContext->IppConfiguration) &&
isset($serviceContext->IppConfiguration->Logger) &&
isset($serviceContext->IppConfiguration->Logger->RequestLog) &&
... | php | {
"resource": ""
} |
q255723 | Zend_Soap_Wsdl_Strategy_Composite.connectTypeToStrategy | test | public function connectTypeToStrategy($type, $strategy)
{
if (!is_string($type)) {
/**
* @see Zend_Soap_Wsdl_Exception
*/
require_once "Zend/Soap/Wsdl/Exception.php";
throw new Zend_Soap_Wsdl_Exception("Invalid type given to Composite Type Map.")... | php | {
"resource": ""
} |
q255724 | Zend_Soap_Wsdl_Strategy_Composite.getDefaultStrategy | test | public function getDefaultStrategy()
{
$strategy = $this->_defaultStrategy;
if (is_string($strategy) && class_exists($strategy)) {
$strategy = new $strategy;
}
if (!($strategy instanceof Zend_Soap_Wsdl_Strategy_Interface)) {
/**
* @see Zend_Soap_W... | php | {
"resource": ""
} |
q255725 | Zend_Soap_Wsdl_Strategy_Composite.getStrategyOfType | test | public function getStrategyOfType($type)
{
if (isset($this->_typeMap[$type])) {
$strategy = $this->_typeMap[$type];
if (is_string($strategy) && class_exists($strategy)) {
$strategy = new $strategy();
}
if (!($strategy instanceof Zend_Soap_Wsd... | php | {
"resource": ""
} |
q255726 | Zend_Soap_Wsdl_Strategy_Composite.addComplexType | test | public function addComplexType($type)
{
if (!($this->_context instanceof Zend_Soap_Wsdl)) {
/**
* @see Zend_Soap_Wsdl_Exception
*/
require_once "Zend/Soap/Wsdl/Exception.php";
throw new Zend_Soap_Wsdl_Exception(
"Cannot add comple... | php | {
"resource": ""
} |
q255727 | DomainEntityBuilder.makeReflection | test | private function makeReflection()
{
if (!class_exists($this->getOriginalClassName())) {
throw new InvalidArgumentException('Class name ' . $this->getOriginalClassName() . ' not exists');
}
$this->reflection = new ReflectionClass($this->getOriginalClassName());
} | php | {
"resource": ""
} |
q255728 | DomainEntityBuilder.populatePropertyComments | test | private function populatePropertyComments()
{
if (is_null($this->properties)) {
throw new UnexpectedValueException('Properties are expected here');
}
if (!is_array($this->properties)) {
throw new UnexpectedValueException('Properties should be provided as array');
... | php | {
"resource": ""
} |
q255729 | DomainEntityBuilder.forgeInstance | test | private function forgeInstance($instance)
{
$reflection = new ReflectionClass($instance);
foreach ($reflection->getProperties() as $key => $property) {
if (!$property instanceof ReflectionProperty) {
continue;
}
$entity = $this->getEntityFromModel(... | php | {
"resource": ""
} |
q255730 | DomainEntityBuilder.processPropertyValues | test | private function processPropertyValues($instance, $property, $model, $values)
{
$changed = false;
foreach ($values as &$value) {
if (!$this->isMorhing($model, $value)) {
continue;
}
$newType = $model->getType();
//$value = new $newType... | php | {
"resource": ""
} |
q255731 | DomainEntityBuilder.create | test | public static function create($type, $values)
{
$i = new static($type);
$i->usePropertyValues($values);
return $i->createInstance();
} | php | {
"resource": ""
} |
q255732 | DomainEntityBuilder.isMorhing | test | private function isMorhing($entity, $value)
{
if (!$entity instanceof ObjectEntity) {
return false;
}
//String, numeric are fine
if (!is_object($value)) {
return false;
}
// if object has same type already (it's wierd, but ok)
if (get_class($... | php | {
"resource": ""
} |
q255733 | DomainEntityBuilder.processPropertyValue | test | private function processPropertyValue($instance, $property, $model, $value)
{
if ($this->isMorhing($model, $value)) {
$newType = $model->getType();
$new = static::create($newType, (array) $value);
$property->setValue($instance, $new);
}
} | php | {
"resource": ""
} |
q255734 | DomainEntityBuilder.getEntityFromModel | test | private function getEntityFromModel($index, $propertyName)
{
$entity = $this->model[$index];
if ($entity->getName() === $propertyName) {
return $entity;
}
// TODO Do we need to implement search by name in model?
throw new RuntimeException("Unexpected $propertyName... | php | {
"resource": ""
} |
q255735 | DataService.updateServiceContextSettingsForOthers | test | public function updateServiceContextSettingsForOthers($serviceContext)
{
$this->setupServiceContext($serviceContext);
$this->setupSerializers();
$this->useMinorVersion();
$this->setupRestHandler($serviceContext);
} | php | {
"resource": ""
} |
q255736 | DataService.setupRestHandler | test | protected function setupRestHandler($serviceContext)
{
if(isset($serviceContext)){
$client = ClientFactory::createClient($this->getClientName());
$this->restHandler = new SyncRestHandler($serviceContext, $client);
}else{
throw new SdkException("Can not set the Rest Client... | php | {
"resource": ""
} |
q255737 | DataService.setLogLocation | test | public function setLogLocation($new_log_location)
{
$restHandler = $this->restHandler;
$loggerUsedByRestHandler = $restHandler->getRequestLogger();
$loggerUsedByRestHandler->setLogDirectory($new_log_location);
return $this;
} | php | {
"resource": ""
} |
q255738 | DataService.setMinorVersion | test | public function setMinorVersion($newMinorVersion)
{
$serviceContext = $this->getServiceContext();
$serviceContext->setMinorVersion($newMinorVersion);
$this->updateServiceContextSettingsForOthers($serviceContext);
return $this;
} | php | {
"resource": ""
} |
q255739 | DataService.disableLog | test | public function disableLog()
{
$restHandler = $this->restHandler;
$loggerUsedByRestHandler = $restHandler->getRequestLogger();
$loggerUsedByRestHandler->setLogStatus(false);
return $this;
} | php | {
"resource": ""
} |
q255740 | DataService.enableLog | test | public function enableLog()
{
$restHandler = $this->restHandler;
$loggerUsedByRestHandler = $restHandler->getRequestLogger();
$loggerUsedByRestHandler->setLogStatus(true);
return $this;
} | php | {
"resource": ""
} |
q255741 | DataService.setClientName | test | public function setClientName($clientName){
$this->clientName = $clientName;
$serviceContext = $this->getServiceContext();
$this->setupRestHandler($serviceContext);
return $this;
} | php | {
"resource": ""
} |
q255742 | DataService.Configure | test | public static function Configure($settings)
{
if (isset($settings)) {
if (is_array($settings)) {
$ServiceContext = ServiceContext::ConfigureFromPassedArray($settings);
if (!isset($ServiceContext)) {
throw new SdkException('Construct ServiceCont... | php | {
"resource": ""
} |
q255743 | DataService.configureOAuth2LoginHelper | test | private function configureOAuth2LoginHelper($oauth2Conifg, $settings)
{
$refreshToken = CoreConstants::getRefreshTokenFromArray($settings);
if(isset($refreshToken)){
//Login helper for refresh token API call
$this->OAuth2LoginHelper = new OAuth2LoginHelper(null,
... | php | {
"resource": ""
} |
q255744 | DataService.updateOAuth2Token | test | public function updateOAuth2Token($newOAuth2AccessToken)
{
try{
$this->serviceContext->updateOAuth2Token($newOAuth2AccessToken);
$realmID = $newOAuth2AccessToken->getRealmID();
$this->serviceContext->realmId = $realmID;
$this->setupRestHandler($this->serviceContext);
... | php | {
"resource": ""
} |
q255745 | DataService.setupSerializers | test | public function setupSerializers()
{
$this->responseSerializer = CoreHelper::GetSerializer($this->serviceContext, false);
$this->requestSerializer = CoreHelper::GetSerializer($this->serviceContext, true);
} | php | {
"resource": ""
} |
q255746 | DataService.Update | test | public function Update($entity)
{
$this->serviceContext->IppConfiguration->Logger->RequestLog->Log(TraceLevel::Info, "Called Method: Update.");
// Validate parameter
if (!$entity) {
$this->serviceContext->IppConfiguration->Logger->RequestLog->Log(TraceLevel::Error, "Argument Nul... | php | {
"resource": ""
} |
q255747 | DataService.Add | test | public function Add($entity)
{
$this->serviceContext->IppConfiguration->Logger->RequestLog->Log(TraceLevel::Info, "Called Method Add.");
// Validate parameter
if (!$entity) {
$this->serviceContext->IppConfiguration->Logger->RequestLog->Log(TraceLevel::Error, "Argument Null Excep... | php | {
"resource": ""
} |
q255748 | DataService.Delete | test | public function Delete($entity)
{
$this->serviceContext->IppConfiguration->Logger->RequestLog->Log(TraceLevel::Info, "Called Method Delete.");
// Validate parameter
if (!$entity) {
$this->serviceContext->IppConfiguration->Logger->RequestLog->Log(TraceLevel::Error, "Argument Null... | php | {
"resource": ""
} |
q255749 | DataService.Upload | test | public function Upload($imgBits, $fileName, $mimeType, $objAttachable)
{
$this->serviceContext->IppConfiguration->Logger->RequestLog->Log(TraceLevel::Info, "Called Method Upload.");
// Validate parameter
if (!$imgBits || !$mimeType || !$fileName) {
$this->serviceContext->IppConf... | php | {
"resource": ""
} |
q255750 | DataService.SendEmail | test | public function SendEmail($entity, $email = null)
{
$this->validateEntityId($entity);
$this->verifyOperationAccess($entity, __FUNCTION__);
$entityId=$this->getIDString($entity->Id);
$uri = implode(CoreConstants::SLASH_CHAR, array('company',
$this->serviceContext->rea... | php | {
"resource": ""
} |
q255751 | DataService.Query | test | public function Query($query, $startPosition = null, $maxResults = null)
{
$this->serviceContext->IppConfiguration->Logger->RequestLog->Log(TraceLevel::Info, "Called Method Query.");
if ('QBO' == $this->serviceContext->serviceType) {
$httpsContentType = CoreConstants::CONTENTTYPE_APPLIC... | php | {
"resource": ""
} |
q255752 | DataService.appendPaginationInfo | test | private function appendPaginationInfo($query, $startPosition, $maxResults){
$query = trim($query);
if(isset($startPosition) && !empty($startPosition)){
if(stripos($query, "STARTPOSITION") === false){
if(stripos($query, "MAXRESULTS") !== false){
//In MaxResult is de... | php | {
"resource": ""
} |
q255753 | DataService.FindAll | test | public function FindAll($entityName, $pageNumber = 0, $pageSize = 500)
{
$this->serviceContext->IppConfiguration->Logger->RequestLog->Log(TraceLevel::Info, "Called Method FindAll.");
$phpClassName = DataService::decorateIntuitEntityToPhpClassName($entityName);
// Handle some special cases
... | php | {
"resource": ""
} |
q255754 | DataService.CDC | test | public function CDC($entityList, $changedSince)
{
$this->serviceContext->IppConfiguration->Logger->CustomLogger->Log(TraceLevel::Info, "Called Method CDC.");
// Validate parameter
if (count($entityList) <= 0) {
$exception = new IdsException('ParameterNotNullMessage');
... | php | {
"resource": ""
} |
q255755 | DataService.executeObjectSerializer | test | protected function executeObjectSerializer($entity, &$urlResource)
{
//
$result = $this->getRequestSerializer()->Serialize($entity);
$urlResource = $this->getRequestSerializer()->getResourceURL();
return $result;
} | php | {
"resource": ""
} |
q255756 | DataService.initPostRequest | test | protected function initPostRequest($entity, $uri)
{
return $this->isJsonOnly($entity)
? $this->getPostJsonRequest($uri)
: $this->getPostRequest($uri);
} | php | {
"resource": ""
} |
q255757 | DataService.getRequestParameters | test | protected function getRequestParameters($uri, $method, $type, $apiName = null)
{
return new RequestParameters($uri, $method, $type, $apiName);
} | php | {
"resource": ""
} |
q255758 | DataService.fixTaxServicePayload | test | private function fixTaxServicePayload($entity, $content)
{
if ($this->isTaxServiceSafe($entity)) {
//get first "line" to make sure we don't have TaxService in response
$sample = substr(trim($content), 0, 20);
$taxServiceName = self::cleanPhpClassNameToIntuitEntityName(get... | php | {
"resource": ""
} |
q255759 | DataService.getExportFileNameForPDF | test | public function getExportFileNameForPDF($entity, $ext, $usetimestamp = true)
{
//TODO: add timestamp or GUID
$this->validateEntityId($entity);
return self::getEntityResourceName($entity) . "_" . $this->getIDString($entity->Id) . ($usetimestamp ? "_" . time() : "") . ".$ext";
} | php | {
"resource": ""
} |
q255760 | DataService.isAllowed | test | private function isAllowed($entity, $method)
{
$className = get_class($entity);
if (!$className) {
$this->logError("Intuit entity is expected here instead of $entity");
throw new IdsException('Unexpected Argument Exception');
}
$classArray = explode('\\', $cl... | php | {
"resource": ""
} |
q255761 | DataService.CreateNewBatch | test | public function CreateNewBatch()
{
$batch = new Batch($this->serviceContext, $this->getRestHandler(), $this->isThrownExceptionOnError());
return $batch;
} | php | {
"resource": ""
} |
q255762 | DataService.convertToTimestamp | test | private function convertToTimestamp($str)
{
$result = date_parse($str);
if (!$result) {
return false;
}
if (empty($result) || !is_array($result)) {
return false;
}
extract($result);
if (!empty($errors)) {
throw new SdkExcept... | php | {
"resource": ""
} |
q255763 | DataService.isValidTimeStamp | test | public function isValidTimeStamp($timestamp)
{
return ((string)(int)$timestamp === $timestamp) && ($timestamp <= PHP_INT_MAX) && ($timestamp >= ~PHP_INT_MAX);
} | php | {
"resource": ""
} |
q255764 | DataService.verifyChangedSince | test | protected function verifyChangedSince($value)
{
if (is_int($value)) {
return $value;
}
// remove whitespaces, tabulation etc
$trimmed = trim($value);
if ($this->isValidTimeStamp($trimmed)) {
return $trimmed;
}
//at this point we have nu... | php | {
"resource": ""
} |
q255765 | DataService.getCompanyInfo | test | public function getCompanyInfo()
{
$currentServiceContext = $this->getServiceContext();
if (!isset($currentServiceContext) || empty($currentServiceContext->realmId)) {
throw new SdkException("Please Setup Service Context before making get CompanyInfo call.");
}
//The Comp... | php | {
"resource": ""
} |
q255766 | CoreConstants.getQuickBooksOnlineAPIEntityRules | test | public static function getQuickBooksOnlineAPIEntityRules()
{
return
array(
'*' => array(
"DownloadPDF" => false,
... | php | {
"resource": ""
} |
q255767 | CoreConstants.getAccessTokenFromArray | test | public static function getAccessTokenFromArray(array $settings){
if(array_key_exists('accessTokenKey', $settings)){
return $settings['accessTokenKey'];
}else if(array_key_exists('accessToken', $settings)){
return $settings['accessToken'];
} else if(array_key_exists('Acces... | php | {
"resource": ""
} |
q255768 | CoreConstants.getRefreshTokenFromArray | test | public static function getRefreshTokenFromArray(array $settings){
if(array_key_exists('refreshTokenKey', $settings)){
return $settings['refreshTokenKey'];
}else if(array_key_exists('refreshToken', $settings)){
return $settings['refreshToken'];
} else if(array_key_exists('... | php | {
"resource": ""
} |
q255769 | CoreConstants.getRedirectURL | test | public static function getRedirectURL(array $settings){
if(array_key_exists('redirectURL', $settings)){
return $settings['redirectURL'];
}else if(array_key_exists('RedirectUrl', $settings)){
return $settings['RedirectUrl'];
} else if(array_key_exists('redirecturl', $setti... | php | {
"resource": ""
} |
q255770 | ContentWriter.saveFile | test | public function saveFile($dir, $name=null)
{
if (empty($dir)) {
throw new SdkException("Directory is empty.");
}
if (!file_exists($dir)) {
throw new SdkException("Directory ($dir) doesn't exist.");
}
if (!is_writable($dir)) {
throw new Sd... | php | {
"resource": ""
} |
q255771 | ContentWriter.generateFileName | test | private function generateFileName($name)
{
$filename = is_null($name) ? $this->getUniqId() : $name;
return is_null($this->getPrefix()) ? $filename : $this->getPrefix() . $filename;
} | php | {
"resource": ""
} |
q255772 | FaultHandler.generateErrorFromOAuthMsg | test | private function generateErrorFromOAuthMsg($OAuthException)
{
if (get_class($OAuthException) == 'OAuthException') {
$this->httpStatusCode = $OAuthException->getCode();
$this->helpMsg = $OAuthException->getMessage();
$this->responseBody = $OAuthException->lastResponse;
... | php | {
"resource": ""
} |
q255773 | FaultHandler.parseResponse | test | public function parseResponse($message){
$xmlObj = simplexml_load_string($message);
if(!$this->isTheErrorBodyInStandardFormat($xmlObj)){
return;
}
$type = (string)$xmlObj->Fault->attributes()['type'];
if(isset($type) && !empty($type)){
$this->intuitErrorType = $type;
... | php | {
"resource": ""
} |
q255774 | FaultHandler.isTheErrorBodyInStandardFormat | test | private function isTheErrorBodyInStandardFormat($xmlObj)
{
if(!isset($xmlObj->Fault) || !isset($xmlObj->Fault->Error)){
return false;
}
return true;
} | php | {
"resource": ""
} |
q255775 | IntuitResponse.setResponseAsItIs | test | private function setResponseAsItIs($passedHeaders, $passedBody, $passedHttpResponseCode){
if(isset($passedHeaders) && isset($passedBody) && isset($passedHttpResponseCode)){
$this->headers = $passedHeaders;
$this->body = $passedBody;
$this->httpResponseCode = $passedHttpResponseCode;
... | php | {
"resource": ""
} |
q255776 | IntuitResponse.parseResponseToIntuitResponse | test | private function parseResponseToIntuitResponse($passedHeaders, $passedBody, $passedHttpResponseCode, $clientName){
if($clientName == CoreConstants::CLIENT_CURL){
if(isset($passedHeaders)){
$this->setHeaders($passedHeaders);
}else{
throw new SdkException("The response header ... | php | {
"resource": ""
} |
q255777 | IntuitResponse.setFaultHandler | test | private function setFaultHandler($body, $httpResponseCode, $tid){
//If the status code is non-200
if($httpResponseCode < 200 || $httpResponseCode >= 300){
$this->faultHandler = new FaultHandler();
$this->faultHandler->setHttpStatusCode($httpResponseCode);
$this->faultHandler->setRespon... | php | {
"resource": ""
} |
q255778 | IntuitResponse.setHeaders | test | public function setHeaders($rawHeaders){
$rawHeaders = str_replace("\r\n", "\n", $rawHeaders);
$response_headers_rows = explode("\n", trim($rawHeaders));
foreach ($response_headers_rows as $line) {
if(strpos($line, ': ') == false){
continue;
}else {
... | php | {
"resource": ""
} |
q255779 | IntuitResponse.setContentType | test | private function setContentType($key, $val){
$trimedKey = trim($key);
if(strcasecmp($trimedKey, CoreConstants::CONTENT_TYPE) == 0){
$this->contentType = trim($val);
}
} | php | {
"resource": ""
} |
q255780 | IntuitResponse.setIntuitTid | test | private function setIntuitTid($key, $val){
$trimedKey = trim($key);
if(strcasecmp($trimedKey, CoreConstants::INTUIT_TID) == 0){
$this->intuit_tid = trim($val);
}
} | php | {
"resource": ""
} |
q255781 | PlatformService.GetAppMenu | test | public function GetAppMenu()
{
$this->requestXmlDocument = '';
$uriFragment = implode(CoreConstants::SLASH_CHAR, array('v1', 'Account', 'AppMenu'));
$requestParameters = new RequestParameters(null, 'GET', null, $uriFragment);
list($respCode, $respHtml) = $this->restRequestHandler->se... | php | {
"resource": ""
} |
q255782 | PlatformService.Reconnect | test | public function Reconnect()
{
$this->requestXmlDocument = '';
$uriFragment = implode(CoreConstants::SLASH_CHAR, array('v1', 'Connection', 'Reconnect'));
$requestParameters = new RequestParameters(null, 'GET', null, $uriFragment);
list($respCode, $respXml) = $this->restRequestHandler-... | php | {
"resource": ""
} |
q255783 | Zend_Soap_Wsdl.setUri | test | public function setUri($uri)
{
if ($uri instanceof Zend_Uri_Http) {
$uri = $uri->getUri();
}
$oldUri = $this->_uri;
$this->_uri = $uri;
if ($this->_dom !== null) {
// @todo: This is the worst hack ever, but its needed due to design and non BC issues o... | php | {
"resource": ""
} |
q255784 | Zend_Soap_Wsdl.setComplexTypeStrategy | test | public function setComplexTypeStrategy($strategy)
{
if ($strategy === true) {
require_once "Zend/Soap/Wsdl/Strategy/DefaultComplexType.php";
$strategy = new Zend_Soap_Wsdl_Strategy_DefaultComplexType();
} elseif ($strategy === false) {
require_once "Zend/Soap/Wsdl... | php | {
"resource": ""
} |
q255785 | Zend_Soap_Wsdl.addBindingOperation | test | public function addBindingOperation($binding, $name, $input = false, $output = false, $fault = false)
{
$operation = $this->_dom->createElement('operation');
$operation->setAttribute('name', $name);
if (is_array($input)) {
$node = $this->_dom->createElement('input');
... | php | {
"resource": ""
} |
q255786 | Zend_Soap_Wsdl.addDocumentation | test | public function addDocumentation($input_node, $documentation)
{
if ($input_node === $this) {
$node = $this->_dom->documentElement;
} else {
$node = $input_node;
}
$doc = $this->_dom->createElement('documentation');
$doc_cdata = $this->_dom->createText... | php | {
"resource": ""
} |
q255787 | Zend_Soap_Wsdl.addTypes | test | public function addTypes($types)
{
if ($types instanceof DomDocument) {
$dom = $this->_dom->importNode($types->documentElement);
$this->_wsdl->appendChild($types->documentElement);
} elseif ($types instanceof DomNode || $types instanceof DomElement || $types instanceof DomDoc... | php | {
"resource": ""
} |
q255788 | Zend_Soap_Wsdl.addType | test | public function addType($type)
{
if (!in_array($type, $this->_includedTypes)) {
$this->_includedTypes[] = $type;
}
return $this;
} | php | {
"resource": ""
} |
q255789 | Zend_Soap_Wsdl.dump | test | public function dump($filename = false)
{
if (!$filename) {
echo $this->toXML();
return true;
} else {
return file_put_contents($filename, $this->toXML());
}
} | php | {
"resource": ""
} |
q255790 | Zend_Soap_Wsdl.addSchemaTypeSection | test | public function addSchemaTypeSection()
{
if ($this->_schema === null) {
$this->_schema = $this->_dom->createElement('xsd:schema');
$this->_schema->setAttribute('targetNamespace', $this->_uri);
$types = $this->_dom->createElement('types');
$types->appendChild($... | php | {
"resource": ""
} |
q255791 | ServiceContext.ConfigureFromPassedArray | test | public static function ConfigureFromPassedArray(array $settings)
{
ServiceContext::checkIfOAuthIsValid($settings);
if(strcasecmp($settings['auth_mode'], CoreConstants::OAUTH1) == 0) {
$OAuthConfig = new OAuthRequestValidator(
$settings['accessTokenKey'],
$... | php | {
"resource": ""
} |
q255792 | ServiceContext.checkIfOAuthIsValid | test | public static function checkIfOAuthIsValid(array $settings){
if (!isset($settings) || empty($settings)) {
throw new SdkException("Empty OAuth Array passed. Can't construct ServiceContext based on Empty Array.");
}
if(!isset($settings['auth_mode'])){
throw new SdkException("No OAut... | php | {
"resource": ""
} |
q255793 | ServiceContext.getBaseURL | test | public function getBaseURL()
{
$this->IppConfiguration->Logger->RequestLog->Log(TraceLevel::Info, "Called GetBaseURL method.");
try {
if ($this->serviceType === CoreConstants::IntuitServicesTypeQBO) {
$baseurl = $this->IppConfiguration->BaseUrl->Qbo . implode(CoreConstant... | php | {
"resource": ""
} |
q255794 | ServiceContext.useXml | test | public function useXml()
{
$this->IppConfiguration->Message->Request->CompressionFormat = CompressionFormat::None;
$this->IppConfiguration->Message->Response->CompressionFormat = CompressionFormat::None;
$this->IppConfiguration->Message->Request->SerializationFormat = SerializationFormat::Xm... | php | {
"resource": ""
} |
q255795 | ServiceContext.useJson | test | public function useJson()
{
$this->IppConfiguration->Message->Request->CompressionFormat = CompressionFormat::None;
$this->IppConfiguration->Message->Response->CompressionFormat = CompressionFormat::None;
$this->IppConfiguration->Message->Request->SerializationFormat = SerializationFormat::J... | php | {
"resource": ""
} |
q255796 | ServiceContext.disableLog | test | public function disableLog()
{
try {
$_ippConfigInstance = $this->getIppConfig();
LocalConfigReader::setupLogger($_ippConfigInstance, CoreConstants::DEFAULT_LOGGINGLOCATION, "FALSE");
} catch (\Exception $e) {
throw new \Exception("Error in disable Log.");
... | php | {
"resource": ""
} |
q255797 | ServiceContext.setLogLocation | test | public function setLogLocation($new_log_location)
{
try {
$_ippConfigInstance = $this->getIppConfig();
LocalConfigReader::setupLogger($_ippConfigInstance, $new_log_location, "TRUE");
} catch (\Exception $e) {
throw new \Exception("Error in setting up new Log Confi... | php | {
"resource": ""
} |
q255798 | ServiceContext.updateOAuth2Token | test | public function updateOAuth2Token($OAuth2AccessToken){
if($OAuth2AccessToken instanceof OAuth2AccessToken && $this->requestValidator instanceof OAuth2AccessToken){
$this->IppConfiguration->Security = $OAuth2AccessToken;
$this->requestValidator = $OAuth2AccessToken;
}
} | php | {
"resource": ""
} |
q255799 | PHPClass.getClassProperties | test | public function getClassProperties($props, $indent = "\t")
{
$code = $indent."\n";
foreach ($props as $prop) {
if (!empty($prop['docs'])) {
$code .= $indent.$this->getDocBlock($prop['docs'], $indent);
}
$code .= $indent.'public $'.$prop['name'].";... | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.