Skip to content

Model Class

isClass()

isClass() — returns string

Available in: model Category: Miscellaneous Functions

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;
	}
}