public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/functions.php
/**
 * Get the certificate details for a user, or false if not found.
 *
 * @since 1.0.0
 *
 * @param integer $userID The ID of the user to check.
 * @param integer $courseID The ID of the associated course.
 * @param boolean $tryToCreate If true, try to create the certificate if details don't exist.
 *
 * @return object The certificate details if they were found, or false if not found.
 */
Get the certificate details for a user, or false if not found.

@param integer $userID The ID of the user to check.
@param integer $courseID The ID of the associated course.
@param boolean $tryToCreate If true, try to create the certificate if details don't exist.

@return object The certificate details if they were found, or false if not found.
Get the certificate details for a user or false if not found . @param integer $userID The ID of the user to check . @param integer $courseID The ID of the associated course . @param boolean $tryToCreate If true try to create the certificate if details don ' t exist . @return object The certificate details if they were found or false if not found .
function WPCW_certificate_getCertificateDetails( $userID, $courseID, $tryToCreate = true ) {
	global $wpcwdb;
	$certificateDetails = getRecordDetails( $wpcwdb->certificates, array( 'cert_user_id', 'cert_course_id' ), array( $userID, $courseID ) );
	if ( $tryToCreate && ! $certificateDetails ) {
		return WPCW_certificate_generateCertificateEntry( $userID, $courseID );
	}
	return $certificateDetails;
}
function WPCW_certificate_getCertificateDetails ( $ userID , $ courseID , $ tryToCreate = true ) { global $ wpcwdb ; $ certificateDetails = getRecordDetails ( $ wpcwdb -> certificates , array ( 'cert_user_id' , 'cert_course_id' ) , array ( $ userID , $ courseID ) ) ; if ( $ tryToCreate && ! $ certificateDetails ) { return WPCW_certificate_generateCertificateEntry ( $ userID , $ courseID ) ; } return $ certificateDetails ; }
Get the certificate details for a user, or false if not found.
Get the certificate details for a user or false if not found .