/**
  *
  */
 protected function registerCreateEvents()
 {
     // move this routine to a filter
     // in case of repeated piggy banks and/or other problems.
     PiggyBank::created(function (PiggyBank $piggyBank) {
         $repetition = new PiggyBankRepetition();
         $repetition->piggyBank()->associate($piggyBank);
         $repetition->startdate = is_null($piggyBank->startdate) ? null : $piggyBank->startdate;
         $repetition->targetdate = is_null($piggyBank->targetdate) ? null : $piggyBank->targetdate;
         $repetition->currentamount = 0;
         $repetition->save();
     });
 }