What's the correct folder name for data-value objects?

As title says, we want to add data-value objects to our code-base. Any tips on where to put and how to name the folder? datavalueobjects is a bit long. dvo a bit unclear. I don’t want to put them in the models/ folder, it’s already too full.

It’s all up to you, but I would probably put it in the app\models folder in the name of DataValue.

These are usually called “value object”. Try structuring your code not by class type but by use-case.

I don’t want it to be up to me, I want it to be idiomatic! :sob:

1 Like

Little bit late since we already have controllers, models, views, etc. This is a Yii 1 project, but same question applies to Yii 2/3.

That doesn’t mean you can’t do both. Yii 1 and Yii 2 both have modules. In Yii 3 you just can use namespaces for the same purpose. Personally I’d put value object classes to domain namespace.