<?php

namespace goals\traits;

use DateTime;

trait goals_timeframe_t
{
    /**
     * The start time of the timeframe.
     *
     * @var datetime|null
     */
    public ?datetime $start = null;
    /**
     * The end time of the timeframe.
     *
     * @var datetime|null
     */
    public ?datetime $end = null;

    /**
     * Sets the timeframe for the goal.
     *
     * @param datetime|null $start The start time of the timeframe.
     * @param datetime|null $end The end time of the timeframe.
     * @return void
     */
    public function setTimeframe(?datetime $start = null, ?datetime $end = null): void
    {
        $this->start = $start;
        $this->end = $end;
    }
}