diff --git a/composer.json b/composer.json index f6057a9..9a7c880 100644 --- a/composer.json +++ b/composer.json @@ -18,6 +18,7 @@ "php": ">=8.0", "doctrine/cache": "^1.11", "doctrine/common": "^3.1.0", + "friendsofphp/proxy-manager-lts": "^1.0", "php-arsenal/salesforce-bundle": "^4.0", "sensio/framework-extra-bundle": "^6.1.0", "symfony/dependency-injection": "^5.2", diff --git a/src/Mapper.php b/src/Mapper.php index 737efeb..6cb920d 100644 --- a/src/Mapper.php +++ b/src/Mapper.php @@ -14,6 +14,7 @@ use PhpArsenal\SalesforceMapperBundle\Response\MappedRecordIterator; use PhpArsenal\SoapClient\ClientInterface; use PhpArsenal\SoapClient\Result; +use ProxyManager\Configuration; use ReflectionClass; use ReflectionObject; use stdClass; @@ -404,7 +405,7 @@ public function mapToSalesforceObject($model) /** @var Result\DescribeSObjectResult $objectDescription */ $objectDescription = $this->getObjectDescription($model); - $reflClass = new ReflectionClass($model); + $reflClass = new ReflectionClass((new Configuration())->getClassNameInflector()->getUserClassName($model)); $mappedProperties = $this->annotationReader->getSalesforceFields($model); $mappedRelations = $this->annotationReader->getSalesforceRelations($model); $allMappings = $mappedProperties->toArray() + $mappedRelations;