Example #1
0
 public static function fields($data = array())
 {
     if (empty($data)) {
         return static::$fields;
     } else {
         return static::$fields = $data;
     }
 }
 /**
  * @inheritdoc
  */
 protected function setUp()
 {
     static::$Redis->flushall();
     static::$fields = ['string' => 'value', 'integer' => 42, 'true' => true, 'false' => false, 'float' => 3.14159265, 'e' => '5.0e3', 'null' => null, '' => 'empty', 'empty' => '', 'bin' => call_user_func_array('pack', ['N*'] + range(0, 255))];
     static::$Redis->hmset('hash', static::$fields);
     static::$Redis->hmset('', static::$fields);
     static::$Redis->set('string', 'value');
 }
Example #3
0
 public function __construct()
 {
     require_once __DIR__ . '/rb.php';
     if (!static::$tableName) {
         throw new \Exception('未定义表名');
     }
     static::$tableName = $this->fixTableName();
     static::$fields = $this->fixFields();
     static::$many2one = $this->fixMany2One();
 }
Example #4
0
 /**
  * Get class instance
  * @param $neededFields array of fields to set as settings
  * @param $neededDepth int depth to set as settings
  */
 public static function getInstance($neededFields = null, $neededDepth = null)
 {
     if (is_null(self::$instance)) {
         $childclass = get_called_class();
         self::$instance = new $childclass();
     }
     // Set fields if user ask for it
     if (!is_null($neededFields)) {
         static::$fields = isset(static::${$neededFields}) ? static::${$neededFields} : [];
     }
     // Set depth if user ask for it
     if (!is_null($neededDepth)) {
         static::$depth = $neededDepth;
     }
     return self::$instance;
 }
 /**
  * Get class instance
  * $instances is an array which contains each instanced child class
  * @param $neededFields array of fields to set as settings
  * @param $neededDepth int depth to set as settings
  */
 public static function getInstance($neededFields = null, $neededDepth = null)
 {
     $childClass = get_called_class();
     if (!isset(self::$instances[$childClass])) {
         self::$instances[$childClass] = new $childClass();
     }
     // Set field if user ask for it
     if (!is_null($neededFields)) {
         if (is_string($neededFields)) {
             static::$fields = isset(static::${$neededFields}) ? static::${$neededFields} : [];
         } else {
             if (is_array($neededFields)) {
                 static::$fields = $neededFields;
             }
         }
     }
     // Set depth if user ask for it
     if (!is_null($neededDepth)) {
         static::$depth = $neededDepth;
     }
     return self::$instances[$childClass];
 }
Example #6
0
 function __construct($fields = [])
 {
     static::$fields = [['content', 'Содержание', 0, 'string', 'widget' => ['cs\\Widget\\HtmlContent\\HtmlContent', []]], ['subject', 'Тема письма', 1, 'string']];
     parent::__construct($fields);
 }
Example #7
0
 function __construct($fields = [])
 {
     static::$fields = [['content', 'Название', 1, 'string']];
     parent::__construct($fields);
 }
Example #8
0
 public function jsonSerialize()
 {
     if (!static::$fields) {
         static::$fields = new Map();
     }
     return static::$fields->jsonSerialize();
 }
Example #9
0
 function __construct($fields = [])
 {
     static::$fields = [['name_first', 'Имя', 0, 'string'], ['name_last', 'Фамилия', 0, 'string'], ['name_middle', 'Отчество', 0, 'string'], ['content', 'Описание', 0, 'string', 'widget' => ['cs\\Widget\\HtmlContent\\HtmlContent', []]], ['description', 'Описание краткое', 0, 'string'], ['image', 'Картинка', 0, 'string', 'widget' => [FileUpload::className(), ['options' => ['small' => \app\services\GsssHtml::$formatIcon]]]], ['date_born', 'Дата прихода', 0, 'cs\\Widget\\DatePicker\\Validator', 'widget' => ['cs\\Widget\\DatePicker\\DatePicker', []]], ['date_death', 'Дата ухода', 0, 'cs\\Widget\\DatePicker\\Validator', 'widget' => ['cs\\Widget\\DatePicker\\DatePicker', []]]];
     parent::__construct($fields);
 }
