GithubHelp home page GithubHelp logo

Comments (11)

ilanazbel avatar ilanazbel commented on July 27, 2024 1

I can confirm that this worked PERFECTLY!
THANK YOU SO MUCH!

from salesforce-rest-sdk.

curiosity26 avatar curiosity26 commented on July 27, 2024

Do you have the JMS Serializer installed? It should install with the SDK if you installed via composer require ae/salesforce-rest-sdk

from salesforce-rest-sdk.

ilanazbel avatar ilanazbel commented on July 27, 2024

from salesforce-rest-sdk.

curiosity26 avatar curiosity26 commented on July 27, 2024

Can you give code example to how you're instantiating it? I'm not able to reproduce this and am using it in a number of projects. The test suite is fully passing as well.

from salesforce-rest-sdk.

ilanazbel avatar ilanazbel commented on July 27, 2024

require "vendor/autoload.php";
use AE\SalesforceRestSdk\Rest\Client;
use AE\SalesforceRestSdk\AuthProvider\OAuthProvider;

$client = new Client(
new OAuthProvider( "xxxxxxxxxxxx",
"xxxxxxxxxxx",
"https://login.salesforce.com",
"xxxxxxxxxxx",
"xxxxxxxxx"
)
);

$sObjectClient = $client->getSObjectClient();

// Query for more stuff
$result = $sObjectClient->query("SELECT Id, Name FROM Account");

from salesforce-rest-sdk.

curiosity26 avatar curiosity26 commented on July 27, 2024

So the error you're getting doesn't make much sense. The model QueryResult doesn't annotate using@jms\Serializer\Annotation\Type, instead it uses @Serializer\Type where use JMS\Serializer\Annotation as Serializer; is the import.

It could be that you have a cached version or something? Not entirely sure there. Try removing the vendor folder and running composer install again. Also try grabbing the newest version, too.

I hope that helps, it's a really strange error you're getting. But it looks like everything is correct in your initialization.

from salesforce-rest-sdk.

ilanazbel avatar ilanazbel commented on July 27, 2024

I deleted the vendor folder, and ran composer install.
same problem.
frustrating.

from salesforce-rest-sdk.

curiosity26 avatar curiosity26 commented on July 27, 2024

Ok I'll try to replicate your exact steps on my end. Really strange. Thanks for your patience.

from salesforce-rest-sdk.

ilanazbel avatar ilanazbel commented on July 27, 2024

Not at all! I appreciate you looking at this.
I don't want to waste your time on this. Dare I ask if there is a different library you think I should try use?

from salesforce-rest-sdk.

curiosity26 avatar curiosity26 commented on July 27, 2024

Well there's this one: https://github.com/developerforce/Force.com-Toolkit-for-PHP
But SF isn't really supporting PHP these days. jsforce.com is absolutely amazing and is everything I aspire this sdk to be, but it's only for JS, which is where SF seems to be pushing their DeveloperForce stuff towards.

But I'll let you know what I find out and see if I can get a fix for you.
I've been using this with another project that works with Symfony and Doctrine, called AE Connect. (https://github.com/advisors-excel-llc/AEConnect).

Also, I don't think I asked, which version of Composer and PHP are you using?

from salesforce-rest-sdk.

curiosity26 avatar curiosity26 commented on July 27, 2024

@ilanazbel I have an answer for you! A solution even!

Per schmittjoh/serializer#855 (comment):

Since you're not using a framework that takes care of your annotation registry like Symfony does, you have to do it yourself.

Replace this:

<?php
require "vendor/autoload.php";

With this:

$loader = require 'vendor/autoload.php';
\Doctrine\Common\Annotations\AnnotationRegistry::registerLoader(array($loader, "loadClass"));

And it will work. Tested it myself using the code snippet you provided along with this change.
I hope this fixes any issues you may have. Feel free to share any feedback or comments or questions.

from salesforce-rest-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.