Skip to content

Instantly share code, notes, and snippets.

@yjeroen
yjeroen / gist:1560242
Created January 4, 2012 14:22
I think I got the solution!
<?php
class foo extends CActiveRecord
{
public function save($runValidation=true,$attributes=null)
{
if( Yii::app()->db->getCurrentTransaction() === null )
{
$transaction = Yii::app()->db->beginTransaction();
$transaction->attachbehavior('modelSaveTransaction', new CBehavior);
class foo extends CActiveRecord
class User extends foo
class Post extends foo
userController User Post
========== === ===
{
function actionThatAddsUserAndPosts
array(
'class' => 'CCheckBoxColumn',
'checked' => 'in_array($data->user_id, ' . var_export($campaign->reviewIds, 1) . ')',
'value' => '$data->user_id',
'selectableRows' => 100,
),