Skip to content

Instantly share code, notes, and snippets.

@Sigmus
Created May 25, 2012 14:33
Show Gist options
  • Save Sigmus/2788451 to your computer and use it in GitHub Desktop.
Save Sigmus/2788451 to your computer and use it in GitHub Desktop.
<?php
public static function updateDestaques()
{
$xml = simplexml_load_file(
Yii::app()->params['xml_destaques']
);
self::_updateFeed($xml);
try {
$model = self::model();
$transaction = $model->dbConnection->beginTransaction();
self::_zeraDestaques($model);
self::_populaDestaques($model, $xml);
}
catch(Exception $e)
{
$transaction->rollBack();
Yii::log($e->getMessage(), 'error');
}
$transaction->commit();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment