module/FzyCommon/src/FzyCommon/Entity/Base.php
public function tsSet($ts, $createIfEmpty = true, $timezone = false)
    {
        if ($ts instanceof \DateTime) {
            return $this->setDtTz($ts, $timezone);
        } elseif (is_string($ts)) {
            return $this->setDtTz(new \DateTime($ts), $timezone);
        } elseif (empty($ts)) {
            return $createIfEmpty ? $this->setDtTz(new \DateTime(), $timezone) : null;
        }

        throw new \InvalidArgumentException("The passed value '".var_export($ts, true)."' is not a valid timestamp.");
    }
public function tsSet($ts, $createIfEmpty = true, $timezone = false)
    {
        if ($ts instanceof \DateTime) {
            return $this->setDtTz($ts, $timezone);
        } elseif (is_string($ts)) {
            return $this->setDtTz(new \DateTime($ts), $timezone);
        } elseif (empty($ts)) {
            return $createIfEmpty ? $this->setDtTz(new \DateTime(), $timezone) : null;
        }

        throw new \InvalidArgumentException("The passed value '".var_export($ts, true)."' is not a valid timestamp.");
    }
Used to verify the value is valid to be assigned to timestamp property.
Acceptable: either \DateTime object or string which can be parsed to a \DateTime value.
An \InvalidArgumentException is thrown if the passed value does not meet that criteria
@param $ts
@param  string | boolean          $timezone - Pass in a \DateTimeZone timezone string or false
@return \DateTime
@throws \InvalidArgumentException