php - Adwords API ReportDefinitionService : ReportDefinition not found

标签 php namespaces yii2 google-ads-api classnotfound

如果我做 :

$user->GetService('ManagedCustomerService');
$customer = new \ManagedCustomer();

这有效,但如果我这样做:
$user->LoadService('ReportDefinitionService');
$report = new \ReportDefinition();

我收到一个错误:找不到“ReportDefinition”类。
(我写在 Yii2 上,使用 api v201607)

我做错了什么?

============ 修复 ================

我通过添加临时使它工作:
require_once dirname(dirname(dirname(__FILE__))) . '/vendor/googleads/googleads-php-lib/examples/AdWords/v201607/init.php';
require_once ADWORDS_UTIL_VERSION_PATH . '/ReportUtils.php';

最佳答案

您不能使用 ReportDefinitionService 创建报告自 API 版本 v201109 .使用 ad-hoc reports反而。

关于php - Adwords API ReportDefinitionService : ReportDefinition not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38827205/

相关文章:

python - 为什么我不能修改作为函数内部参数传递的列表?

php, mysql, "else after while 语句

php - 检查字符串是否以图像扩展名结尾

php - 无效的链接: Cannot load presenter 'Post' , class 'App\Presenters\PostPresenter' was not found

c++ - 'drv' 没有命名类型

c++ - 在 Visual Studio 2010 C++ 中包含命名空间

php - 外键一对多(postgresql、php、yii2)

reflection - 在 config/main.php 中找不到 Yii2 模块(不在/vendor 文件夹下)类

php - 如何更改验证码文本的颜色?

php - 移除 Laravel 的 redis