[PHP] How to convert response getKeyword()->getMatchType() from INT to STRING REPRESENTATION

25 views
Skip to first unread message

Евгений Гардыш

unread,
Dec 5, 2018, 6:04:44 PM12/5/18
to AdWords API and Google Ads API Forum
Hi.

Trying to use PHP lib google-ads-php. 
I`m making call 
getAdGroupCriterion()->getKeyword()->getMatchType()

and get results as int. For example: 2 .

I found a class Google\Ads\GoogleAds\V0\Enums\KeywordMatchTypeEnum\KeywordMatchType with defined constants which are representing int answer.

But how to get that constants names by their value? 

For example calling of KeywordMatchType::EXACT will return me int(2) . How to get call with int(2) to get 'EXACT' as a result?

Luis Xander Talag (AdWords API Team)

unread,
Dec 6, 2018, 1:38:44 AM12/6/18
to AdWords API and Google Ads API Forum
Hi,

It seems your concern was more on the implementation of Google Ads API Beta in PHP client library. I would suggest to post your issue on this link as the PHP client library owners are better equipped to assist you here.

Thanks and regards,
Luis
AdWords API Team
Reply all
Reply to author
Forward
0 new messages