Example #10
0
 function __construct($fields = [])
 {
     static::$fields = [['header', 'Название', 1, 'string'], ['description', 'Описание краткое', 0, 'string'], ['content', 'Полное описание', 0, 'string', 'widget' => ['cs\\Widget\\HtmlContent\\HtmlContent', []]], ['parent_id', 'Родительская ветка', 0, 'integer'], ['image', 'Картинка', 0, 'string', 'widget' => [FileUpload::className(), ['options' => ['small' => \app\services\GsssHtml::$formatIcon]]]]];
     parent::__construct($fields);
 }
 function __construct($fields = [])
 {
     static::$fields = [['content', 'Содержание', 0, 'string'], ['subject', 'Тема письма', 1, 'string']];
     parent::__construct($fields);
 }
 /**
  * Setter for the model's fields array
  *
  * @param array $fields
  */
 public function setFields($fields)
 {
     static::$fields = $fields;
     return $this;
 }
Example #13
0
 function __construct($fields = [])
 {
     static::$fields = [['isRed', 'Есть красный', 0, 'cs\\Widget\\CheckBox2\\Validator', 'widget' => ['cs\\Widget\\CheckBox2\\CheckBox', []]], ['isBlue', 'Есть синий', 0, 'cs\\Widget\\CheckBox2\\Validator', 'widget' => ['cs\\Widget\\CheckBox2\\CheckBox', []]], ['isGreen', 'Есть курс', 0, 'cs\\Widget\\CheckBox2\\Validator', 'widget' => ['cs\\Widget\\CheckBox2\\CheckBox', []]]];
     parent::__construct($fields);
 }
Example #14
0
 function __construct($fields = [])
 {
     static::$fields = [['monthCounter', 'Количество месяцев', 1, 'integer'], ['stockId', 'Котировка', 0, 'string'], ['finam_em', 'Идентификатор котировки', 0, 'integer']];
     parent::__construct($fields);
 }
Example #15
0
 function __construct($fields = [])
 {
     static::$fields = [['name', 'Название', 1, 'string'], ['content', 'Описание', 0, 'string', 'widget' => ['cs\\Widget\\HtmlContent\\HtmlContent', []]], ['description', 'Описание краткое', 0, 'string'], ['tickets_counter', 'Кол-во билетов в продукте', 0, 'integer'], ['price', 'Цена', 0, 'integer'], ['image', 'Картинка', 0, 'string', 'widget' => [FileUpload::className(), ['options' => ['small' => \app\services\GsssHtml::$formatIcon]]]]];
     parent::__construct($fields);
 }
Example #16
0
 function __construct($fields = [])
 {
     static::$fields = [['title', 'Название', 1, 'string'], ['file', 'Файл', 1, 'default', 'widget' => [FileUpload::className(), ['options' => ['small' => [200, 200, \cs\Widget\FileUpload2\FileUpload::MODE_THUMBNAIL_CUT]]]]]];
     parent::__construct($fields);
 }
Example #17
0
 function __construct($fields = [])
 {
     static::$fields = [['html', 'HTML', 0, 'string'], ['img1', 'Картинка 1', 0, 'string', [], '1900x1080 JPG', 'widget' => [FileUpload::className(), ['options' => ['small' => [200, 200]]]]], ['img2', 'Картинка 2', 0, 'string', [], '1900x1080 JPG', 'widget' => [FileUpload::className(), ['options' => ['small' => [200, 200]]]]], ['img3', 'Картинка 3', 0, 'string', [], '1900x1080 JPG', 'widget' => [FileUpload::className(), ['options' => ['small' => [200, 200]]]]]];
     parent::__construct($fields);
 }
Example #18
0
 function __construct($fields = [])
 {
     static::$fields = [['name_first', 'Имя', 1, 'string'], ['name_last', 'Фамилия', 0, 'string'], ['avatar', 'Картинка', 0, 'string', 'widget' => [FileUpload::className(), ['options' => ['small' => \app\services\GsssHtml::$formatIcon]]]]];
     parent::__construct($fields);
 }
Example #19
0
 function __construct($fields = [])
 {
     static::$fields = [['data', 'Происхождение', 1, 'string']];
     parent::__construct($fields);
 }
Example #20
0
 function __construct($fields = [])
 {
     static::$fields = [['name', 'Название', 1, 'string'], ['start_date', 'Старт. Дата', 1, 'widget' => ['cs\\Widget\\DatePicker\\DatePicker', ['dateFormat' => 'php:d.m.Y']]], ['start_time', 'Старт. Время', 0, 'string', [], 'формат чч:мм'], ['end_date', 'Старт. J', 1, 'widget' => ['cs\\Widget\\DatePicker\\DatePicker', ['dateFormat' => 'php:d.m.Y']]], ['end_time', 'Старт. Окончание', 0, 'string', [], 'формат чч:мм'], ['content', 'Описание', 0, 'string', 'widget' => ['cs\\Widget\\HtmlContent\\HtmlContent', []]], ['link', 'Ссылка', 0, 'url'], ['date', 'Дата', 1, 'string'], ['image', 'Картинка', 0, 'string', 'widget' => [FileUpload::className(), ['options' => ['small' => \app\services\GsssHtml::$formatIcon]]]]];
     parent::__construct($fields);
 }
