XF 2.1 What type to specify in addon's Entity class when storing only date value?

asprin

Active member
Looking at the Entity class (XF\Mvc\Entity), there doesn't seem to a value to specify a date column

1653209596750.webp

In that case, how can specify a column of type "Date" in the Entity class as well as Setup file?
 
mediumint is a valid column type when using the schema manager in a Setup.php file (and is unsigned by default).
PHP:
$table->addColumn('your_column', 'mediumint');

If you wanted it to be signed, it would be this:
PHP:
$table->addColumn('your_column', 'mediumint')->unsigned(false);
 
Back
Top Bottom