method public static

CurrencyLangTable::enableCrypto()

Класс: \Bitrix\Currency\CurrencyLangTable

Сигнатура

public static enableCrypto(string $field[, string $table = null ][, bool $mode = true ]) : mixed

Описание

Устанавливает флаг, указывающий на поддержку шифрования для поля.

Параметры

$field string
$table string = null
$mode bool = true

Возвращаемое значение

mixed

Как применяется в CurrencyLangTable

CurrencyLangTable::enableCrypto() — метод класса \Bitrix\Currency\CurrencyLangTable модуля «Валюты». Это ORM-сущность D7 (наследник DataManager): строки читаются как объекты EO_CurrencyLang, наборы — как EO_CurrencyLang_Collection. Метод достаётся CurrencyLangTable от DataManager::enableCrypto: поведение общее для всех сущностей, а данные, поля и классы — свои.

Шифрование значений полей CurrencyLangTable в БД: enableCrypto() включает его для поля, cryptoEnabled() проверяет. Нужен настроенный ключ шифрования в .settings.php.

use Bitrix\Main\Loader;
use Bitrix\Currency\CurrencyLangTable;

Loader::includeModule('currency');

if (!CurrencyLangTable::cryptoEnabled('NAME')) {
    CurrencyLangTable::enableCrypto('NAME');
}

Собственные методы CurrencyLangTable

enableCrypto() есть и у других классов модуля «Валюты»: CurrencyRateTable, CurrencyTable.

Исходный файл: source/currency/lib/currencylang.php:1926

Что будем искать? Например,Продвижение