Example #21
0
 function __construct($fields = [])
 {
     static::$fields = [['target', 'Назачение', 0, 'string', 'widget' => ['cs\\Widget\\HtmlContent\\HtmlContent', []]], ['present', 'Подарок', 0, 'string', 'widget' => ['cs\\Widget\\HtmlContent\\HtmlContent', []]], ['price', 'Цена, тыс руб', 0, 'integer'], ['bill', 'Счет перечисления', 0, 'string', 'widget' => ['cs\\Widget\\HtmlContent\\HtmlContent', []]]];
     parent::__construct($fields);
 }
Example #22
0
 function __construct($fields = [])
 {
     static::$fields = [['header', 'Название', 1, 'string'], ['source', 'Ссылка', 0, 'url'], ['content', 'Описание', 0, 'string', 'widget' => ['cs\\Widget\\HtmlContent\\HtmlContent', []]], ['description', 'Описание краткое', 0, 'string'], ['image', 'Картинка', 0, 'string', 'widget' => [FileUpload::className(), ['options' => ['small' => \app\services\GsssHtml::$formatIcon]]]], ['tree_node_id_mask', 'Категории', 0, 'cs\\Widget\\CheckBoxListMask\\Validator', 'widget' => ['cs\\Widget\\CheckBoxListMask\\CheckBoxListMask', ['rows' => (new Query())->select(['id', 'name'])->from('gs_article_tree')->all()]]]];
     parent::__construct($fields);
 }
Example #23
0
 function __construct($fields = [])
 {
     static::$fields = [['name', 'Название', 0, 'string'], ['point', 'Местоположение', 0, 'string', 'widget' => ['cs\\Widget\\PlaceMap\\PlaceMap']], ['content', 'Время работы и контакты', 0, 'string', ['min' => 1, 'max' => 2000], 'widget' => ['cs\\Widget\\HtmlContent\\HtmlContent']]];
     parent::__construct($fields);
 }
Example #24
0
 public function clearCachedFieldData()
 {
     static::$fields = array();
 }
Example #25
0
 function __construct($fields = [])
 {
     static::$fields = [['dateMin', 'Начало', 0, 'validateDates', 'widget' => ['cs\\Widget\\DatePicker\\DatePicker', ['dateFormat' => 'php:d.m.Y']]], ['dateMax', 'Окончание', 0, 'validateDates', 'widget' => ['cs\\Widget\\DatePicker\\DatePicker', ['dateFormat' => 'php:d.m.Y']]]];
     parent::__construct($fields);
 }
Example #26
0
 function __construct($fields = [])
 {
     static::$fields = [['monthCounter', 'Количество месяцев', 1, 'integer']];
     parent::__construct($fields);
 }
