最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Is it possible to override property types when extending a component in ColdFusion 2023? - Stack Overflow

programmeradmin1浏览0评论

I am testing code that works in CF 11 for an upgrade to CF 2023. I have a component that extends another component and overrides the type of a property in the base component. Here is some simple pseudo code demonstrating the components:

Base.cfc:

component accessors="true" {
    property name="myData" type="query";
}

Extend.cfc:

component extends="Base" accessors="true" {
    property name="myData" type="array";

    public Extend function init() {
        setmyData([]);

        return THIS;
    }
}

When Extend.init() is called, an error is thrown saying that the value is not of type "query". This code works fine in CF 11. Has something changed since that won't allow this, or, is there a workaround?

Thanks,

Eric

发布评论

评论列表(0)

  1. 暂无评论