Exemplo n.º 1
0
 public static function getFields()
 {
     return ['name' => ['class' => CharField::className(), 'default' => 'Product', 'validators' => [function ($value) {
         if (mb_strlen($value, 'UTF-8') < 3) {
             return "Minimal length < 3";
         }
         return true;
     }]], 'price' => ['class' => CharField::className(), 'default' => 0], 'description' => ['class' => TextField::className(), 'null' => true], 'category' => ['class' => ForeignField::className(), 'modelClass' => Category::className(), 'null' => true, 'relatedName' => 'products'], 'lists' => ['class' => ManyToManyField::className(), 'modelClass' => ProductList::className()]];
 }
Exemplo n.º 2
0
Arquivo: Meta.php Projeto: qantus/Meta
 public static function getFields()
 {
     $fields = ['is_custom' => ['class' => BooleanField::className(), 'verboseName' => MetaModule::t('Is custom'), 'helpText' => MetaModule::t('If "Set manually" field was not set, data will be generated automatically')], 'title' => ['class' => CharField::className(), 'length' => 200, 'verboseName' => MetaModule::t('Title')], 'keywords' => ['class' => CharField::className(), 'length' => 200, 'verboseName' => MetaModule::t('Keywords'), 'null' => true], 'description' => ['class' => CharField::className(), 'length' => 200, 'verboseName' => MetaModule::t('Description'), 'null' => true], 'url' => ['class' => CharField::className(), 'verboseName' => MetaModule::t('Url'), 'null' => true]];
     $onSite = Mindy::app()->getModule('Meta')->onSite;
     if ($onSite) {
         $fields['site'] = ['class' => ForeignField::className(), 'modelClass' => Mindy::app()->getModule('Sites')->modelClass, 'verboseName' => SitesModule::t('Site'), 'required' => true, 'null' => true];
     }
     return $fields;
 }
Exemplo n.º 3
0
 public function __construct(array $options = [])
 {
     parent::__construct($options);
     $this->validators = array_merge([new EmailValidator(!$this->canBeEmpty())], $this->validators);
 }
Exemplo n.º 4
0
 public static function getFields()
 {
     return ['name' => ['class' => CharField::className()], 'products' => ['class' => HasManyField::className(), 'modelClass' => Product::className(), 'null' => true, 'relatedName' => 'category', 'editable' => false]];
 }
Exemplo n.º 5
0
 public static function getFields()
 {
     return ['user' => ['class' => ForeignField::className(), 'null' => true, 'modelClass' => User::className(), 'verboseName' => CoreModule::t('User')], 'ip' => ['class' => IpField::className(), 'null' => false, 'verboseName' => CoreModule::t('Ip address')], 'name' => ['class' => CharField::className(), 'verboseName' => CoreModule::t('Message'), 'null' => true], 'message' => ['class' => TextField::className(), 'verboseName' => CoreModule::t('Message')], 'module' => ['class' => CharField::className(), 'verboseName' => CoreModule::t('Module')], 'model' => ['class' => CharField::className(), 'verboseName' => CoreModule::t('Model'), 'null' => true], 'url' => ['class' => CharField::className(), 'null' => true, 'verboseName' => CoreModule::t('Url')], 'created_at' => ['class' => DateTimeField::className(), 'autoNowAdd' => true, 'verboseName' => CoreModule::t('Created at')]];
 }
Exemplo n.º 6
0
 public static function getFields()
 {
     return ['code' => ['class' => CharField::className()]];
 }
Exemplo n.º 7
0
 public static function getFields()
 {
     return ['name' => ['class' => CharField::className()], 'court' => ['class' => CharField::className()], 'question' => ['class' => CharField::className()], 'result' => ['class' => CharField::className()], 'document' => ['class' => FileField::className()], 'content' => ['class' => TextField::className()], 'status' => ['class' => IntField::className(), 'choices' => [self::STATUS_SUCCESS => 'Successful', self::STATUS_COMPLETE => 'Complete']], 'created_at' => ['class' => DateTimeField::className(), 'autoNowAdd' => true]];
 }
Exemplo n.º 8
0
 public static function getFields()
 {
     return ['name' => ['class' => CharField::className()], 'tyre' => ['class' => ForeignField::className(), 'modelClass' => Tyre::className()]];
 }
