protected function getValidTimestamp($value)
    {
        if (gettype($value) == 'integer') {
            return $value;
        }

        if ($value instanceof DateTime) {
            return $value->getTimestamp();
        }

        throw new UnexpectedValueException('Instance of DateTime required for a valid timestamp');
    }