@@ -28,145 +28,145 @@ |
||
28 | 28 | |
29 | 29 | class SforceCustomField |
30 | 30 | { |
31 | - public function setCaseSensitive($caseSensitive) |
|
32 | - { |
|
33 | - $this->caseSensitive = $caseSensitive; |
|
34 | - } |
|
35 | - |
|
36 | - public function setDefaultValue($defaultValue) |
|
37 | - { |
|
38 | - $this->defaultValue = $defaultValue; |
|
39 | - } |
|
40 | - |
|
41 | - public function setDescription($description) |
|
42 | - { |
|
43 | - $this->description = $description; |
|
44 | - } |
|
45 | - |
|
46 | - public function setDisplayFormat($displayFormat) |
|
47 | - { |
|
48 | - $this->displayFormat = $displayFormat; |
|
49 | - } |
|
50 | - |
|
51 | - public function setExternalId($externalId) |
|
52 | - { |
|
53 | - $this->externalId = $externalId; |
|
54 | - } |
|
55 | - |
|
56 | - public function setFormula($formula) |
|
57 | - { |
|
58 | - $this->formula = $formula; |
|
59 | - } |
|
60 | - |
|
61 | - public function setFormulaTreatBlankAs($formulaTreatBlankAs) |
|
62 | - { |
|
63 | - $this->formulaTreatBlankAs = $formulaTreatBlankAs; |
|
64 | - } |
|
65 | - |
|
66 | - public function setFullName($fullName) |
|
67 | - { |
|
68 | - $this->fullName = $fullName; |
|
69 | - } |
|
70 | - |
|
71 | - public function setInlineHelpText($inlineHelpText) |
|
72 | - { |
|
73 | - $this->inlineHelpText = $inlineHelpText; |
|
74 | - } |
|
75 | - |
|
76 | - public function setLabel($label) |
|
77 | - { |
|
78 | - $this->label = $label; |
|
79 | - } |
|
80 | - |
|
81 | - public function setLength($length) |
|
82 | - { |
|
83 | - $this->length = $length; |
|
84 | - } |
|
85 | - |
|
86 | - public function setMaskChar($maskChar) |
|
87 | - { |
|
88 | - $this->maskChar = $maskChar; |
|
89 | - } |
|
90 | - |
|
91 | - public function setMaskType($maskType) |
|
92 | - { |
|
93 | - $this->maskType = $maskType; |
|
94 | - } |
|
95 | - |
|
96 | - public function setPicklist($picklist) |
|
97 | - { |
|
98 | - $this->picklist = $picklist; |
|
99 | - } |
|
100 | - |
|
101 | - public function setPopulateExistingRows($populateExistingRows) |
|
102 | - { |
|
103 | - $this->populateExistingRows = $populateExistingRows; |
|
104 | - } |
|
105 | - |
|
106 | - public function setPrecision($precision) |
|
107 | - { |
|
108 | - $this->precision = $precision; |
|
109 | - } |
|
110 | - |
|
111 | - public function setReferenceTo($referenceTo) |
|
112 | - { |
|
113 | - $this->referenceTo = $referenceTo; |
|
114 | - } |
|
115 | - |
|
116 | - public function setRelationshipName($relationshipName) |
|
117 | - { |
|
118 | - $this->relationshipName = $relationshipName; |
|
119 | - } |
|
120 | - |
|
121 | - public function setRequired($required) |
|
122 | - { |
|
123 | - $this->required = $required; |
|
124 | - } |
|
125 | - |
|
126 | - public function setScale($scale) |
|
127 | - { |
|
128 | - $this->scale = $scale; |
|
129 | - } |
|
130 | - |
|
131 | - public function setStartingNumber($startingNumber) |
|
132 | - { |
|
133 | - $this->startingNumber = $startingNumber; |
|
134 | - } |
|
135 | - |
|
136 | - public function setSummarizeField($summarizeField) |
|
137 | - { |
|
138 | - $this->summarizeField = $summarizeField; |
|
139 | - } |
|
140 | - |
|
141 | - public function setSummaryFilterItems($summaryFilterItems) |
|
142 | - { |
|
143 | - $this->summaryFilterItems = $summaryFilterItems; |
|
144 | - } |
|
145 | - |
|
146 | - public function setSummaryForeignKey($summaryForeignKey) |
|
147 | - { |
|
148 | - $this->summaryForeignKey = $summaryForeignKey; |
|
149 | - } |
|
150 | - |
|
151 | - public function setSummaryOperation($summaryOperation) |
|
152 | - { |
|
153 | - $this->summaryOperation = $summaryOperation; |
|
154 | - } |
|
155 | - |
|
156 | - public function setType($type) |
|
157 | - { |
|
158 | - $this->type = $type; |
|
159 | - } |
|
160 | - |
|
161 | - public function setUnique($unique) |
|
162 | - { |
|
163 | - $this->unique = $unique; |
|
164 | - } |
|
165 | - |
|
166 | - public function setVisibleLines($visibleLines) |
|
167 | - { |
|
168 | - $this->visibleLines = $visibleLines; |
|
169 | - } |
|
31 | + public function setCaseSensitive($caseSensitive) |
|
32 | + { |
|
33 | + $this->caseSensitive = $caseSensitive; |
|
34 | + } |
|
35 | + |
|
36 | + public function setDefaultValue($defaultValue) |
|
37 | + { |
|
38 | + $this->defaultValue = $defaultValue; |
|
39 | + } |
|
40 | + |
|
41 | + public function setDescription($description) |
|
42 | + { |
|
43 | + $this->description = $description; |
|
44 | + } |
|
45 | + |
|
46 | + public function setDisplayFormat($displayFormat) |
|
47 | + { |
|
48 | + $this->displayFormat = $displayFormat; |
|
49 | + } |
|
50 | + |
|
51 | + public function setExternalId($externalId) |
|
52 | + { |
|
53 | + $this->externalId = $externalId; |
|
54 | + } |
|
55 | + |
|
56 | + public function setFormula($formula) |
|
57 | + { |
|
58 | + $this->formula = $formula; |
|
59 | + } |
|
60 | + |
|
61 | + public function setFormulaTreatBlankAs($formulaTreatBlankAs) |
|
62 | + { |
|
63 | + $this->formulaTreatBlankAs = $formulaTreatBlankAs; |
|
64 | + } |
|
65 | + |
|
66 | + public function setFullName($fullName) |
|
67 | + { |
|
68 | + $this->fullName = $fullName; |
|
69 | + } |
|
70 | + |
|
71 | + public function setInlineHelpText($inlineHelpText) |
|
72 | + { |
|
73 | + $this->inlineHelpText = $inlineHelpText; |
|
74 | + } |
|
75 | + |
|
76 | + public function setLabel($label) |
|
77 | + { |
|
78 | + $this->label = $label; |
|
79 | + } |
|
80 | + |
|
81 | + public function setLength($length) |
|
82 | + { |
|
83 | + $this->length = $length; |
|
84 | + } |
|
85 | + |
|
86 | + public function setMaskChar($maskChar) |
|
87 | + { |
|
88 | + $this->maskChar = $maskChar; |
|
89 | + } |
|
90 | + |
|
91 | + public function setMaskType($maskType) |
|
92 | + { |
|
93 | + $this->maskType = $maskType; |
|
94 | + } |
|
95 | + |
|
96 | + public function setPicklist($picklist) |
|
97 | + { |
|
98 | + $this->picklist = $picklist; |
|
99 | + } |
|
100 | + |
|
101 | + public function setPopulateExistingRows($populateExistingRows) |
|
102 | + { |
|
103 | + $this->populateExistingRows = $populateExistingRows; |
|
104 | + } |
|
105 | + |
|
106 | + public function setPrecision($precision) |
|
107 | + { |
|
108 | + $this->precision = $precision; |
|
109 | + } |
|
110 | + |
|
111 | + public function setReferenceTo($referenceTo) |
|
112 | + { |
|
113 | + $this->referenceTo = $referenceTo; |
|
114 | + } |
|
115 | + |
|
116 | + public function setRelationshipName($relationshipName) |
|
117 | + { |
|
118 | + $this->relationshipName = $relationshipName; |
|
119 | + } |
|
120 | + |
|
121 | + public function setRequired($required) |
|
122 | + { |
|
123 | + $this->required = $required; |
|
124 | + } |
|
125 | + |
|
126 | + public function setScale($scale) |
|
127 | + { |
|
128 | + $this->scale = $scale; |
|
129 | + } |
|
130 | + |
|
131 | + public function setStartingNumber($startingNumber) |
|
132 | + { |
|
133 | + $this->startingNumber = $startingNumber; |
|
134 | + } |
|
135 | + |
|
136 | + public function setSummarizeField($summarizeField) |
|
137 | + { |
|
138 | + $this->summarizeField = $summarizeField; |
|
139 | + } |
|
140 | + |
|
141 | + public function setSummaryFilterItems($summaryFilterItems) |
|
142 | + { |
|
143 | + $this->summaryFilterItems = $summaryFilterItems; |
|
144 | + } |
|
145 | + |
|
146 | + public function setSummaryForeignKey($summaryForeignKey) |
|
147 | + { |
|
148 | + $this->summaryForeignKey = $summaryForeignKey; |
|
149 | + } |
|
150 | + |
|
151 | + public function setSummaryOperation($summaryOperation) |
|
152 | + { |
|
153 | + $this->summaryOperation = $summaryOperation; |
|
154 | + } |
|
155 | + |
|
156 | + public function setType($type) |
|
157 | + { |
|
158 | + $this->type = $type; |
|
159 | + } |
|
160 | + |
|
161 | + public function setUnique($unique) |
|
162 | + { |
|
163 | + $this->unique = $unique; |
|
164 | + } |
|
165 | + |
|
166 | + public function setVisibleLines($visibleLines) |
|
167 | + { |
|
168 | + $this->visibleLines = $visibleLines; |
|
169 | + } |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | ?> |
@@ -27,10 +27,10 @@ |
||
27 | 27 | */ |
28 | 28 | class ProxySettings |
29 | 29 | { |
30 | - public $host; |
|
31 | - public $port; |
|
32 | - public $login; |
|
33 | - public $password; |
|
30 | + public $host; |
|
31 | + public $port; |
|
32 | + public $login; |
|
33 | + public $password; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | ?> |
@@ -28,46 +28,46 @@ |
||
28 | 28 | |
29 | 29 | class Email |
30 | 30 | { |
31 | - const EMAIL_PRIORITY_HIGHEST = 'Highest'; |
|
32 | - const EMAIL_PRIORITY_HIGH = 'High'; |
|
33 | - const EMAIL_PRIORITY_NORMAL = 'Normal'; |
|
34 | - const EMAIL_PRIORITY_LOW = 'Low'; |
|
35 | - const EMAIL_PRIORITY_LOWEST = 'Lowest'; |
|
31 | + const EMAIL_PRIORITY_HIGHEST = 'Highest'; |
|
32 | + const EMAIL_PRIORITY_HIGH = 'High'; |
|
33 | + const EMAIL_PRIORITY_NORMAL = 'Normal'; |
|
34 | + const EMAIL_PRIORITY_LOW = 'Low'; |
|
35 | + const EMAIL_PRIORITY_LOWEST = 'Lowest'; |
|
36 | 36 | |
37 | - public function setBccSender($bccSender) |
|
38 | - { |
|
39 | - $this->bccSender = $bccSender; |
|
40 | - } |
|
37 | + public function setBccSender($bccSender) |
|
38 | + { |
|
39 | + $this->bccSender = $bccSender; |
|
40 | + } |
|
41 | 41 | |
42 | - public function setEmailPriority($priority) |
|
43 | - { |
|
44 | - $this->emailPriority = $priority; |
|
45 | - } |
|
42 | + public function setEmailPriority($priority) |
|
43 | + { |
|
44 | + $this->emailPriority = $priority; |
|
45 | + } |
|
46 | 46 | |
47 | - public function setSubject($subject) |
|
48 | - { |
|
49 | - $this->subject = $subject; |
|
50 | - } |
|
47 | + public function setSubject($subject) |
|
48 | + { |
|
49 | + $this->subject = $subject; |
|
50 | + } |
|
51 | 51 | |
52 | - public function setSaveAsActivity($saveAsActivity) |
|
53 | - { |
|
54 | - $this->saveAsActivity = $saveAsActivity; |
|
55 | - } |
|
52 | + public function setSaveAsActivity($saveAsActivity) |
|
53 | + { |
|
54 | + $this->saveAsActivity = $saveAsActivity; |
|
55 | + } |
|
56 | 56 | |
57 | - public function setReplyTo($replyTo) |
|
58 | - { |
|
59 | - $this->replyTo = $replyTo; |
|
60 | - } |
|
57 | + public function setReplyTo($replyTo) |
|
58 | + { |
|
59 | + $this->replyTo = $replyTo; |
|
60 | + } |
|
61 | 61 | |
62 | - public function setUseSignature($useSignature) |
|
63 | - { |
|
64 | - $this->useSignature = $useSignature; |
|
65 | - } |
|
62 | + public function setUseSignature($useSignature) |
|
63 | + { |
|
64 | + $this->useSignature = $useSignature; |
|
65 | + } |
|
66 | 66 | |
67 | - public function setSenderDisplayName($name) |
|
68 | - { |
|
69 | - $this->senderDisplayName = $name; |
|
70 | - } |
|
67 | + public function setSenderDisplayName($name) |
|
68 | + { |
|
69 | + $this->senderDisplayName = $name; |
|
70 | + } |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | ?> |
@@ -27,70 +27,70 @@ |
||
27 | 27 | */ |
28 | 28 | class SingleEmailMessage extends Email |
29 | 29 | { |
30 | - public $ccAddresses; |
|
30 | + public $ccAddresses; |
|
31 | 31 | |
32 | - public function __construct() |
|
33 | - { |
|
32 | + public function __construct() |
|
33 | + { |
|
34 | 34 | |
35 | - } |
|
35 | + } |
|
36 | 36 | |
37 | - public function setBccAddresses($addresses) |
|
38 | - { |
|
39 | - $this->bccAddresses = $addresses; |
|
40 | - } |
|
37 | + public function setBccAddresses($addresses) |
|
38 | + { |
|
39 | + $this->bccAddresses = $addresses; |
|
40 | + } |
|
41 | 41 | |
42 | - public function setCcAddresses($addresses) |
|
43 | - { |
|
44 | - $this->ccAddresses = $addresses; |
|
45 | - } |
|
42 | + public function setCcAddresses($addresses) |
|
43 | + { |
|
44 | + $this->ccAddresses = $addresses; |
|
45 | + } |
|
46 | 46 | |
47 | - public function setCharset($charset) |
|
48 | - { |
|
49 | - $this->charset = $charset; |
|
50 | - } |
|
47 | + public function setCharset($charset) |
|
48 | + { |
|
49 | + $this->charset = $charset; |
|
50 | + } |
|
51 | 51 | |
52 | - public function setHtmlBody($htmlBody) |
|
53 | - { |
|
54 | - $this->htmlBody = $htmlBody; |
|
55 | - } |
|
52 | + public function setHtmlBody($htmlBody) |
|
53 | + { |
|
54 | + $this->htmlBody = $htmlBody; |
|
55 | + } |
|
56 | 56 | |
57 | - public function setOrgWideEmailAddressId($orgWideEmailAddressId) |
|
58 | - { |
|
59 | - $this->orgWideEmailAddressId = $orgWideEmailAddressId; |
|
60 | - } |
|
57 | + public function setOrgWideEmailAddressId($orgWideEmailAddressId) |
|
58 | + { |
|
59 | + $this->orgWideEmailAddressId = $orgWideEmailAddressId; |
|
60 | + } |
|
61 | 61 | |
62 | - public function setPlainTextBody($plainTextBody) |
|
63 | - { |
|
64 | - $this->plainTextBody = $plainTextBody; |
|
65 | - } |
|
62 | + public function setPlainTextBody($plainTextBody) |
|
63 | + { |
|
64 | + $this->plainTextBody = $plainTextBody; |
|
65 | + } |
|
66 | 66 | |
67 | - public function setTargetObjectId($targetObjectId) |
|
68 | - { |
|
69 | - $this->targetObjectId = $targetObjectId; |
|
70 | - } |
|
67 | + public function setTargetObjectId($targetObjectId) |
|
68 | + { |
|
69 | + $this->targetObjectId = $targetObjectId; |
|
70 | + } |
|
71 | 71 | |
72 | - public function setTemplateId($templateId) |
|
73 | - { |
|
74 | - $this->templateId = $templateId; |
|
75 | - } |
|
72 | + public function setTemplateId($templateId) |
|
73 | + { |
|
74 | + $this->templateId = $templateId; |
|
75 | + } |
|
76 | 76 | |
77 | - public function setToAddresses($array) |
|
78 | - { |
|
79 | - $this->toAddresses = $array; |
|
80 | - } |
|
77 | + public function setToAddresses($array) |
|
78 | + { |
|
79 | + $this->toAddresses = $array; |
|
80 | + } |
|
81 | 81 | |
82 | - public function setWhatId($whatId) |
|
83 | - { |
|
84 | - $this->whatId = $whatId; |
|
85 | - } |
|
82 | + public function setWhatId($whatId) |
|
83 | + { |
|
84 | + $this->whatId = $whatId; |
|
85 | + } |
|
86 | 86 | |
87 | - public function setFileAttachments($array) |
|
88 | - { |
|
89 | - $this->fileAttachments = $array; |
|
90 | - } |
|
87 | + public function setFileAttachments($array) |
|
88 | + { |
|
89 | + $this->fileAttachments = $array; |
|
90 | + } |
|
91 | 91 | |
92 | - public function setDocumentAttachments($array) |
|
93 | - { |
|
94 | - $this->documentAttachments = $array; |
|
95 | - } |
|
92 | + public function setDocumentAttachments($array) |
|
93 | + { |
|
94 | + $this->documentAttachments = $array; |
|
95 | + } |
|
96 | 96 | } |
@@ -32,158 +32,158 @@ |
||
32 | 32 | |
33 | 33 | class SforceMetadataClient |
34 | 34 | { |
35 | - public $sforce; |
|
36 | - protected $sessionId; |
|
37 | - protected $location; |
|
38 | - protected $version = '27.0'; |
|
39 | - |
|
40 | - protected $namespace = 'http://soap.sforce.com/2006/04/metadata'; |
|
41 | - |
|
42 | - public function __construct($wsdl, $loginResult, $sforceConn) |
|
43 | - { |
|
44 | - $soapClientArray = null; |
|
45 | - |
|
46 | - $phpversion = substr(phpversion(), 0, strpos(phpversion(), '-')); |
|
47 | - if ($phpversion > '5.1.2') { |
|
48 | - $soapClientArray = array( |
|
49 | - 'user_agent' => 'salesforce-toolkit-php/' . $this->version, |
|
50 | - 'encoding' => 'utf-8', |
|
51 | - 'trace' => 1, |
|
52 | - 'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP, |
|
53 | - 'sessionId' => $loginResult->sessionId |
|
54 | - ); |
|
55 | - } else { |
|
56 | - $soapClientArray = array( |
|
57 | - 'user_agent' => 'salesforce-toolkit-php/' . $this->version, |
|
58 | - 'encoding' => 'utf-8', |
|
59 | - 'trace' => 1, |
|
60 | - 'sessionId' => $loginResult->sessionId |
|
61 | - ); |
|
62 | - } |
|
63 | - |
|
64 | - $this->sforce = new SoapClient($wsdl, $soapClientArray); |
|
65 | - |
|
66 | - $sessionVar = array( |
|
67 | - 'sessionId' => new SoapVar($loginResult->sessionId, XSD_STRING) |
|
68 | - ); |
|
69 | - |
|
70 | - $headerBody = new SoapVar($sessionVar, SOAP_ENC_OBJECT); |
|
71 | - |
|
72 | - $session_header = new SoapHeader($this->namespace, 'SessionHeader', $headerBody, false); |
|
73 | - |
|
74 | - $header_array = array( |
|
75 | - $session_header |
|
76 | - ); |
|
77 | - |
|
78 | - $this->sforce->__setSoapHeaders($header_array); |
|
79 | - $this->sforce->__setLocation($loginResult->metadataServerUrl); |
|
80 | - |
|
81 | - return $this->sforce; |
|
82 | - } |
|
83 | - |
|
84 | - /** |
|
85 | - * Specifies the session ID returned from the login server after a successful |
|
86 | - * login. |
|
87 | - */ |
|
88 | - protected function _setLoginHeader($loginResult) |
|
89 | - { |
|
90 | - $this->sessionId = $loginResult->sessionId; |
|
91 | - $this->setSessionHeader($this->sessionId); |
|
92 | - $serverURL = $loginResult->serverUrl; |
|
93 | - $this->setEndPoint($serverURL); |
|
94 | - } |
|
95 | - |
|
96 | - /** |
|
97 | - * Set the endpoint. |
|
98 | - * |
|
99 | - * @param string $location Location |
|
100 | - */ |
|
101 | - public function setEndpoint($location) |
|
102 | - { |
|
103 | - $this->location = $location; |
|
104 | - $this->sforce->__setLocation($location); |
|
105 | - } |
|
106 | - |
|
107 | - /** |
|
108 | - * Set the Session ID |
|
109 | - * |
|
110 | - * @param string $sessionId Session ID |
|
111 | - */ |
|
112 | - public function setSessionHeader($sessionId) |
|
113 | - { |
|
114 | - $this->sforce->__setSoapHeaders(null); |
|
115 | - $session_header = new SoapHeader($this->namespace, 'SessionHeader', array( |
|
116 | - 'sessionId' => $sessionId |
|
117 | - )); |
|
118 | - $this->sessionId = $sessionId; |
|
119 | - $header_array = array( |
|
120 | - $session_header |
|
121 | - ); |
|
122 | - $this->_setClientId($header_array); |
|
123 | - $this->sforce->__setSoapHeaders($header_array); |
|
124 | - } |
|
125 | - |
|
126 | - private function getObjtype($obj) |
|
127 | - { |
|
128 | - $classArray = explode('\\', get_class($obj)); |
|
129 | - $objtype = array_pop($classArray); |
|
130 | - if (strpos($objtype, 'Sforce', 0) === 0) { |
|
131 | - $objtype = substr($objtype, 6); |
|
132 | - } |
|
133 | - |
|
134 | - return $objtype; |
|
135 | - } |
|
136 | - |
|
137 | - public function create($obj) |
|
138 | - { |
|
139 | - $encodedObj = new stdClass(); |
|
140 | - $encodedObj->metadata = new SoapVar($obj, SOAP_ENC_OBJECT, $this->getObjtype($obj), $this->namespace); |
|
141 | - |
|
142 | - return $this->sforce->create($encodedObj); |
|
143 | - } |
|
144 | - |
|
145 | - public function update($obj) |
|
146 | - { |
|
147 | - $encodedObj = new stdClass(); |
|
148 | - $encodedObj->UpdateMetadata = $obj; |
|
149 | - $encodedObj->UpdateMetadata->metadata = new SoapVar($obj->metadata, SOAP_ENC_OBJECT, |
|
150 | - $this->getObjtype($obj->metadata), $this->namespace); |
|
151 | - |
|
152 | - return $this->sforce->update($encodedObj); |
|
153 | - } |
|
154 | - |
|
155 | - public function delete($obj) |
|
156 | - { |
|
157 | - $encodedObj = new stdClass(); |
|
158 | - $encodedObj->metadata = new SoapVar($obj, SOAP_ENC_OBJECT, $this->getObjtype($obj), $this->namespace); |
|
159 | - |
|
160 | - return $this->sforce->delete($encodedObj); |
|
161 | - } |
|
162 | - |
|
163 | - public function checkStatus($ids) |
|
164 | - { |
|
165 | - return $this->sforce->checkStatus($ids); |
|
166 | - } |
|
167 | - |
|
168 | - public function getLastRequest() |
|
169 | - { |
|
170 | - return $this->sforce->__getLastRequest(); |
|
171 | - } |
|
172 | - |
|
173 | - public function getLastRequestHeaders() |
|
174 | - { |
|
175 | - return $this->sforce->__getLastRequestHeaders(); |
|
176 | - } |
|
177 | - |
|
178 | - public function getLastResponse() |
|
179 | - { |
|
180 | - return $this->sforce->__getLastResponse(); |
|
181 | - } |
|
182 | - |
|
183 | - public function getLastResponseHeaders() |
|
184 | - { |
|
185 | - return $this->sforce->__getLastResponseHeaders(); |
|
186 | - } |
|
35 | + public $sforce; |
|
36 | + protected $sessionId; |
|
37 | + protected $location; |
|
38 | + protected $version = '27.0'; |
|
39 | + |
|
40 | + protected $namespace = 'http://soap.sforce.com/2006/04/metadata'; |
|
41 | + |
|
42 | + public function __construct($wsdl, $loginResult, $sforceConn) |
|
43 | + { |
|
44 | + $soapClientArray = null; |
|
45 | + |
|
46 | + $phpversion = substr(phpversion(), 0, strpos(phpversion(), '-')); |
|
47 | + if ($phpversion > '5.1.2') { |
|
48 | + $soapClientArray = array( |
|
49 | + 'user_agent' => 'salesforce-toolkit-php/' . $this->version, |
|
50 | + 'encoding' => 'utf-8', |
|
51 | + 'trace' => 1, |
|
52 | + 'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP, |
|
53 | + 'sessionId' => $loginResult->sessionId |
|
54 | + ); |
|
55 | + } else { |
|
56 | + $soapClientArray = array( |
|
57 | + 'user_agent' => 'salesforce-toolkit-php/' . $this->version, |
|
58 | + 'encoding' => 'utf-8', |
|
59 | + 'trace' => 1, |
|
60 | + 'sessionId' => $loginResult->sessionId |
|
61 | + ); |
|
62 | + } |
|
63 | + |
|
64 | + $this->sforce = new SoapClient($wsdl, $soapClientArray); |
|
65 | + |
|
66 | + $sessionVar = array( |
|
67 | + 'sessionId' => new SoapVar($loginResult->sessionId, XSD_STRING) |
|
68 | + ); |
|
69 | + |
|
70 | + $headerBody = new SoapVar($sessionVar, SOAP_ENC_OBJECT); |
|
71 | + |
|
72 | + $session_header = new SoapHeader($this->namespace, 'SessionHeader', $headerBody, false); |
|
73 | + |
|
74 | + $header_array = array( |
|
75 | + $session_header |
|
76 | + ); |
|
77 | + |
|
78 | + $this->sforce->__setSoapHeaders($header_array); |
|
79 | + $this->sforce->__setLocation($loginResult->metadataServerUrl); |
|
80 | + |
|
81 | + return $this->sforce; |
|
82 | + } |
|
83 | + |
|
84 | + /** |
|
85 | + * Specifies the session ID returned from the login server after a successful |
|
86 | + * login. |
|
87 | + */ |
|
88 | + protected function _setLoginHeader($loginResult) |
|
89 | + { |
|
90 | + $this->sessionId = $loginResult->sessionId; |
|
91 | + $this->setSessionHeader($this->sessionId); |
|
92 | + $serverURL = $loginResult->serverUrl; |
|
93 | + $this->setEndPoint($serverURL); |
|
94 | + } |
|
95 | + |
|
96 | + /** |
|
97 | + * Set the endpoint. |
|
98 | + * |
|
99 | + * @param string $location Location |
|
100 | + */ |
|
101 | + public function setEndpoint($location) |
|
102 | + { |
|
103 | + $this->location = $location; |
|
104 | + $this->sforce->__setLocation($location); |
|
105 | + } |
|
106 | + |
|
107 | + /** |
|
108 | + * Set the Session ID |
|
109 | + * |
|
110 | + * @param string $sessionId Session ID |
|
111 | + */ |
|
112 | + public function setSessionHeader($sessionId) |
|
113 | + { |
|
114 | + $this->sforce->__setSoapHeaders(null); |
|
115 | + $session_header = new SoapHeader($this->namespace, 'SessionHeader', array( |
|
116 | + 'sessionId' => $sessionId |
|
117 | + )); |
|
118 | + $this->sessionId = $sessionId; |
|
119 | + $header_array = array( |
|
120 | + $session_header |
|
121 | + ); |
|
122 | + $this->_setClientId($header_array); |
|
123 | + $this->sforce->__setSoapHeaders($header_array); |
|
124 | + } |
|
125 | + |
|
126 | + private function getObjtype($obj) |
|
127 | + { |
|
128 | + $classArray = explode('\\', get_class($obj)); |
|
129 | + $objtype = array_pop($classArray); |
|
130 | + if (strpos($objtype, 'Sforce', 0) === 0) { |
|
131 | + $objtype = substr($objtype, 6); |
|
132 | + } |
|
133 | + |
|
134 | + return $objtype; |
|
135 | + } |
|
136 | + |
|
137 | + public function create($obj) |
|
138 | + { |
|
139 | + $encodedObj = new stdClass(); |
|
140 | + $encodedObj->metadata = new SoapVar($obj, SOAP_ENC_OBJECT, $this->getObjtype($obj), $this->namespace); |
|
141 | + |
|
142 | + return $this->sforce->create($encodedObj); |
|
143 | + } |
|
144 | + |
|
145 | + public function update($obj) |
|
146 | + { |
|
147 | + $encodedObj = new stdClass(); |
|
148 | + $encodedObj->UpdateMetadata = $obj; |
|
149 | + $encodedObj->UpdateMetadata->metadata = new SoapVar($obj->metadata, SOAP_ENC_OBJECT, |
|
150 | + $this->getObjtype($obj->metadata), $this->namespace); |
|
151 | + |
|
152 | + return $this->sforce->update($encodedObj); |
|
153 | + } |
|
154 | + |
|
155 | + public function delete($obj) |
|
156 | + { |
|
157 | + $encodedObj = new stdClass(); |
|
158 | + $encodedObj->metadata = new SoapVar($obj, SOAP_ENC_OBJECT, $this->getObjtype($obj), $this->namespace); |
|
159 | + |
|
160 | + return $this->sforce->delete($encodedObj); |
|
161 | + } |
|
162 | + |
|
163 | + public function checkStatus($ids) |
|
164 | + { |
|
165 | + return $this->sforce->checkStatus($ids); |
|
166 | + } |
|
167 | + |
|
168 | + public function getLastRequest() |
|
169 | + { |
|
170 | + return $this->sforce->__getLastRequest(); |
|
171 | + } |
|
172 | + |
|
173 | + public function getLastRequestHeaders() |
|
174 | + { |
|
175 | + return $this->sforce->__getLastRequestHeaders(); |
|
176 | + } |
|
177 | + |
|
178 | + public function getLastResponse() |
|
179 | + { |
|
180 | + return $this->sforce->__getLastResponse(); |
|
181 | + } |
|
182 | + |
|
183 | + public function getLastResponseHeaders() |
|
184 | + { |
|
185 | + return $this->sforce->__getLastResponseHeaders(); |
|
186 | + } |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | ?> |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $phpversion = substr(phpversion(), 0, strpos(phpversion(), '-')); |
47 | 47 | if ($phpversion > '5.1.2') { |
48 | 48 | $soapClientArray = array( |
49 | - 'user_agent' => 'salesforce-toolkit-php/' . $this->version, |
|
49 | + 'user_agent' => 'salesforce-toolkit-php/'.$this->version, |
|
50 | 50 | 'encoding' => 'utf-8', |
51 | 51 | 'trace' => 1, |
52 | 52 | 'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP, |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | ); |
55 | 55 | } else { |
56 | 56 | $soapClientArray = array( |
57 | - 'user_agent' => 'salesforce-toolkit-php/' . $this->version, |
|
57 | + 'user_agent' => 'salesforce-toolkit-php/'.$this->version, |
|
58 | 58 | 'encoding' => 'utf-8', |
59 | 59 | 'trace' => 1, |
60 | 60 | 'sessionId' => $loginResult->sessionId |
@@ -28,89 +28,89 @@ |
||
28 | 28 | |
29 | 29 | class QueryResult implements \Iterator |
30 | 30 | { |
31 | - public $queryLocator; |
|
32 | - public $done; |
|
33 | - public $records; |
|
34 | - public $size; |
|
31 | + public $queryLocator; |
|
32 | + public $done; |
|
33 | + public $records; |
|
34 | + public $size; |
|
35 | 35 | |
36 | - public $pointer; // Current iterator location |
|
37 | - private $sf; // SOAP Client |
|
36 | + public $pointer; // Current iterator location |
|
37 | + private $sf; // SOAP Client |
|
38 | 38 | |
39 | - public function __construct($response) |
|
40 | - { |
|
41 | - $this->queryLocator = $response->queryLocator; |
|
42 | - $this->done = $response->done; |
|
43 | - $this->size = $response->size; |
|
39 | + public function __construct($response) |
|
40 | + { |
|
41 | + $this->queryLocator = $response->queryLocator; |
|
42 | + $this->done = $response->done; |
|
43 | + $this->size = $response->size; |
|
44 | 44 | |
45 | - $this->pointer = 0; |
|
46 | - $this->sf = false; |
|
45 | + $this->pointer = 0; |
|
46 | + $this->sf = false; |
|
47 | 47 | |
48 | - if ($response instanceof QueryResult) { |
|
49 | - $this->records = $response->records; |
|
50 | - } else { |
|
51 | - $this->records = array(); |
|
52 | - if (isset($response->records)) { |
|
53 | - if (is_array($response->records)) { |
|
54 | - foreach ($response->records as $record) { |
|
55 | - array_push($this->records, $record); |
|
56 | - } |
|
57 | - } else { |
|
58 | - array_push($this->records, $record); |
|
59 | - } |
|
60 | - } |
|
61 | - } |
|
62 | - } |
|
48 | + if ($response instanceof QueryResult) { |
|
49 | + $this->records = $response->records; |
|
50 | + } else { |
|
51 | + $this->records = array(); |
|
52 | + if (isset($response->records)) { |
|
53 | + if (is_array($response->records)) { |
|
54 | + foreach ($response->records as $record) { |
|
55 | + array_push($this->records, $record); |
|
56 | + } |
|
57 | + } else { |
|
58 | + array_push($this->records, $record); |
|
59 | + } |
|
60 | + } |
|
61 | + } |
|
62 | + } |
|
63 | 63 | |
64 | - // Dependency Injection |
|
65 | - public function setSf(SforceBaseClient $sf) |
|
66 | - { |
|
67 | - $this->sf = $sf; |
|
68 | - } |
|
64 | + // Dependency Injection |
|
65 | + public function setSf(SforceBaseClient $sf) |
|
66 | + { |
|
67 | + $this->sf = $sf; |
|
68 | + } |
|
69 | 69 | |
70 | - // Basic Iterator implementation functions |
|
71 | - public function rewind() |
|
72 | - { |
|
73 | - $this->pointer = 0; |
|
74 | - } |
|
70 | + // Basic Iterator implementation functions |
|
71 | + public function rewind() |
|
72 | + { |
|
73 | + $this->pointer = 0; |
|
74 | + } |
|
75 | 75 | |
76 | - public function next() |
|
77 | - { |
|
78 | - ++$this->pointer; |
|
79 | - } |
|
76 | + public function next() |
|
77 | + { |
|
78 | + ++$this->pointer; |
|
79 | + } |
|
80 | 80 | |
81 | - public function key() |
|
82 | - { |
|
83 | - return $this->pointer; |
|
84 | - } |
|
81 | + public function key() |
|
82 | + { |
|
83 | + return $this->pointer; |
|
84 | + } |
|
85 | 85 | |
86 | - public function current() |
|
87 | - { |
|
88 | - return new SObject($this->records[$this->pointer]); |
|
89 | - } |
|
86 | + public function current() |
|
87 | + { |
|
88 | + return new SObject($this->records[$this->pointer]); |
|
89 | + } |
|
90 | 90 | |
91 | - public function valid() |
|
92 | - { |
|
93 | - while ($this->pointer >= count($this->records)) { |
|
94 | - // Pointer is larger than (current) result set; see if we can fetch more |
|
95 | - if ($this->done === false) { |
|
96 | - if ($this->sf === false) { |
|
97 | - throw new \Exception("Dependency not met!"); |
|
98 | - } |
|
99 | - $response = $this->sf->queryMore($this->queryLocator); |
|
100 | - $this->records = array_merge($this->records, $response->records); // Append more results |
|
101 | - $this->done = $response->done; |
|
102 | - $this->queryLocator = $response->queryLocator; |
|
103 | - } else { |
|
104 | - return false; // No more records to fetch |
|
105 | - } |
|
106 | - } |
|
91 | + public function valid() |
|
92 | + { |
|
93 | + while ($this->pointer >= count($this->records)) { |
|
94 | + // Pointer is larger than (current) result set; see if we can fetch more |
|
95 | + if ($this->done === false) { |
|
96 | + if ($this->sf === false) { |
|
97 | + throw new \Exception("Dependency not met!"); |
|
98 | + } |
|
99 | + $response = $this->sf->queryMore($this->queryLocator); |
|
100 | + $this->records = array_merge($this->records, $response->records); // Append more results |
|
101 | + $this->done = $response->done; |
|
102 | + $this->queryLocator = $response->queryLocator; |
|
103 | + } else { |
|
104 | + return false; // No more records to fetch |
|
105 | + } |
|
106 | + } |
|
107 | 107 | |
108 | - if (isset($this->records[$this->pointer])) { |
|
109 | - return true; |
|
110 | - } |
|
108 | + if (isset($this->records[$this->pointer])) { |
|
109 | + return true; |
|
110 | + } |
|
111 | 111 | |
112 | - throw new \Exception("QueryResult has gaps in the record data?"); |
|
113 | - } |
|
112 | + throw new \Exception("QueryResult has gaps in the record data?"); |
|
113 | + } |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | ?> |
@@ -28,7 +28,7 @@ |
||
28 | 28 | |
29 | 29 | class ProcessSubmitRequest extends ProcessRequest |
30 | 30 | { |
31 | - public $objectId; |
|
31 | + public $objectId; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | ?> |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php namespace Davispeixoto\ForceDotComToolkitForPhp; |
2 | 2 | |
3 | - /* |
|
3 | + /* |
|
4 | 4 | * Copyright (c) 2007, salesforce.com, inc. |
5 | 5 | * All rights reserved. |
6 | 6 | * |
@@ -33,13 +33,13 @@ discard block |
||
33 | 33 | */ |
34 | 34 | class MruHeader |
35 | 35 | { |
36 | - // boolean that Indicates whether to update the list of most recently used items (True) or not (False). |
|
37 | - public $updateMruFlag; |
|
36 | + // boolean that Indicates whether to update the list of most recently used items (True) or not (False). |
|
37 | + public $updateMruFlag; |
|
38 | 38 | |
39 | - public function __construct($bool) |
|
40 | - { |
|
41 | - $this->updateMruFlag = $bool; |
|
42 | - } |
|
39 | + public function __construct($bool) |
|
40 | + { |
|
41 | + $this->updateMruFlag = $bool; |
|
42 | + } |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | ?> |
@@ -28,80 +28,80 @@ |
||
28 | 28 | |
29 | 29 | class SforceCustomObject |
30 | 30 | { |
31 | - public function setDeploymentStatus($deploymentStatus) |
|
32 | - { |
|
33 | - $this->deploymentStatus = $deploymentStatus; |
|
34 | - } |
|
35 | - |
|
36 | - public function setDescription($description) |
|
37 | - { |
|
38 | - $this->description = $description; |
|
39 | - } |
|
40 | - |
|
41 | - public function setEnableActivities($enableActivities) |
|
42 | - { |
|
43 | - $this->enableActivities = $enableActivities; |
|
44 | - } |
|
45 | - |
|
46 | - public function setEnableDivisions($enableDivisions) |
|
47 | - { |
|
48 | - $this->enableDivisions = $enableDivisions; |
|
49 | - } |
|
50 | - |
|
51 | - public function setEnableHistory($enableHistory) |
|
52 | - { |
|
53 | - $this->enableHistory = $enableHistory; |
|
54 | - } |
|
55 | - |
|
56 | - public function setEnableReports($enableReports) |
|
57 | - { |
|
58 | - $this->enableReports = $enableReports; |
|
59 | - } |
|
60 | - |
|
61 | - public function setFields($fields) |
|
62 | - { |
|
63 | - $this->fields = $fields; |
|
64 | - } |
|
65 | - |
|
66 | - public function setFullName($fullName) |
|
67 | - { |
|
68 | - $this->fullName = $fullName; |
|
69 | - } |
|
70 | - |
|
71 | - public function setGender($gender) |
|
72 | - { |
|
73 | - $this->gender = $gender; |
|
74 | - } |
|
75 | - |
|
76 | - public function setHousehold($household) |
|
77 | - { |
|
78 | - $this->household = $household; |
|
79 | - } |
|
80 | - |
|
81 | - public function setLabel($label) |
|
82 | - { |
|
83 | - $this->label = $label; |
|
84 | - } |
|
85 | - |
|
86 | - public function setNameField($nameField) |
|
87 | - { |
|
88 | - $this->nameField = $nameField; |
|
89 | - } |
|
90 | - |
|
91 | - public function setPluralLabel($pluralLabel) |
|
92 | - { |
|
93 | - $this->pluralLabel = $pluralLabel; |
|
94 | - } |
|
95 | - |
|
96 | - public function setSharingModel($sharingModel) |
|
97 | - { |
|
98 | - $this->sharingModel = $sharingModel; |
|
99 | - } |
|
100 | - |
|
101 | - public function setStartsWith($startsWith) |
|
102 | - { |
|
103 | - $this->startsWith = $startsWith; |
|
104 | - } |
|
31 | + public function setDeploymentStatus($deploymentStatus) |
|
32 | + { |
|
33 | + $this->deploymentStatus = $deploymentStatus; |
|
34 | + } |
|
35 | + |
|
36 | + public function setDescription($description) |
|
37 | + { |
|
38 | + $this->description = $description; |
|
39 | + } |
|
40 | + |
|
41 | + public function setEnableActivities($enableActivities) |
|
42 | + { |
|
43 | + $this->enableActivities = $enableActivities; |
|
44 | + } |
|
45 | + |
|
46 | + public function setEnableDivisions($enableDivisions) |
|
47 | + { |
|
48 | + $this->enableDivisions = $enableDivisions; |
|
49 | + } |
|
50 | + |
|
51 | + public function setEnableHistory($enableHistory) |
|
52 | + { |
|
53 | + $this->enableHistory = $enableHistory; |
|
54 | + } |
|
55 | + |
|
56 | + public function setEnableReports($enableReports) |
|
57 | + { |
|
58 | + $this->enableReports = $enableReports; |
|
59 | + } |
|
60 | + |
|
61 | + public function setFields($fields) |
|
62 | + { |
|
63 | + $this->fields = $fields; |
|
64 | + } |
|
65 | + |
|
66 | + public function setFullName($fullName) |
|
67 | + { |
|
68 | + $this->fullName = $fullName; |
|
69 | + } |
|
70 | + |
|
71 | + public function setGender($gender) |
|
72 | + { |
|
73 | + $this->gender = $gender; |
|
74 | + } |
|
75 | + |
|
76 | + public function setHousehold($household) |
|
77 | + { |
|
78 | + $this->household = $household; |
|
79 | + } |
|
80 | + |
|
81 | + public function setLabel($label) |
|
82 | + { |
|
83 | + $this->label = $label; |
|
84 | + } |
|
85 | + |
|
86 | + public function setNameField($nameField) |
|
87 | + { |
|
88 | + $this->nameField = $nameField; |
|
89 | + } |
|
90 | + |
|
91 | + public function setPluralLabel($pluralLabel) |
|
92 | + { |
|
93 | + $this->pluralLabel = $pluralLabel; |
|
94 | + } |
|
95 | + |
|
96 | + public function setSharingModel($sharingModel) |
|
97 | + { |
|
98 | + $this->sharingModel = $sharingModel; |
|
99 | + } |
|
100 | + |
|
101 | + public function setStartsWith($startsWith) |
|
102 | + { |
|
103 | + $this->startsWith = $startsWith; |
|
104 | + } |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | ?> |