/**
* Sets the date or current date if null value is passed.
*
* @param int|null $userData An optional PHP timestamp to be converted.
*
* @return int|string
*
* @throws ModelException
*/
protected function setDate(?int
$userData = null
) { $currentDate =
$userData ?? Time::
now()->
getTimestamp();
return $this->
intToDate($currentDate);
} /**
* A utility function to allow child models to use the type of
* date/time format that they prefer. This is primarily used for
* setting created_at, updated_at and deleted_at values, but can be
* used by inheriting classes.
*
* The available time formats are:
* - 'int' - Stores the date as an integer timestamp
* - 'datetime' - Stores the data in the SQL datetime format
* - 'date' - Stores the date (only) in the SQL date format.
*
* @param int $value value
*
* @return int|string
*
* @throws ModelException
*/