public function save(Doctrine_Connection $conn = null) { $cls_commonfunction = new CommonFunctions(); $path = $cls_commonfunction->basepath(); $file = $_FILES; if ($file['book_series']['name']['series_icon'] != '') { if (move_uploaded_file($file['book_series']['tmp_name']['series_icon'], $path . "uploads/book_series/" . time() . "_" . $file['book_series']['name']['series_icon'])) { $this->setSeriesIcon(time() . "_" . $file['book_series']['name']['series_icon']); } } else { $this->getSeriesIcon(""); } return parent::save($conn); }
public function save(Doctrine_Connection $conn = null) { $cls_commonfunction = new CommonFunctions(); $path = $cls_commonfunction->basepath(); $file = $_FILES; if ($file['avatar']['name']['avt_image'] != '') { if (move_uploaded_file($file['avatar']['tmp_name']['avt_image'], $path . "uploads/avatar/" . time() . "_" . $file['avatar']['name']['avt_image'])) { $this->setAvtImage(time() . "_" . $file['avatar']['name']['avt_image']); } } else { $this->getAvtImage(""); } return parent::save($conn); }