當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DataObject::save方法代碼示例

本文整理匯總了PHP中DataObject::save方法的典型用法代碼示例。如果您正苦於以下問題:PHP DataObject::save方法的具體用法?PHP DataObject::save怎麽用?PHP DataObject::save使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DataObject的用法示例。


在下文中一共展示了DataObject::save方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: save

 public function save($id, $data, $langId)
 {
     $addrId = 0;
     if (isset($data[$this->_formDataName])) {
         $oAdress = new AddressObject();
         $addr = $data[$this->_formDataName];
         //            $addrShip = $data['addressShipping'];
     }
     if (!empty($addr)) {
         $addrId = $oAdress->save($data[$this->_addressField], $addr, $langId);
         //            if ($addrShip['duplicate'] == 1)
         //            {
         //                $addrBill['A_Duplicate'] = $billId;
         //                $shipId = $oAdress->save($addrShip['MP_ShippingAddrId'], $addrBill, $langId);
         //            }
         //            else
         //            {
         //                $addrShip['A_Duplicate'] = 0;
         //                $shipId = $oAdress->save($addrShip['MP_ShippingAddrId'], $addrShip, $langId);
         //            }
         if (empty($data[$this->_addressField])) {
             $data[$this->_addressField] = $addrId;
         }
         //            $data['MP_ShippingAddrId'] = $shipId;
     }
     parent::save($id, $data, $langId);
 }
開發者ID:anunay,項目名稱:stentors,代碼行數:27,代碼來源:ParentProfilesObject.php

示例2: save

 public function save($source, &$errors = array())
 {
     if (!parent::save()) {
         return false;
     }
     return $this->update_owner_balance($errors);
 }
開發者ID:uzerpllp,項目名稱:uzerp,代碼行數:7,代碼來源:LedgerTransaction.php

示例3: save

 public function save($id, $data, $langId)
 {
     if (!isset($data['NP_Categories'])) {
         $data['NP_Categories'] = 0;
     }
     parent::save($id, $data, $langId);
 }
開發者ID:anunay,項目名稱:stentors,代碼行數:7,代碼來源:NewsletterProfilesObject.php

示例4: save

 public function save($id, $data, $langId)
 {
     $billId = 0;
     $shipId = 0;
     if (isset($data['addressFact'])) {
         $oAdress = new AddressObject();
         $addrBill = $data['addressFact'];
         $addrShip = $data['addressShipping'];
     }
     if (!empty($addrBill)) {
         $billId = $oAdress->save($addrBill['MP_BillingAddrId'], $addrBill, $langId);
         if ($addrShip['duplicate'] == 1) {
             $addrBill['A_Duplicate'] = $billId;
             $shipId = $oAdress->save($addrShip['MP_ShippingAddrId'], $addrBill, $langId);
         } else {
             $addrShip['A_Duplicate'] = 0;
             $shipId = $oAdress->save($addrShip['MP_ShippingAddrId'], $addrShip, $langId);
         }
         $data['MP_BillingAddrId'] = $billId;
         $data['MP_ShippingAddrId'] = $shipId;
     }
     $oYears = new YearsParticipateObject();
     $oYears->manageData($id, $data['MP_YearsParticipate']);
     $data['MP_BirthDate'] = $data['MP_BirthDateDt'];
     $years = $this->calculateAge($data['MP_BirthDate']);
     $data['MP_Age'] = $years;
     $data['MP_PassportExpiracyDate'] = $data['MP_PassportExpiracyDateDt'];
     if ($data['MP_BirthDate'] != $data['MP_PassportBirthDate']) {
         $data['MP_PassportBirthDate'] = $data['MP_BirthDate'];
     }
     parent::save($id, $data, $langId);
 }
開發者ID:anunay,項目名稱:stentors,代碼行數:32,代碼來源:MemberProfilesObject.php

