Нужно реализовать проверку у email нахождение в списках подписок.
В стандартном классе есть такое метод
| Код |
|---|
class ContactListTable extends Entity\DataManager
{
...
public static function addIfNotExist($contactId, $listId)
{
$result = false;
$arPrimary = array('CONTACT_ID' => $contactId, 'LIST_ID' => $listId);
if( !($arList = static::getRowById($arPrimary) ))
{
$resultAdd = static::add($arPrimary);
if ($resultAdd->isSuccess())
{
$result = true;
}
}
else
{
$result = true;
}
return $result;
}
}
|
Мне нужно реализовать проверку
Мой код
| Код |
|---|
class AddAndCheckMailingList extends Sender\ContactListTable {
public static function checkEmailInMailingList($contactId, $mailingList)
{
$arrLists = explode(',', $mailingList);
//$result = true;
foreach ($arrLists as $listId)
{
$arPrimary = array('CONTACT_ID' => $contactId, 'LIST_ID' => $listId);
$arList = static::getRowById($arPrimary);
return $arList;
}
}
}
|
Но появляется ошибка:Fatal error: Class '\AddAndCheckMailingListTable' not found in C:\Bitrix\www\bitrix\modules\main\lib\orm\entity.php on line 217
Ошибка в данной строке
| Код |
|---|
$this->connectionName = $className::getConnectionName(); |