Mongolid\Schema\Schema::createdAtTimestamp PHP Method

createdAtTimestamp() public method

Prepares the field to be the datetime that the document has been created.
public createdAtTimestamp ( mixed | null $value ) : UTCDateTime
$value mixed | null Value that will be evaluated.
return Mongolid\Serializer\Type\UTCDateTime
    public function createdAtTimestamp($value)
    {
        if ($value instanceof UTCDateTime || $value instanceof MongoUTCDateTime) {
            return $value;
        }
        return $this->updatedAtTimestamp(null);
    }