示例5: save

 public function save($id, $data, $langId)
 {
     $oAddress = new AddressObject();
     $profile = parent::findData(array('R_GenericProfileId' => $id));
     $currentAddr = $profile[0]['R_RetailerAddressId'];
     $retailerId = $profile[0]['R_RetailerProfileId'];
     $retailer = $data['retailerForm'];
     //If customer doesn't want to add data on website, set to false the field name
     switch ($retailer['isDistributeur']) {
         case 1:
             $retailerData = array('R_Status' => $retailer['isDistributeur']);
             break;
         case 2:
             if ($currentAddr > 0) {
                 $retailerData = array('R_Active' => $retailer['R_Active'], 'R_Status' => $retailer['isDistributeur']);
                 $oAddress->save($currentAddr, $retailer, 1);
                 $oAddress->save($currentAddr, $data['retailerFormEn'], 2);
             } else {
                 $addressId = $oAddress->insert($retailer, 1);
                 $oAddress->save($addressId, $data['retailerFormEn'], 2);
                 $retailerData = array('R_GenericProfileId' => $id, 'R_RetailerAddressId' => $addressId, 'R_Status' => $retailer['isDistributeur'], 'R_Active' => $retailer['R_Active']);
             }
             break;
         default:
             break;
     }
     parent::save($retailerId, $retailerData, $langId);
 }
開發者ID:anunay,項目名稱:stentors,代碼行數:28,代碼來源:RetailersObject.php

示例6: save

 public function save(&$errors)
 {
     if ($this->balance < 0) {
         $errors[] = 'You do not have sufficient balance of ' . $this->stitem . ' at ' . $this->whlocation;
     } else {
         parent::save();
     }
 }
開發者ID:uzerpllp,項目名稱:uzerp,代碼行數:8,代碼來源:STBalance.php

示例7: save

 public function save($debug = false)
 {
     $db =& DB::Instance();
     $result = parent::save($debug);
     if ($result !== false) {
         $result = $db->UpdateBlobFile($this->_tablename, 'file', $this->tmp_name, 'id=' . $this->id);
     }
     return $result;
 }
開發者ID:uzerpllp,項目名稱:uzerp,代碼行數:9,代碼來源:File.php

示例8: save

 public function save($id, $data, $langId)
 {
     $addrId = $id;
     if (empty($id)) {
         $addrId = parent::insert($data, $langId);
     } else {
         parent::save($id, $data, $langId);
     }
     return $addrId;
 }
開發者ID:anunay,項目名稱:stentors,代碼行數:10,代碼來源:AddressObject.php

示例9: save

 /**
  * Extend save to update properties of parent-tasks
  */
 public function save($debug = false)
 {
     $res = parent::save($debug);
     $p_id = $this->parent_id;
     if ($res === false || empty($p_id)) {
         return $res;
     }
     $this->updateParent();
     return true;
 }
開發者ID:uzerpllp,項目名稱:uzerp,代碼行數:13,代碼來源:Task.php

示例10: save

 public function save($debug = false)
 {
     $db = DB::Instance();
     $db->StartTrans();
     $result = parent::save($debug);
     if ($result === false) {
         $db->FailTrans();
     }
     $db->CompleteTrans();
     return $result;
 }
開發者ID:uzerpllp,項目名稱:uzerp,代碼行數:11,代碼來源:Invoice.php

示例11: save

 function save(&$errors)
 {
     if (parent::save()) {
         foreach ($this->unsaved_lines as $line) {
             if (!$line->save()) {
                 $errors[] = 'Failed to save Transfer Line';
                 break;
             }
         }
     } else {
         $errors[] = 'Failed to save Transfer Header';
     }
 }
開發者ID:uzerpllp,項目名稱:uzerp,代碼行數:13,代碼來源:WHTransfer.php

示例12: save

 public function save($debug = false)
 {
     $db = DB::Instance();
     $db->startTrans();
     $result = parent::save($debug);
     if ($result === false) {
         $flash = Flash::Instance();
         $flash->addError('Error saving Order Header : ' . $db->ErrorMsg());
         $db->FailTrans();
     }
     $db->CompleteTrans();
     return $result;
 }
