YiiHaa Webdevelopment blog about Yii-framework and more

1Mar/12197

Models and multiple database connections

Posted by martijn

By default, Yii uses the 'db' component for the interaction between your model and database. But Yii also supports multiple database connections. To use multiple database connections requires come configuration. In this blog I will explain how to configure multiple databases, preparing your models and use gii for creating models from all databases.

17Feb/1239

Validate unique constraints with more then one attribute

Posted by martijn

Yii comes with bucket of validators including a unique validator which validates whether an attribute value is unique in the corresponding database table. But what if your database unique constraint contains more than one attribute?

14Feb/1241

CacheDependency, a real cache dependency

Posted by martijn

Using cache dependencies enables you to be in control of your cached data. Yii provides several dependency methods such as database, file and globalState.

They all work fine but when I use memcached as caching provider, I do not want Yii to check dependencies located on the hard drive everytime Yii::app()->cache->get() is called