当前位置: 首页>>代码示例>>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;未经允许,请勿转载。