Skip to content

Working With Wheels

Overriding Core Methods

Overriding Core Wheels Methods (Wheels 3.x)

Section titled “Overriding Core Wheels Methods (Wheels 3.x)”

In Wheels 2.5, developers could override core framework methods (such as findAll) in their models and call the original Wheels implementation using the super scope.

Due to internal framework restructuring in Wheels 3.0, this behavior no longer works using the traditional super.methodName() syntax. To restore this capability in a predictable and explicit way, Wheels now provides a new super-prefixed method convention.


In Wheels 2.5, overriding a core model method and calling the original implementation looked like this:

component extends="Model" {
function findAll() {
// custom logic here
return super.findAll();
}
}

This worked because Wheels core methods were directly accessible via the super scope.


Wheels 3.0 introduced a significant internal reorganization of the framework to support:

  • improved extensibility
  • cleaner separation of concerns
  • better compatibility with multiple runtimes

As a result, calling core methods using super.methodName() is no longer reliable or supported in the same way.


To override a core Wheels method and still call the original implementation, you now use a super-prefixed method name.

Instead of calling:

super.findAll()

You call:

superFindAll()

component extends="Model" {
function findAll() {
// custom logic before calling Wheels core method
return superFindAll();
}
}

This allows you to:

  • safely override any core Wheels method
  • explicitly call the original Wheels implementation
  • avoid framework internals or brittle inheritance behavior

  • The superMethodName() convention applies only when overriding a core Wheels method
  • Method names are case-insensitive, following normal CFML rules
  • This behavior is available in Wheels 3.x and later
  • No changes are required for applications that do not override core methods

If you are upgrading an application from Wheels 2.5 to 3.0+ and have overridden core methods:

  1. Search for usages of super.methodName()
  2. Replace them with superMethodName()
  3. Test overridden behavior to ensure expected results

This small change restores the same extension capability that existed in Wheels 2.5, while remaining compatible with the updated framework architecture.