public function populateModel(&$model) { assert('$model instanceof Contact'); parent::populateModel($model); $domainName = static::resolveDomainName($model); $source = RandomDataUtil::getRandomValueFromArray(static::getCustomFieldDataByName('LeadSources')); $industry = RandomDataUtil::getRandomValueFromArray(static::getCustomFieldDataByName('Industries')); $model->website = static::makeUrlByDomainName($domainName); $model->source->value = $source; $model->industry->value = $industry; }
public function populateModel(&$model) { assert('$model instanceof User'); parent::populateModel($model); $model->language = Yii::app()->language; $model->timeZone = Yii::app()->timeZoneHelper->getGlobalValue(); $currencies = Currency::getAll(); $model->currency = $currencies[0]; }