HubSpot Ideas

quentin_lamamy

[PHP SDK] Method namming issue

Hi guys here is a point to change on your next update

 

Issue :

For the custom object search

 

HubSpot\Client\Crm\Objects\Api\SearchApi

 

 The method to run a search is called "search()" But for others object from the CRM namespace the function is called doSearch. It's actually an issue because it's not good to have different syntax for the same action in different object and it's a BIG issue for people like writing a beautiful code where we don't need to specifiy which class to use of whatever specific to the object you want to import. All class instantiation are based on a programticly generated class name according to the data scheme i want to import

 

$result = $hubspot->{strtolower($schema->sdk->namespace)}()->{strtolower($schema->sdk->object)}()->searchApi()->doSearch($searchRequest);

 

but for custom object it **bleep** because of the method name.

 

Expected behaviour

 

HubSpot\Client\Crm\Objects\Api\SearchApi::doSearch()

 

 Change the method name or add an alias to keepcode from people using search() method functionnal.

 

Reason

  • There is a lack of documentation, developper must use their intuition to code with the sdk, have different name for the same action don't make sens and it's not intuitive.
  • It's a brake on abstract code development

 

hsSign_smaller.png

0 Upvotes