YIIC and databases

Just been playing with this framework for a couple of days (smoothe!), so naturally have some newbie questions.

When using YIIC and CRUD the application naturally looks for a database table corresponding to our crud command.

Now, most databases have tables related to each other. For example, I have a "products" table and also a "products_description" table (this allows for internationalization of product data such as "name" and "description". They share the key "product_id".

Is it possible to link these together when using CRUD, since creating, reading, updating and deleting product data is a single page process?

Or is this beyond the capabilities of YIIC and needs to be created by manually editing?

If you have related tables, yiic will automatically add method "relations" to your model Product, so you can use the following syntax to get description for a product: $product->description, which will return an object ProductDescription.

BUT yiic creates separate pages for editing products and their descriptions, so you have to unite them manually. Actually you just need to modify one view file and put some strings of code to the products controller (action update), and that is not that much, yes? :)

You may also refer to the following tutorial on how to create your own CRUD command:


Ok, great… thanks a bunch!