/**
  * Define database column
  *
  * @return mixed
  */
 public function defineContentAttribute()
 {
     $settings = $this->getSettings();
     // It hasn't always been a settings, so default to Text if it's not set.
     if (!$settings->getAttribute('columnType')) {
         return array(AttributeType::String, 'column' => ColumnType::Text);
     }
     if ($settings->columnType === 'number') {
         $attribute = ModelHelper::getNumberAttributeConfig(null, null, $settings->decimals);
         $attribute['default'] = 0;
         return $attribute;
     }
     return array(AttributeType::String, 'column' => $settings->columnType);
 }
Exemplo n.º 2
0
 /**
  * @inheritDoc IFieldType::defineContentAttribute()
  *
  * @return mixed
  */
 public function defineContentAttribute()
 {
     $attribute = ModelHelper::getNumberAttributeConfig($this->settings->min, $this->settings->max, $this->settings->decimals);
     $attribute['default'] = 0;
     return $attribute;
 }
Exemplo n.º 3
0
 /**
  * Returns the content attribute config.
  *
  * @return mixed
  */
 public function defineContentAttribute()
 {
     return ModelHelper::getNumberAttributeConfig($this->settings->min, $this->settings->max, $this->settings->decimals);
 }