Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Methods of yii\caching\Cache:

  • madd(),
  • mget() and
  • mset(),

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?

like image 823
trejder Avatar asked Dec 15 '22 10:12

trejder


1 Answers

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

like image 129
Evgeniy Tkachenko Avatar answered Feb 03 '23 09:02

Evgeniy Tkachenko