* @copyright Copyright (c) 2019 Metaways Infosystems GmbH (http://www.metaways.de) * */ /** * * @package HumanResources * @subpackage BL */ class HumanResources_BL_DailyWTReport_TimeSlot { /** * @var Tinebase_DateTime */ public $start; /** * @var Tinebase_DateTime */ public $end; /** * @var int */ public $forcedBreakAtEnd = 0; /** * @var int */ public $forcedBreakAtStart = 0; /** * @var string */ public $timeAccountId; /** * @var string */ public $timeSheetId; /** * @var HumanResources_Model_FreeTimeType */ public $absenceReason; /** * @return int */ public function durationInSec(): int { return $this->end->getTimestamp() - $this->start->getTimestamp(); } /** * we assume we work on the end always, so clone get "end" properties, $this keeps "start" properties * * @return HumanResources_BL_DailyWTReport_TimeSlot */ public function getClone(): self { $clone = clone $this; $clone->forcedBreakAtStart = 0; $this->forcedBreakAtEnd = 0; return $clone; } }