Получает список сайтов для почтового шаблона
@param $messageId
@return array
436017
public function getEventMessageSites($messageId) {
        $dbres = \CEventMessage::GetLang($messageId);
        return $this->fetchAll($dbres, false, 'LID');
    }
24843
public function getSubscriberEmails($listId)
    {
        $emails = [];
        $members = [];
        $offset=0;
        $maxresult = 200;
        $result = $this->mailchimp->get("lists/$listId/members", ['count'=> $maxresult]);

        if (!$this->mailchimp->success()) {
            $this->throwMailchimpError($this->mailchimp->getLastResponse());
        }

        $totalItems = $result['total_items'];
        $members = array_merge($members, $result['members']);

        while ($offset < $totalItems) {
            $offset+=$maxresult;
            $result = $this->mailchimp->get("lists/$listId/members", [
                        'count'         => $maxresult,
                        'offset'        => $offset
                    ]);

            if (!$this->mailchimp->success()) {
                $this->throwMailchimpError($this->mailchimp->getLastResponse());
            }
            $members = array_merge($members, $result['members']);
        };

        foreach ($members as $key => $member) {
            array_push($emails, $member['email_address']);
        }

        return $emails;
    }
1203865
public function actionItems($langId, $containerId)
    {
        $items = Nav::find()
            ->where(['nav_container_id' => $containerId, 'is_offline' => false, 'ni.lang_id' => $langId, 'is_deleted' => false])
            ->joinWith(['navItems ni'])
            ->asArray()
            ->all();
        $result = [];

        foreach ($items as $item) {
            // rename from navItems to item
            $item['item'] = reset($item['navItems']);
            unset($item['navItems']);
            $result[$item['parent_nav_id']][] = $item;
        }

        return $result;
    }
567130
public function getRaw($fileId = null)
    {
        // does nothing with the text
        $lamdaFunction = function($text){ 
            return [$text];
        };        
        return $this->getWords($fileId, new LambdaTokenizer($lamdaFunction));        
    }
623694
public function getEntityContent($messageId, $entityId)
    {
        return $this->diadocApi->getEntityContent($this->boxId, $messageId, $entityId);
    }
99869
protected function buildGetStatusPayload($messageId)
    {
        $xml = new \SimpleXMLElement(
            '<?xml version="1.0" encoding="ISO-8859-1"?>'.
            '<!DOCTYPE STATUSREQUEST SYSTEM "http://127.0.0.1:80/psms/dtd/requeststatusv12.dtd">'.
            '<STATUSREQUEST VER="1.2"></STATUSREQUEST>'
        );

        $user = $xml->addChild('USER');
        $user->addAttribute('USERNAME', $this->username);
        $user->addAttribute('PASSWORD', $this->password);

        $guid = $xml->addChild('GUID');
        $guid->addAttribute('GUID', $messageId);

        return $xml->asXml();
    }
726200
public function makeSeen($messageId)
    {
        $seen = $this->message->update($messageId, ['is_seen' => 1]);
        if ($seen) {
            return true;
        }

        return false;
    }
1319334
public function getList_emailByEmailIdAndListId($emailID, $listID) {
        return $this->model
            ->where('email_id', $emailID)
            ->where('list_id', $listID)
            ->first()
        ;
    }
740227
public function getList($listId)
    {
        foreach ($this->lists as $id => $listParameters) 
        {
            if($id == $listId)
            {
                return $this->createList($id, $listParameters);
            }
        }
    }
924008
public function markAsRead(int $messageId)
    {
        $this->sql = 'update message set is_read = \'Y\' where id = ?';
        $this->bindValues[] = $messageId;

        return $this->execute();
    }