Exemplo n.º 9
0
 public static function getFields()
 {
     return ['name' => ['class' => CharField::className(), 'verboseName' => 'Наименование'], 'upper_name' => ['class' => CharField::className(), 'verboseName' => 'НАИМЕНОВАНИЕ', 'null' => true], 'producer_wheel_id' => ['class' => IntField::className(), 'verboseName' => 'Производитель'], 'type' => ['class' => IntField::className(), 'verboseName' => 'Тип', 'choices' => [self::TYPE_STAMP => 'Штампованый', self::TYPE_CAST => 'Литой']], 'color' => ['class' => CharField::className(), 'verboseName' => 'Цвет', 'null' => true], 'image' => ['class' => CharField::className(), 'verboseName' => 'Изображение', 'null' => true]];
 }
Exemplo n.º 10
0
 public static function getFields()
 {
     return ['id' => ['class' => CharField::className(), 'length' => 32, 'primary' => true, 'null' => false], 'expire' => ['class' => IntField::className(), 'null' => false], 'data' => ['class' => BlobField::className(), 'null' => true]];
 }
Exemplo n.º 11
0
 public function getFormField($form, $fieldClass = null, array $extra = [])
 {
     return parent::getFormField($form, \Mindy\Form\Fields\ShortUrlField::className(), $extra);
 }
Exemplo n.º 12
0
 public static function getFields()
 {
     return array_merge(parent::getFields(), ['name' => ['class' => CharField::className()], 'slug' => ['class' => AutoSlugField::className(), 'source' => 'name']]);
 }
Exemplo n.º 13
0
 public function getFormField($form, $fieldClass = null, array $extra = [])
 {
     if (!empty($this->types)) {
         $types = [];
         foreach ($this->types as $type) {
             $types[] = FileHelper::getMimeTypeByExtension($type);
         }
         $extra = array_merge($extra, ['html' => ['accept' => implode('|', $types)]]);
     }
     return parent::getFormField($form, FormFileField::className(), $extra);
 }
Exemplo n.º 14
0
 public static function getFields()
 {
     return ['name' => ['class' => CharField::className()], 'subscribers' => ['class' => ManyToManyField::className(), 'modelClass' => self::className()], 'subscribes' => ['class' => ManyToManyField::className(), 'modelClass' => self::className(), 'reversed' => true]];
 }
Exemplo n.º 15
0
 public static function getFields()
 {
     return ['user' => ['class' => ForeignField::className(), 'modelClass' => User::className(), 'verboseName' => UserModule::t('User')], 'key' => ['class' => CharField::className(), 'length' => 40, 'verboseName' => UserModule::t("Key"), 'unique' => true]];
 }
Exemplo n.º 16
0
 public static function getFields()
 {
     return ['username' => ['class' => CharField::className(), 'validators' => [new MinLengthValidator(3), new MaxLengthValidator(20)]], 'password' => ['class' => PasswordField::className(), 'null' => true], 'groups' => ['class' => ManyToManyField::className(), 'modelClass' => Group::className(), 'through' => Membership::className()], 'addresses' => ['class' => HasManyField::className(), 'modelClass' => Customer::className(), 'relatedName' => 'user', 'editable' => false]];
 }
Exemplo n.º 17
0
 public static function getFields()
 {
     return ['module' => ['class' => CharField::className()], 'model' => ['class' => CharField::className()], 'timestamp' => ['class' => IntField::className()]];
 }
Exemplo n.º 18
0
 public static function getFields()
 {
     return ['name' => ['class' => CharField::className()], 'place' => ['class' => OneToOneField::className(), 'modelClass' => Place::className(), 'primary' => true]];
 }
Exemplo n.º 19
0
 public static function getFields()
 {
     return ['name' => ['class' => CharField::className()], 'users' => ['class' => ManyToManyField::className(), 'modelClass' => User::className(), 'through' => Membership::className()]];
 }
Exemplo n.º 20
0
 public static function getFields()
 {
     return ['sitename' => ['class' => CharField::className(), 'null' => true, 'verboseName' => CoreModule::t('Sitename', [], 'settings')], 'email_owner' => ['class' => EmailField::className(), 'null' => true, 'verboseName' => CoreModule::t('Email site owner', [], 'settings')]];
 }
Exemplo n.º 21
0
 public static function getFields()
 {
     return ['LOGIN' => ['class' => CharField::className()], 'PASSWORD' => ['class' => CharField::className()], 'CHECKWORD' => ['class' => CharField::className()], 'NAME' => ['class' => CharField::className()], 'LAST_NAME' => ['class' => CharField::className()], 'SECOND_NAME' => ['class' => CharField::className()], 'EMAIL' => ['class' => EmailField::className()], 'EXTERNAL_AUTH_ID' => ['class' => CharField::className()], 'XML_ID' => ['class' => CharField::className()], 'PERSONAL_COUNTRY' => ['class' => CharField::className()], 'PERSONAL_PHONE' => ['class' => CharField::className()], 'PERSONAL_MOBILE' => ['class' => CharField::className()], 'PERSONAL_CITY' => ['class' => CharField::className()], 'ACTIVE' => ['class' => CharField::className()], 'PERSONAL_BIRTHDAY' => ['class' => DateField::className()], 'PERSONAL_NOTES' => ['class' => TextField::className()], 'PERSONAL_STREET' => ['class' => TextField::className()]];
 }
