This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Yii::import('ext.AttributesBackupBehavior'); | |
/** | |
* Prevent save() command from being executed if no attributes have changed | |
* The AttributesBackupBehavior class is available here: | |
* http://www.yiiframework.com/extension/attributesbackupbehavior/ | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Based on CList: | |
* @author Qiang Xue <qiang.xue@gmail.com> | |
* @link http://www.yiiframework.com/doc/api/1.1/CList | |
* @copyright Copyright © 2008-2011 Yii Software LLC | |
* @license http://www.yiiframework.com/license/ | |
*/ | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Beware: Returns a winner even if the collective drop chance is below 100%. | |
* If that behavior is undesired, add some logic in getWinner to prevent it. | |
*/ | |
class Lottery { | |
/** | |
* list of entries in the lottery. Elements are of the form | |
* array('participant' => (mixed), | |
* 'lots' => (float)), |