開發者ID:uzerpllp,項目名稱:uzerp,代碼行數:13,代碼來源:SPOrder.php

示例13: save

 public function save($id, $data, $langId)
 {
     parent::save($id, $data, $langId);
     if (is_array($data['DateRange'])) {
         $dateRangeObject = new EventsDateRange();
         $dateRangeObject->delete($this->_db->quoteInto('EDR_EventsDataID = ?', $id));
         foreach ($data['DateRange'] as $_range) {
             if (!empty($_range['from'])) {
                 $_range['to'] = !empty($_range['to']) ? $_range['to'] : $_range['from'];
                 $dateRangeObject->insert(array('EDR_EventsDataID' => $id, 'EDR_StartDate' => $_range['from'], 'EDR_EndDate' => $_range['to']));
             }
         }
     }
 }
開發者ID:anunay,項目名稱:stentors,代碼行數:14,代碼來源:EventsObject.php

示例14: save

 public function save($id, $data, $langId)
 {
     $addrId = 0;
     if (isset($data[$this->_formDataName])) {
         $oAdress = new AddressObject();
         $addr = $data[$this->_formDataName];
         //            $addrShip = $data['addressShipping'];
     }
     if (!empty($addr)) {
         $addrId = $oAdress->save($data[$this->_addressField], $addr, $langId);
     } else {
         $addrId = $oAdress->insert($data[$this->_formDataName], $langId);
     }
     if (empty($data[$this->_addressField])) {
         $data[$this->_addressField] = $addrId;
     }
     parent::save($id, $data, $langId);
 }
開發者ID:anunay,項目名稱:stentors,代碼行數:18,代碼來源:StaffProfilesObject.php

示例15: prepostprocess

 function prepostprocess()
 {
     $message = "";
     //prepostprocess//
     $this->rapyd->load("dataobject");
     $do = new DataObject("articles");
     $do->set("title", "New Post");
     $do->set("body", "New body");
     $do->set("public", "n");
     $do->post_process("insert", "relate_article_one");
     $saved = $do->save();
     $message = '<strong>$do->save()</strong><hr/>';
     if ($saved) {
         $art_id = $do->get("article_id");
         $message .= "record <strong>{$art_id}</strong> created.<br/>";
         $message .= nl2br(var_export($do->get_all(), true)) . "<hr/>";
         $message .= $do->post_process_result;
         $do->pre_process("delete", "remove_rel_toany_article");
         $deleted = $do->delete();
         $message .= '</div><br/><div class="note">';
         $message .= '<strong>$do->delete()</strong><hr/>';
         $message .= "<strong>remove_rel_toany_article()</strong> pre_process func.<hr/>";
         if ($deleted) {
             $message .= "OK, article {$art_id} is now not related with any article<hr/>";
             $message .= "record of article {$art_id} deleted<hr/>";
         } else {
             $message .= "pre_process fails, so article {$art_id} not deleted<hr/>";
         }
     } else {
         $message = "creation fails<br/>";
     }
     $data["content"] = $message;
     //endprepostprocess//
     $content["content"] = $this->load->view('rapyd/prepostprocess', $data, true);
     $content["rapyd_head"] = "";
     $content["code"] = highlight_code_file(THISFILE, "//prepostprocess//", "//endprepostprocess//");
     $content["code"] .= '<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #FF8000">//relate_article_one function<br /></span><br/>';
     $content["code"] .= highlight_code_file(THISFILE, "//relatearticleone//", "//endrelatearticleone//");
     $content["code"] .= '<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #FF8000">//remove_rel_toany_article function<br /></span><br/>';
     $content["code"] .= highlight_code_file(THISFILE, "//removerelarticle//", "//endremoverelarticle//");
     $this->load->view('rapyd/template', $content);
 }
開發者ID:codethics,項目名稱:proteoerp,代碼行數:42,代碼來源:datam.php


注:本文中的DataObject::save方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。