Exemplo n.º 22
0
 public static function getFields()
 {
     return ['id' => ['class' => CharField::className(), 'primary' => true]];
 }
Exemplo n.º 23
0
 public static function getFields()
 {
     return ['id' => ['class' => CharField::className(), 'length' => 32, 'primary' => true, 'null' => false], 'created_at' => ['class' => DateTimeField::class, 'autoNowAdd' => true, 'verboseName' => self::t('Created at')], 'expire' => ['class' => IntField::className(), 'null' => false, 'verboseName' => self::t("Expire time")], 'data' => ['class' => BlobField::className(), 'null' => true, 'verboseName' => self::t("Session data")], 'user' => ['class' => ForeignField::class, 'verboseName' => self::t('User'), 'modelClass' => User::class, 'editable' => false, 'null' => true]];
 }
Exemplo n.º 24
0
 public static function getFields()
 {
     return ['title' => ['class' => CharField::className(), 'verboseName' => self::t("Title")], 'code' => ['class' => CharField::className(), 'verboseName' => self::t("Code")], 'description' => ['class' => TextField::className(), 'verboseName' => self::t('Description'), 'null' => true], 'keywords' => ['class' => TextField::className(), 'verboseName' => self::t('Keywords'), 'null' => true]];
 }
Exemplo n.º 25
0
 public static function getFields()
 {
     return ['owner_class' => ['class' => CharField::className()], 'owner_pk' => ['class' => IntField::className()], 'related_class' => ['class' => CharField::className()], 'related_pk' => ['class' => IntField::className()], 'position' => ['class' => IntField::className(), 'null' => true], 'field' => ['class' => CharField::className()], 'name' => ['class' => CharField::className()]];
 }
Exemplo n.º 26
0
 public static function getFields()
 {
     return ['name' => ['class' => CharField::className()], 'restaurant' => ['class' => OneToOneField::className(), 'modelClass' => Restaurant::className(), 'reversed' => true]];
 }
Exemplo n.º 27
0
 public static function getFields()
 {
     return ['title' => ['class' => CharField::className(), 'verboseName' => self::t("Title")], 'code' => ['class' => CharField::className(), 'verboseName' => self::t("Code")], 'text' => ['class' => TextField::className(), 'verboseName' => self::t('Text')]];
 }
Exemplo n.º 28
0
 public static function getFields()
 {
     return ['name' => ['class' => CharField::className()], 'products' => ['class' => ManyToManyField::className(), 'modelClass' => Product::className()], 'date_action' => ['class' => DateTimeField::className(), 'required' => false, 'null' => true]];
 }
Exemplo n.º 29
0
 public static function getFields()
 {
     return ["code" => ['class' => CharField::className(), 'verboseName' => self::t("Key"), 'unique' => true, 'helpText' => self::t("Rule code for developers to use in source code")], "name" => ['class' => CharField::className(), 'verboseName' => self::t("Name"), 'helpText' => self::t("Rule name")], "bizrule" => ['class' => CharField::className(), 'null' => true, 'verboseName' => self::t("Bussines rule"), 'helpText' => self::t("More info in documentation")], "is_locked" => ['class' => BooleanField::className(), 'verboseName' => self::t("Is locked"), 'helpText' => self::t("Locked for editing. Editing allowed only for super-administrator.")], "is_auto" => ['class' => BooleanField::className(), 'verboseName' => self::t("Is auto"), 'helpText' => self::t("Rule created automatically by module. Editing allowed only for super-administrator.")], "is_visible" => ['class' => BooleanField::className(), 'default' => true, 'verboseName' => self::t("Is visible"), 'helpText' => self::t('Rule is visible only to super-administrator')], "is_default" => ['class' => BooleanField::className(), 'verboseName' => self::t("Is default"), 'helpText' => self::t("Default rule. Rule applies to all users after creation")], "is_global" => ['class' => BooleanField::className(), 'verboseName' => self::t("Is global"), 'helpText' => self::t("Global rule. This type of rule has priority and overrides other rules. More info in documentation.")]];
 }
Exemplo n.º 30
0
 public static function getFields()
 {
     return ['name' => ['class' => CharField::className(), 'length' => 50, 'verboseName' => "Name"]];
 }