mtv\wp\models\User::validate PHP Method

validate() public method

public validate ( )
    public function validate()
    {
        // Register
        if (empty($this->id)) {
            // Validate username and email
            $result = wpmu_validate_user_signup($this->user_login, $this->user_email);
            if ($result['errors']->get_error_code()) {
                throw new WPException($result['errors']);
            }
            // Update
        } else {
            // Don't accidently set our password to empty
            if (isset($this->user_pass) && trim($this->user_pass) == '') {
                unset($this->user_pass);
            }
        }
    }