trejder
trejder

Reputation: 17505

Why Yii2 uses abbreviated methods names in yii\caching\Cache?

Methods of yii\caching\Cache:

are the only (known to me) in entire Yii2 core, that are using abbreviated names. Following naming convetions used everywhere else, they should be named multiAdd, multiGet and multiSet.

Does anyone know, why exception has been made for this one (?) class?

I'm reviewing a book about Yii2 right now, and I was so extremely surprised to findout these names, that at first I'd bet a lot, that book author made a mistake! Abreviated methods names in Yii2?

Upvotes: 4

Views: 389

Answers (2)

Evgeniy Tkachenko
Evgeniy Tkachenko

Reputation: 1737

I think it was done in haste and is inherited from Yii1. http://www.yiiframework.com/doc/api/1.1/CCache#mget-detail

No one thought about it then. And now it is BC

UPD: Added in Ideas for 2.1

UPD2 https://github.com/yiisoft/yii2/pull/10296

Upvotes: 6

SilverFire
SilverFire

Reputation: 1592

Well, I guess it was named so for short. For now we can create multiSet, multiGet, multiAdd methods, and make the existing mset, mget and madd method as aliases for them. Then mark old methods as DEPRECATED until Yii 2.1, then just drop them.

Upvotes: 6

Related Questions