protected function setDefaults() { if (!$this->getRefundDate()) { $this->setRefundDate(date('Y-m-d H:i:s')); } if (!$this->getBatchNo()) { $this->setBatchNo(date('Ymd') . mt_rand(1000, 9999)); } }