Exemplo n.º 1
0
 public function setMailingLists(array $datas)
 {
     foreach ($datas as $key => $value) {
         $mailingList = new MailingList();
         $this->mailing_lists[] = $mailingList->fromArray($value);
     }
     return $this;
 }
 public function testGetMailingListContactsReturnsCorrectData()
 {
     $mailingList = new MailingList();
     $mailingList->setId(1);
     $this->setMockResponse($this->client, array('mailing-lists/listMailingListContacts'));
     $contacts = $this->client->getMailingListContacts($mailingList);
     $this->assertInstanceOf('\\Mgrt\\Model\\ResultCollection', $contacts);
     $this->assertEquals($contacts->count(), 2);
     foreach ($contacts as $contact) {
         $this->assertInstanceOf('\\Mgrt\\Model\\Contact', $contact);
     }
 }
Exemplo n.º 3
0
 public function addMailingLists(array $datas)
 {
     foreach ($datas as $key => $value) {
         if ($value instanceof MailingList) {
             $this->mailing_lists[$value->getId()] = $value;
         } else {
             $mailingList = new MailingList();
             $mailingList->fromArray($value);
             $this->mailing_lists[$mailingList->getId()] = $mailingList;
         }
     }
     return $this;
 }
Exemplo n.º 4
0
 public function getMailingListContacts(MailingList $mailingList, $parameters = array())
 {
     $parameters['mailingListId'] = $mailingList->getId();
     $command = $this->getCommand('ListMailingListContacts', $parameters);
     return $this->execute($command);
 }