38 lines
1.2 KiB
PHP
38 lines
1.2 KiB
PHP
<?php
|
|
|
|
class CustomDevSliderSlide extends ObjectModel
|
|
{
|
|
public $id_customdevslider_slide;
|
|
|
|
public $image;
|
|
public $link;
|
|
public $position;
|
|
public $active;
|
|
|
|
public $title; // multilang
|
|
public $text; // multilang
|
|
|
|
public static $definition = [
|
|
'table' => 'customdevslider_slide',
|
|
'primary' => 'id_customdevslider_slide',
|
|
'multilang' => true,
|
|
'fields' => [
|
|
'image' => ['type' => self::TYPE_STRING, 'validate' => 'isFileName', 'size' => 255],
|
|
'link' => ['type' => self::TYPE_STRING, 'validate' => 'isUrlOrEmpty', 'size' => 255],
|
|
'position' => ['type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'],
|
|
'active' => ['type' => self::TYPE_BOOL, 'validate' => 'isBool'],
|
|
|
|
'title' => ['type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isCleanHtml', 'size' => 255],
|
|
'text' => ['type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml'],
|
|
],
|
|
];
|
|
|
|
public static function isUrlOrEmpty($url)
|
|
{
|
|
if ($url === null || $url === '') {
|
|
return true;
|
|
}
|
|
return Validate::isUrl($url);
|
|
}
|
|
}
|