1252004
public function findByPageIdAndByLanguageId($pageId, $languageId)
    {
        try {
            $this->initializeSearch($pageId, $languageId);
            $pageQuery = $this->queryBuilder->buildPageQuery($pageId);
            $response = $this->search->search($pageQuery, 0, 10000);
        } catch (NoSolrConnectionFoundException $exception) {
            return [];
        } catch (SolrCommunicationException $exception) {
            return [];
        }
        $data = $response->getParsedData();
        return $this->documentEscapeService->applyHtmlSpecialCharsOnAllFields($data->response->docs ?? []);
    }
612308
public function sendMessage($messageID) {
		// Check message, subject, and additional arguments to include
		list($subject, $message) = $this->generateMessageTemplate($messageID);
		if(empty($subject) || empty($message)) {
			$this->log("Skipping sending message. None configured for $messageID");
			return true;
		}

		// Save last sent message
		$this->LastMessageSent = $messageID;
		$this->write();

		// Setup messaging arguments
		$arguments = array_merge(
			$this->getConfigSetting('PipelineConfig', 'ServiceArguments') ?: array(),
			array('subject' => $subject)
		);

		// Send message to author
		if($author = $this->Author()) {
			$this->log("Pipeline sending $messageID message to {$author->Email}");
			$this->messagingService->sendMessage($this, $message, $author, $arguments);
		} else {
			$this->log("Skipping sending message to missing author");
		}

		// Get additional recipients
		$recipients = $this->getConfigSetting('PipelineConfig', 'Recipients', $messageID);
		if(empty($recipients)) {
			$this->log("Skipping sending message to empty recipients");
		} else {
			$recipientsStr = is_array($recipients) ? implode(',', $recipients) : $recipients;
			$this->log("Pipeline sending $messageID message to $recipientsStr");
			$this->messagingService->sendMessage($this, $message, $recipients, $arguments);
		}
	}
730089
public function getNumberLookup($messageId)
    {
        $numberLookup = $this->factory->createEmptyNumberLookup();
        $numberLookup->populate($messageId);

        return $numberLookup;
    }
270173
public function markPmUnread($messageId)
    {
        $this->debug('markPmUnread');
        $message = $this->messageManager->find($messageId);

        foreach ($message->getReceivers() as $reciver) {
            if ($reciver->getUser()->getId() == $this->userManager->getCurrentUser()->getId()) {
                $this->messageManager->unread($reciver);
            }
        }

        $result['result'] = new \Zend\XmlRpc\Value\Boolean(true);
        $response = $this->getResponse($result, 'struct');

        return $response;
    }
860306
public function getSmtpOptions($storeId)
    {
        return new SmtpOptions(
            [
                'host' => $this->getSmtpHost($storeId),
                'port' => $this->getSmtpPort($storeId),
                'connection_class' => 'login',
                'connection_config' =>
                [
                    'username' => $this->getSmtpUsername($storeId),
                    'password' => $this->getSmtpPassword($storeId),
                    'ssl' => 'tls'
                ]
            ]
        );
    }
33885
protected function pageResourceMapper($resourceId)
    {
        if (!$this->resourceName->isPagesResourceId($resourceId)) {
            return null;
        }

        $resources = explode('.', $resourceId);

        if (empty($resources[1])) {
            return null;
        }

        $siteResourceId = $this->resourceName->get(self::RESOURCE_SITES, $resources[1]);

        $return = [
            'resourceId' => $resourceId,
            'parentResourceId' => $siteResourceId,
        ];

        if ($this->resourceName->isPageResourceId($resourceId)) {
            $pagesResourceId = $this->resourceName->get(self::RESOURCE_SITES, $resources[1], self::RESOURCE_PAGES);
            $return['parentResourceId'] = $pagesResourceId;
        }

        return array_merge(
            $this->resources[self::RESOURCE_PAGES],
            $return
        );
    }
669977
public function getMessageInformation($id = '')
    {
        $message = [];
        if (is_array($this->messages) == true) {
            foreach($this ->messages as $msg) {
                if ($msg['index'] == $id) {
                    return $msg;
                }
            }
        }
        return $message;
    }