/**
  * @inheritDoc BaseModel::populateModel()
  *
  * @param mixed $attributes
  *
  * @return UserModel
  */
 public static function populateModel($attributes)
 {
     $user = parent::populateModel($attributes);
     // Is the user in cooldown mode, and are they past their window?
     if ($user->status == UserStatus::Locked) {
         $cooldownDuration = craft()->config->get('cooldownDuration');
         if ($cooldownDuration) {
             if (!$user->getRemainingCooldownTime()) {
                 craft()->users->unlockUser($user);
             }
         }
     }
     return $user;
 }
 public static function populateModel($row)
 {
     if ($row['planDiscount'] > 0) {
         $row['hasDiscount'] = true;
     }
     return parent::populateModel($row);
 }