Example #1
0
 /**
  * Override update() to set child records to the same lot as parent
  */
 public function update($pa_options = null)
 {
     if ($vn_parent_id = $this->get('parent_id')) {
         $t_parent = new ca_objects();
         if ($this->inTransaction()) {
             $t_parent->setTransaction($this->getTransaction());
         }
         if ($t_parent->load($vn_parent_id) && ($vn_lot_id = $t_parent->get('lot_id'))) {
             $this->set('lot_id', $vn_lot_id);
         }
     }
     return parent::update($pa_options);
 }