- static public function create($subject, $title, $body, $signature, $promo_min, $promo_max, $date, $shortname = null)
- {
- $id = AXLetter::awaiting();
- if ($id) {
- return new AXLetter($id);
- }
- XDB::execute("INSERT INTO axletter (shortname, echeance, promo_min, promo_max,
- subject, title, body, signature,
- subject_ini, title_ini, body_ini, signature_ini)
- VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?})",
- $shortname, $date, $promo_min, $promo_max,
- $subject, $title, $body, $signature, $subject, $title, $body, $signature);
- return new AXLetter(XDB::insertId());
- }
-
- public function update($subject, $title, $body, $signature, $promo_min, $promo_max, $date, $shortname = null)
- {
- $this->_shortname = $shortname;
- $this->_title = $title;
- $this->_title_mail = $subject;
- $this->_body = $body;
- $this->_signature = $signature;
- $this->_promo_min = $promo_min;
- $this->_promo_max = $promo_max;
- $this->_date = $date;
- return XDB::execute("UPDATE axletter (shortname, subject, title, body, signature, promo_min, promo_max, echeance)
- SET shorname={?}, subject={?}, title={?}, body={?}, signature={?},
- promo_min={?}, promo_max={?}, echeance={?}
- WHERE id = {?}",
- $shortname, $subject, $title, $body, $signature, $promo_min, $promo_max, $date, $this->_id);
- }
-