/**
  * Create and load data for the objects used for this form.
  * 
  * Set the default license number to be the same as the registration for this
  * training.
  */
 protected function loadObjects()
 {
     parent::loadObjects();
     if (!$this->isPost() && !$this->getPrimary()->license_number) {
         $parent = $this->getParent();
         $parent->populateChildren("registration");
         $reg = current($parent->children['registration']);
         $this->getPrimary()->license_number = $reg->registration_number;
     }
 }
 /**
  * Create and load data for the objects used for this form.
  */
 protected function loadObjects()
 {
     parent::loadObjects();
     if (!$this->isPost()) {
         $parent = $this->getParent();
         $parent->populateLast(array("license" => "end_date"));
         $last = current($parent->children['license']);
         if ($last) {
             $this->getPrimary()->license_number = $last->license_number;
         }
     }
 }