@param MailingList $list

@throws Exception

API documentation: https://whatcounts.zendesk.com/hc/en-us/articles/203969409
543666
public function exCreateList(MailingList &$list)
		{
			$form_data = array(
				'list_name'    => $list->getListName(),
				'description'  => $list->getDescription(),
				'template_id'  => $list->getTemplate(),
				'from'         => $list->getFromAddress(),
				'reply_to'     => $list->getReplyToAddress(),
				'errors_to'    => $list->getBounceAddress(),
				'track_clicks' => $list->isTrackClicks(),
				'track_opens'  => $list->isTrackOpens(),
				'folder_id'    => $list->getFolderId()
			);
			$data = $this->call('excreatelist', $form_data);

			$list->setListId(trim($data[1]));
		}
808213
protected function actionListAddress()
    {
        list($selected, $action) = $this->getPostedAction();

        $deleted = 0;

        foreach ($selected as $id) {
            if ($action === 'delete' && $this->access('address_delete')) {
                $deleted += (int) $this->address->delete($id);
            }
        }

        if ($deleted > 0) {
            $message = $this->text('Deleted %num item(s)', array('%num' => $deleted));
            $this->setMessage($message, 'success');
        }
    }
925436
protected void sendMembershipList(LocalGossipMember me, List<LocalGossipMember> memberList) {
    GossipService.LOGGER.debug("Send sendMembershipList() is called.");
    me.setHeartbeat(System.currentTimeMillis());
    LocalGossipMember member = selectPartner(memberList);
    if (member == null) {
      return;
    }
    try (DatagramSocket socket = new DatagramSocket()) {
      socket.setSoTimeout(gossipManager.getSettings().getGossipInterval());
      InetAddress dest = InetAddress.getByName(member.getHost());
      ActiveGossipMessage message = new ActiveGossipMessage();
      message.getMembers().add(convert(me));
      for (LocalGossipMember other : memberList) {
        message.getMembers().add(convert(other));
      }
      byte[] json_bytes = om.writeValueAsString(message).getBytes();
      int packet_length = json_bytes.length;
      if (packet_length < GossipManager.MAX_PACKET_SIZE) {
        byte[] buf = createBuffer(packet_length, json_bytes);
        DatagramPacket datagramPacket = new DatagramPacket(buf, buf.length, dest, member.getPort());
        socket.send(datagramPacket);
      } else {
        GossipService.LOGGER.error("The length of the to be send message is too large ("
                + packet_length + " > " + GossipManager.MAX_PACKET_SIZE + ").");
      }
    } catch (IOException e1) {
      GossipService.LOGGER.warn(e1);
    }
  }
92840
static function cleanupList( $productCollectionIDList )
    {
        $db = eZDB::instance();
        $db->begin();

        // Purge shipping information associated with product collections being removed.
        foreach ( $productCollectionIDList as $productCollectionID )
            eZShippingManager::purgeShippingInfo( $productCollectionID );

        eZProductCollectionItem::cleanupList( $productCollectionIDList );
        $where = $db->generateSQLINStatement( $productCollectionIDList, 'id', false, false, 'int' );
        $db->query( "DELETE FROM ezproductcollection WHERE {$where}" );
        $db->commit();
    }
521272
public function updateList(DataList &$list)
    {
        if ($this->isVersioned()) {
            
            if ($filter = $this->getFilter($list)) {
                $list = $filter->apply();
            }
            
        }
    }
278162
public function verifyListIsEmpty(): void
    {
        $firstRowValue = $this->adminLists['Content items']->table->getCellValue(1, 1);

        if (
        !($this->adminLists['Content items']->table->getItemCount() === 1 &&
            strpos($firstRowValue, 'No content items.') !== false)
        ) {
            throw new \Exception('"Content items" list is not empty.');
        }
    }
1350610
def post_user_contact_list(self, id, contact_list_id, **data):
        
        
        return self.post("/users/{0}/contact_lists/{0}/".format(id,contact_list_id), data=data)
3573
protected function prepareListProduct(array &$list)
    {
        foreach ($list as &$item) {
            $this->setItemPriceFormatted($item, $this->price);
            $this->setItemUrlEntity($item, $this->store, 'product');
        }
    }
