From 119e30bc0715abcde517b55dcb872a77b569b24b Mon Sep 17 00:00:00 2001 From: Jefersson Nathan Date: Thu, 8 Dec 2022 13:27:34 +0100 Subject: [PATCH 1/5] Add section about known limitations Signed-off-by: Jefersson Nathan --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index f936df1..8426052 100644 --- a/README.md +++ b/README.md @@ -162,6 +162,23 @@ $conn->transactional(static function () use ($conn) { }); ``` +### 🚫 Known Limitations + +As of today, we cannot consume a `sObject` using the `queryBuilder` to get all fields from +the `sObject`. That is because Salesforce doesn't accept `SELECT *` as a valid query. + +The workaround that issue is to do a `GET` request to specific resources, then can grab all +data related to that resource. + +```php +$this->connection + ->getNativeConnection() + ->request( + 'GET', + sprintf('/services/data/v40.0/sobjects/Opportunity/%s', $id) + ); +``` + ### Contributors ✨ From 76a412ca8fc5bee69c9d92d00b196675271d9c1c Mon Sep 17 00:00:00 2001 From: Jefersson Nathan Date: Thu, 8 Dec 2022 13:30:10 +0100 Subject: [PATCH 2/5] Add section with diagram of how the queries are done Signed-off-by: Jefersson Nathan --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index 8426052..644c0aa 100644 --- a/README.md +++ b/README.md @@ -179,6 +179,34 @@ $this->connection ); ``` +### 📈 Diagram + +```mermaid +%%{init: {'sequence': { 'mirrorActors': false, 'rightAngles': true, 'messageAlign': 'center', 'actorFontSize': 20, 'actorFontWeight': 900, 'noteFontSize': 18, 'noteFontWeight': 600, 'messageFontSize': 20}}}%% +%%{init: {'theme': 'base', 'themeVariables': { 'actorBorder': '#D86613', 'activationBorderColor': '#232F3E', 'activationBkgColor': '#D86613','noteBorderColor': '#232F3E', 'signalColor': 'white', 'signalTextColor': 'gray', 'sequenceNumberColor': '#232F3E'}}}%% +sequenceDiagram + autonumber + Note left of ConnectionWrapper: Everything starts with
the ConnectionWrapper. + ConnectionWrapper->>QueryBuilder: createQueryBuilder() + activate QueryBuilder + alt + QueryBuilder->>QueryBuilder: execute()
Calls private executeQuery()
method + end + QueryBuilder->>+ConnectionWrapper: executeQuery() + deactivate QueryBuilder + ConnectionWrapper->>SoqlStatement: execute() + SoqlStatement->>+\Doctrine\DBAL\Driver\Result: execute() + ConnectionWrapper->>+\Codelicia\Soql\DBAL\Result: new + \Doctrine\DBAL\Driver\Result-->>\Codelicia\Soql\DBAL\Result: pass to + \Codelicia\Soql\DBAL\Result-->>-ConnectionWrapper: returns + ConnectionWrapper->>-SoqlStatement: fetchAll() + SoqlStatement->>+\Codelicia\Soql\FetchDataUtility: fetchAll() + \Codelicia\Soql\FetchDataUtility-->>+\GuzzleHttp\ClientInterface: send() + Note right of \Codelicia\Soql\FetchDataUtility: Countable goes here?
before creating the Payload? + \Codelicia\Soql\FetchDataUtility->>+\Codelicia\Soql\Payload: new + \Codelicia\Soql\Payload-->>+SoqlStatement: returns +``` + ### Contributors ✨ From 55dc932b99a2efd2eb1d1d44c9148ce5ff249bc8 Mon Sep 17 00:00:00 2001 From: Jefersson Nathan Date: Thu, 8 Dec 2022 13:30:52 +0100 Subject: [PATCH 3/5] Remove contributors section Signed-off-by: Jefersson Nathan --- README.md | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/README.md b/README.md index 644c0aa..e0eff92 100644 --- a/README.md +++ b/README.md @@ -207,35 +207,6 @@ sequenceDiagram \Codelicia\Soql\Payload-->>+SoqlStatement: returns ``` -### Contributors ✨ - - -[![All Contributors](https://img.shields.io/badge/all_contributors-6-orange.svg?style=flat-square)](#contributors-) - - -Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): - - - - - - - - - - - - - -

Jefersson Nathan

💻 🚧

Alexandre Eher

💻

Airton Zanon

👀

Winfred Peereboom

🐛

Emmerson Siqueira

👀

echevalaz

🐛 🤔
- - - - - - -This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! - ### Author - Jefersson Nathan ([@malukenho](http://github.com/malukenho)) From 2871c05135c4919a576b8246be78dfebfdd0a1ac Mon Sep 17 00:00:00 2001 From: Jefersson Nathan Date: Tue, 17 Jan 2023 10:59:20 +0100 Subject: [PATCH 4/5] docs: improve documentation example I've added the object type near the method call, and made sure the example cover the data retrieval part. So, users can see how they can actually get access to the final data they want to. Signed-off-by: Jefersson Nathan --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e0eff92..cb1d3ad 100644 --- a/README.md +++ b/README.md @@ -172,11 +172,14 @@ data related to that resource. ```php $this->connection - ->getNativeConnection() + ->getNativeConnection() // : \GuzzleHttp\ClientInterface ->request( 'GET', sprintf('/services/data/v40.0/sobjects/Opportunity/%s', $id) - ); + ) + ->getBody() + ->getContents() +; ``` ### 📈 Diagram From 771ce9dbed0b2052dc4e06b75f7da91140d36966 Mon Sep 17 00:00:00 2001 From: Jefersson Nathan Date: Tue, 17 Jan 2023 11:00:33 +0100 Subject: [PATCH 5/5] chore: remove dependabot.yml config We already have renovate-bot in place. Signed-off-by: Jefersson Nathan --- .github/dependabot.yml | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 06a7719..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,11 +0,0 @@ -version: 2 -updates: -- package-ecosystem: composer - directory: "/" - schedule: - interval: daily - open-pull-requests-limit: 10 - ignore: - - dependency-name: phpunit/phpunit - versions: - - ">= 9.a, < 10"