public function updateInfo($title, $image, $description, $repository, $con = null) { $this->row['title'] = $title; $this->row['description'] = $description; $this->row['repository'] = $repository; $old_icon_key = null; if ($image) { $old_icon_key = $this->value('icon_key'); $this->row['icon_key'] = ApplicationDb::uploadIcon($image, $this->getId()); } $this->update($con); if ($old_icon_key) { try { S3::delete($old_icon_key); } catch (Exception $e) { error_log(__METHOD__ . '(' . __LINE__ . '): ' . get_class($e) . ":{$e->getMessage()}"); // 画像削除は失敗しても気にしない } } }