Yii Framework Forum: Clist Class - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Clist Class setReadOnly method Rate Topic: -----

#1 User is offline   eMBeer 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 28-May 12

Posted 14 September 2013 - 03:47 AM

I found that setReadOnly() method of the CList class is protected. I wonder if it is a bug, or it was done intentionally to prevent accidental chage of ReadOnly status of the list after it has been instantiated with given R/O flag?

What do you think?
0

#2 User is offline   eMBeer 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 28-May 12

Posted 14 September 2013 - 04:17 AM

Same thing is with CMap class. I don't believe in multiple bugs of the same type :) Must be intentional, for protection purposes. After all if I want to have this method public, I can create my own class extending the mentioned one, with setReadOnly method made public...
0

#3 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,040
  • Joined: 17-January 09
  • Location:Russia

Posted 14 September 2013 - 06:13 AM

It's by design and is there to make it possible to set it to read only if you're overriding the class.
Yii 2.0 Development Cookbook

Enjoying Yii? Star us at github

Support me so I work on Yii fulltime: https://www.patreon.com/samdark
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users