bigfoot / ecircle-bundle
Bigfoot ecircle bundle
v2.2.1
2014-11-20 10:49 UTC
Requires
- bigfoot/core-bundle: ~2.2.0
This package is auto-updated.
Last update: 2024-08-29 04:08:54 UTC
README
EcircleBundle 是 C2IS 创建的 BigFoot 框架的一部分。
安装
将 'bigfoot/ecircle-bundle' 添加到您的 composer.json 文件中的 'require' 部分
// composer.json "require": { ... ... "bigfoot/ecircle-bundle": "dev-master", }
更新您的项目
php composer.phar update
在配置文件中输入您的凭证
# app/config.yml ... ... parameters: bigfoot_ecircle: client: wsdl_url: 'http://webservices.ecircle-ag.com/soap/ecm.wsdl' request: account_1: realm: 'http://your-ecircle-url.com' user: 'User' passwd: 'Password'
在 Options 目录中创建一个类文件,文件名为 E-circle 方法名后跟 'Options'
// src/Bigfoot/Bundle/EcircleBundle/Options/SubscribeMemberByEmailOptions.php namespace Bigfoot\Bundle\EcircleBundle\Options; class subscribeMemberByEmailOptions { public $email; public $groupId; public $session; public $sendMessage = false; }
参数必须与 Ecircle 方法相同。
在服务 'bigfoot_ecircle.client' 中创建一个新的方法
// src/Bigfoot/Bundle/EcircleBundle/Services/BigfootEcircleClient.php public function subscribeMemberByEmail($email,$groupId) { if (!$this->sessionId) { throw new Exception('Client no connected'); } $subscribeMemberByEmailOptions = $this->options('SubscribeMemberByEmail'); $subscribeMemberByEmailOptions->email = $email; $subscribeMemberByEmailOptions->session = $this->sessionId; $subscribeMemberByEmailOptions->groupId = $groupId; $result = $this->client->subscribeMemberByEmail($subscribeMemberByEmailOptions); return $result; }
使用方法
在动作方法中
// Controller/DefaultController.php $client = $this->get('bigfoot_ecircle.client')->connect('account_1'); $retour = $client->subscribeMemberByEmail('example@email.com','99'); $client->disconnect();