public function __construct($reply)
 {
     parent::__construct($reply);
     $this->image_url = $this->clientdata->get_value('/promote/afs:images/afs:image/afs:imageUrl', array('afs' => 'http://ref.antidot.net/7.3/bo.xsd'));
     $this->url = $this->clientdata->get_value('/promote/afs:images/afs:image/afs:url', array('afs' => 'http://ref.antidot.net/7.3/bo.xsd'));
 }
Ejemplo n.º 2
0
 public function testPromoteRetrieveCustomDataAsArray()
 {
     $reply = json_decode('{
                 "docId": 1,
                 "uri": "http://www.wanimo.com/marques/tresor",
                 "title": [
                     {
                         "afs:t": "KwicString",
                         "text": "Foo"
                     }
                 ],
                 "abstract": [
                     {
                         "afs:t": "KwicString",
                         "text": "Bar"
                     }
                 ],
                 "relevance": {
                     "rank": 1
                 },
                 "clientData": [
                     {
                         "contents": "<afs:customData xmlns:afs=\\"http://ref.antidot.net/7.3/bo.xsd\\"><afs:banniere>BAN1</afs:banniere><afs:foo>FOO</afs:foo></afs:customData>",
                         "id": "main",
                         "mimeType": "text/xml"
                     }
                 ]
             }');
     $helper = new AfsPromoteReplyHelper($reply);
     $this->assertEquals(array('banniere' => 'BAN1', 'foo' => 'FOO'), $helper->get_custom_data());
 }