common/models/entities/User.php
public function isOtpValid( $otp ) {

		$now = DateUtil::getDateTime();

		return $this->otp == $otp && DateUtil::lessThan( $now, $this->otpValidTill );
	}
public function isOtpValid( $otp ) {

		$now = DateUtil::getDateTime();

		return $this->otp == $otp && DateUtil::lessThan( $now, $this->otpValidTill );
	}
public function isOtpValid ( $ otp ) { $ now = DateUtil :: getDateTime ( ) ; return $ this -> otp == $ otp && DateUtil :: lessThan ( $ now , $ this -> otpValidTill ) ; }
Check whether OTP is valid.

@param integer $otp
@return boolean
Check whether OTP is valid .