Skip to content

SavableComponentTrait ​

Type
Trait
Namespace
craft\base
Implemented by
craft\base\Field, craft\base\Fs, craft\base\SavableComponent, craft\base\Widget, craft\fields\Assets, craft\fields\BaseOptionsField, craft\fields\BaseRelationField, craft\fields\Categories, craft\fields\Checkboxes, craft\fields\Color, craft\fields\Country, craft\fields\Date, craft\fields\Dropdown, craft\fields\Email, craft\fields\Entries, craft\fields\Lightswitch, craft\fields\Matrix, craft\fields\MissingField, craft\fields\Money, craft\fields\MultiSelect, craft\fields\Number, craft\fields\PlainText, craft\fields\RadioButtons, craft\fields\Table, craft\fields\Tags, craft\fields\Time, craft\fields\Url, craft\fields\Users, craft\fs\Local, craft\fs\MissingFs, craft\fs\Temp, craft\widgets\CraftSupport, craft\widgets\Feed, craft\widgets\MissingWidget, craft\widgets\MyDrafts, craft\widgets\NewUsers, craft\widgets\QuickPost, craft\widgets\RecentEntries, craft\widgets\Updates
Since
3.0.0

SavableComponentTrait implements the common methods and properties for savable component classes.

View source

Public Properties ​

PropertyDescription
dateCreatedDateTime, null – The date that the component was created
dateUpdatedDateTime, null – The date that the component was last updated
idinteger, string, null – The component’s ID (could be a temporary one: "new:X")

dateCreated ​

Type
DateTime, null
Default value
null

The date that the component was created

View source

dateUpdated ​

Type
DateTime, null
Default value
null

The date that the component was last updated

View source

id ​

Type
integer, string, null
Default value
null

The component’s ID (could be a temporary one: "new:X")

View source