- Модуль: mobileapp
- Путь к файлу: ~/bitrix/modules/mobileapp/lib/designer/config.php
- Класс: BitrixMobileAppDesignerConfigTable
- Вызов: ConfigTable::checkFields
static function checkFields(Result $result, $primary, array $data)
{
parent::checkFields($result, $primary, $data);
$availablePlatforms = self::getSupportedPlatforms();
if( $result instanceof EntityAddResult)
{
$entity = self::getEntity();
if(!$data["APP_CODE"])
{
$result->addError(new EntityFieldError($entity->getField("APP_CODE"),"Can not be empty!", 1));
}
else if (!$data["PLATFORM"])
{
$result->addError(new EntityFieldError($entity->getField("PLATFORM"), "Can not be empty!", 1));
}
elseif(!in_array($data["PLATFORM"], $availablePlatforms))
{
$result->addError(new EntityFieldError($entity->getField("PLATFORM"), "The passed value in not available!", 1));
}
$selectResult = self::getList(array(
"filter"=>array(
"APP_CODE"=>$data["APP_CODE"],
"PLATFORM"=>$data["PLATFORM"]
)
));
if($selectResult->getSelectedRowsCount() > 0)
{
$result->addError(new EntityEntityError("Such configuration is already exists!", 1000));
}
}
}