Showing 21-40 of 652 items.

How to nest DB transactions without actually nesting them.

Created 11 years ago by le_top le_top, updated 11 years ago by le_top le_top. 0 comments

To secure your database from inconsistencies resulting from failing (complex) operations, you (should) use transactions. However, complex methods often rely on other complex methods that themselves build on transactions. This HowTo presents a method to nest or embed transactions without relying on the database's nesting capabilities.

1 0
1
Viewed: 14 658 times
Version: 1.1
Category: How-tos

Use CGridview to sort and filter CSqlDataProvider - when used with UNRELATED tables (or complex queries)

Created 11 years ago by Gerhard Liebenberg Gerhard Liebenberg, updated 11 years ago by Gerhard Liebenberg Gerhard Liebenberg. 6 comments

I have two tables called hospitals and departments. I have a junction table between them which holds the departments in each hospital. But sometimes I need a list of "All hospitals with All possible departments" - regardless of whether they are linked in the junction table or not.

0 0
3
Viewed: 27 468 times
Version: 1.1
Category: How-tos

Yii configuration: Dynamic & User dependent

Created 11 years ago by le_top le_top, updated 11 years ago by le_top le_top. 0 comments

It is difficult to perform user dependent theming through a general configuration in 'main.php'. This article proposes a method to do so through a Factory that dynamically generates classes to allow delayed resolution of actual user values. This means that you can refer to values that are stored in the database through the CActiveRecord before Yii is actually loaded. The values will be fetched...

1 0
1
Viewed: 16 380 times
Version: 1.1
Category: How-tos

Behaviour for Time Zone and Format conversion for Date, Time, timestamp, and datetime

Created 11 years ago by Smithesh Smithesh, updated 11 years ago by Smithesh Smithesh. 1 comment

This Behaviour helps to view time/date/timestamp/datetime from db to local Date / Time / Date Time format and in local Timezone. And save into db in with db timezone and db format. You only need to include this behaviour in models where need this facility.