Example #27
0
 function __construct($fields = [])
 {
     static::$fields = [['date1', 'Дата', 0, 'cs\\Widget\\DatePicker\\Validator', 'widget' => ['\\cs\\Widget\\DatePicker\\DatePicker', ['dateFormat' => 'php:d.m.Y']]], ['date2', 'Дата', 0, 'cs\\Widget\\DatePicker\\Validator', 'widget' => ['\\cs\\Widget\\DatePicker\\DatePicker', ['dateFormat' => 'php:d.m.Y']]], ['date3', 'Дата', 0, 'cs\\Widget\\DatePicker\\Validator', 'widget' => ['\\cs\\Widget\\DatePicker\\DatePicker', ['dateFormat' => 'php:d.m.Y']]], ['date4', 'Дата', 0, 'cs\\Widget\\DatePicker\\Validator', 'widget' => ['\\cs\\Widget\\DatePicker\\DatePicker', ['dateFormat' => 'php:d.m.Y']]], ['date5', 'Дата', 0, 'cs\\Widget\\DatePicker\\Validator', 'widget' => ['\\cs\\Widget\\DatePicker\\DatePicker', ['dateFormat' => 'php:d.m.Y']]], ['date6', 'Дата', 0, 'cs\\Widget\\DatePicker\\Validator', 'widget' => ['\\cs\\Widget\\DatePicker\\DatePicker', ['dateFormat' => 'php:d.m.Y']]], ['date7', 'Дата', 0, 'cs\\Widget\\DatePicker\\Validator', 'widget' => ['\\cs\\Widget\\DatePicker\\DatePicker', ['dateFormat' => 'php:d.m.Y']]], ['date8', 'Дата', 0, 'cs\\Widget\\DatePicker\\Validator', 'widget' => ['\\cs\\Widget\\DatePicker\\DatePicker', ['dateFormat' => 'php:d.m.Y']]], ['date9', 'Дата', 0, 'cs\\Widget\\DatePicker\\Validator', 'widget' => ['\\cs\\Widget\\DatePicker\\DatePicker', ['dateFormat' => 'php:d.m.Y']]], ['date10', 'Дата', 0, 'cs\\Widget\\DatePicker\\Validator', 'widget' => ['\\cs\\Widget\\DatePicker\\DatePicker', ['dateFormat' => 'php:d.m.Y']]], ['kurs1', 'Курс', 0, 'double'], ['kurs2', 'Курс', 0, 'double'], ['kurs3', 'Курс', 0, 'double'], ['kurs4', 'Курс', 0, 'double'], ['kurs5', 'Курс', 0, 'double'], ['kurs6', 'Курс', 0, 'double'], ['kurs7', 'Курс', 0, 'double'], ['kurs8', 'Курс', 0, 'double'], ['kurs9', 'Курс', 0, 'double'], ['kurs10', 'Курс', 0, 'double'], ['stock_id', 'Курс', 0, 'integer']];
     parent::__construct($fields);
 }
Example #28
0
 function __construct($fields = [])
 {
     static::$fields = [['header', 'Название', 1, 'string'], ['content', 'Описание', 0, 'string', 'widget' => ['cs\\Widget\\HtmlContent\\HtmlContent', []]], ['description', 'Описание краткое', 0, 'string'], ['date', 'Дата', 0, 'default', 'widget' => ['cs\\Widget\\DatePicker\\DatePicker', ['dateFormat' => 'php:d.m.Y']]], ['video', 'Youtube ролик', 0, 'url', [], 'в формате https://www.youtube.com/embed/jQCfBYYO0XI'], ['image', 'Картинка', 0, 'string', 'widget' => [FileUpload::className(), ['options' => ['small' => \app\services\GsssHtml::$formatIcon, 'original' => [1010, 500, \cs\Widget\FileUpload2\FileUpload::MODE_THUMBNAIL_CUT]]]]]];
     parent::__construct($fields);
 }
Example #29
0
 function __construct($fields = [])
 {
     static::$fields = [['header', 'Название', 1, 'string'], ['source', 'Ссылка', 0, 'url'], ['content', 'Описание', 0, 'string', 'widget' => ['cs\\Widget\\HtmlContent\\HtmlContent', []]], ['is_add_image', 'Добавлять картинку вначале статьи?', 0, 'cs\\Widget\\CheckBox2\\Validator', 'widget' => ['cs\\Widget\\CheckBox2\\CheckBox'], 'isFieldDb' => false], ['description', 'Описание краткое', 0, 'string'], ['img', 'Картинка', 0, 'string', 'widget' => [FileUpload::className(), ['options' => ['small' => \app\services\GsssHtml::$formatIcon]]]], ['tree_node_id_mask', 'Категории', 0, 'cs\\Widget\\CheckBoxListMask\\Validator', 'widget' => ['cs\\Widget\\CheckBoxTreeMask\\CheckBoxTreeMask', ['tableName' => 'gs_cheneling_tree']]]];
     parent::__construct($fields);
 }
Example #30
0
 function __construct($fields = [])
 {
     static::$fields = [['name_first', 'Имя', 1, 'string'], ['mission', 'Миссия', 0, 'string'], ['name_last', 'Фамилия', 0, 'string'], ['gender', 'Пол', 0, 'integer'], ['avatar', 'Картинка', 0, 'string', 'widget' => [FileUpload::className(), ['options' => ['small' => \app\services\GsssHtml::$formatIcon]]]], ['birth_date', 'Дата рождения', 0, 'cs\\Widget\\DatePicker\\Validator', 'widget' => [\cs\Widget\DatePicker\DatePicker::className(), ['dateFormat' => 'php:d.m.Y']]]];
     parent::__construct($fields);
 }