I'm trying to cache the db calls for Yii2 exists validation, but can't work out where to initiate it.
Because I'm using a multi-model form with a lot of relations, the overhead is getting a little too much.
Any ideas?
This is not supported by Yii, you either have to :
ExistValidator
and implement your caching logic there ActiveQuery
class to your model in question and override
the exists()
and count()
methods