Return to v2.2 docs

isClass()


Model Class Miscellaneous Functions string model


Use this method to check whether you are currently in a class-level object.

// Use the passed in `id` when we're already in an instance
function memberIsAdmin(){
	if(isClass()){
		return this.findByKey(arguments.id).admin;
	} else {
		return this.admin;
	}
}

Related Functions

Miscellaneous Functions