Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Nostromo supports a lot of field types including domain types like email or URL. The types are mapped to database types automatically. All field types have input sanitation, escaping on output and return controls to edit their values.

Name

Description

birthday

Special field for birthdates. The null value of this type is 1900-01-01 instead of the start of the unix epoche.

boolean

Represents a boolean value.

calc

The value of this field is a calculation that is performed in the database. This is a read only field.

color

Represents a color value. A color picker is shown as the default control.

count

// Description is missing

currency

Field that will be used for monetary values. Is rounded to two digits before storage and output.

date

Stores a date (without time)

datetime

Stores data and time

dateWithoutYear

Stores a day in a month (without the year fraction)

email

Used to store an email. Everything that is not an email will be removed before persisting.

encrypted

Stores an encrypted string. The string can only be read from the same instance of Nostromo. Make sure to backup the key, if you use this field!

virtual

Fields that support a callable as getter and setter. Is not saved to the database.

Code Block
languagephp
 public function init()
 {
     parent::init();
     $this->felder['ti_ort'] = ModelFieldVirtual::create('Ort')->onOutput(function () {
         return $this->ortsStringErzeugen();
     })->onInput(function ($value) {
         $this->parseOrtsString($value);
     });
 }

// Usage 
$template = 'Parser-Text {ti_ort}';
echo $ticket->ti_ort;
$ticket->ti_ort = 'Bauteil / Etage'