141903
public function uploadManyContactsList(ContactsList $contactsList)
    {
        $batchResults = [];
        // we send multiple smaller requests instead of a bigger one
        $contactChunks = array_chunk($contactsList->getContacts(), self::CONTACT_BATCH_SIZE);
        foreach ($contactChunks as $contactChunk) {
            // create a sub-contactList to divide large request
            $subContactsList = new ContactsList($contactsList->getListId(), $contactsList->getAction(), $contactChunk);
            $currentBatch = $this->mailjet->post(Resources::$ContactslistManagemanycontacts,
                ['id' => $subContactsList->getListId(), 'body' => $subContactsList->format()]
            );
            if ($currentBatch->success()) {
                array_push($batchResults, $currentBatch->getData()[0]);
            } else {
                $this->throwError("ContactsListService:manageManyContactsList() failed", $currentBatch);
            }
        }
        return $batchResults;
    }
788672
public function findInListByEmail(MailingList $list, $email)
    {
        return $this->createQueryBuilder('s')
            ->innerjoin('s.mailingList', 'm')
            ->andWhere('m.id = :list_id')
            ->andWhere('s.email = :email')
            ->setParameters([
                'list_id'   => $list->getId(),
                'email'     => $email,
            ])
            ->getQuery()
            ->getOneOrNullResult();
    }
1154199
public function updateNotificationRecipients(&$list, &$comment)
    {
        //default is notification is on regardless of spam status
        $list = $this->owner->Authors();

        // If comment is spam and notification are set to not send on spam clear the recipient list
        if (Config::inst()->get(__CLASS__, 'notification_on_spam') == false && $comment->IsSpam) {
            $list = [];
        }
    }
562215
public void mailingList_subscribe_POST(String email, String mailingList) throws IOException {
		String qPath = "/me/mailingList/subscribe";
		StringBuilder sb = path(qPath);
		HashMap<String, Object>o = new HashMap<String, Object>();
		addBody(o, "email", email);
		addBody(o, "mailingList", mailingList);
		exec(qPath, "POST", sb.toString(), o);
	}
1111397
public function insertList(ItemList $list)
    {
        $this->writer->insertAll($this->projectList($list));

        return $this;
    }
735360
protected function prepareListOrderAccount(array &$list)
    {
        foreach ($list as &$item) {
            $this->setItemTotalFormatted($item, $this->price);
            $this->setItemOrderAddress($item, $this->address);
            $this->setItemOrderStoreName($item, $this->store);
            $this->setItemOrderStatusName($item, $this->order);
            $this->setItemOrderPaymentName($item, $this->payment);
            $this->setItemOrderShippingName($item, $this->shipping);
        }
    }
246317
private static function getBodyOfFirstElementOfList($list)
    {
        $firstElementKey = array_keys($list)[0];
        $firstElement = self::getBodyOfListElement($list[$firstElementKey]);

        return $firstElement;
    }
1178346
protected function projectList(ItemList $list)
    {
        $sth = $list->deliverQueryObject()->execute();

        foreach ($sth as $row) {
            $listResult = $list->getResult($row);
            $object = $this->getObjectFromListResult($list, $listResult);
            yield iterator_to_array($this->projectObject($object));
            $this->tick();
        }
    }
37009
public function fromArray( array $list )
	{
		$unknown = array();
		$list = parent::fromArray( $list );

		foreach( $list as $key => $value )
		{
			switch( $key )
			{
				case $this->_prefix . 'salutation': $this->setSalutation( $value ); break;
				case $this->_prefix . 'company': $this->setCompany( $value ); break;
				case $this->_prefix . 'vatid': $this->setVatID( $value ); break;
				case $this->_prefix . 'title': $this->setTitle( $value ); break;
				case $this->_prefix . 'firstname': $this->setFirstname( $value ); break;
				case $this->_prefix . 'lastname': $this->setLastname( $value ); break;
				case $this->_prefix . 'address1': $this->setAddress1( $value ); break;
				case $this->_prefix . 'address2': $this->setAddress2( $value ); break;
				case $this->_prefix . 'address3': $this->setAddress3( $value ); break;
				case $this->_prefix . 'postal': $this->setPostal( $value ); break;
				case $this->_prefix . 'city': $this->setCity( $value ); break;
				case $this->_prefix . 'state': $this->setState( $value ); break;
				case $this->_prefix . 'countryid': $this->setCountryId( $value ); break;
				case $this->_prefix . 'languageid': $this->setLanguageId( $value ); break;
				case $this->_prefix . 'telephone': $this->setTelephone( $value ); break;
				case $this->_prefix . 'telefax': $this->setTelefax( $value ); break;
				case $this->_prefix . 'email': $this->setEmail( $value ); break;
				case $this->_prefix . 'website': $this->setWebsite( $value ); break;
				case $this->_prefix . 'flag': $this->setFlag( $value ); break;
				default: $unknown[$key] = $value;
			}
		}

		return $unknown;
	}