Ejemplo n.º 1
0
 /**
  * Populates any default values that are defined for a model.
  *
  * @param \CModel $model
  *
  * @return null
  */
 public static function populateAttributeDefaults(\CModel $model)
 {
     foreach ($model->getAttributeConfigs() as $name => $config) {
         if (isset($config['default'])) {
             $model->setAttribute($name, $config['default']);
         }
     }
 }