Model/User.php
public function setEndDate($endDate)
    {
        if ($endDate instanceof DateTime) {
            $this->endDate = $endDate;
        } else {
            try {
                $this->endDate = new DateTime($endDate);
            } catch (\Exception $e) {
                $this->endDate = null;
            }
        }

        return $this;
    }
public function setEndDate($endDate)
    {
        if ($endDate instanceof DateTime) {
            $this->endDate = $endDate;
        } else {
            try {
                $this->endDate = new DateTime($endDate);
            } catch (\Exception $e) {
                $this->endDate = null;
            }
        }

        return $this;
    }
public function setEndDate ( $ endDate ) { if ( $ endDate instanceof DateTime ) { $ this -> endDate = $ endDate ; } else { try { $ this -> endDate = new DateTime ( $ endDate ) ; } catch ( \ Exception $ e ) { $ this -> endDate = null ; } } return $ this ; }
Sets the "endDate" of the User.

@param DateTime $endDate

@return User
Sets the endDate of the User .