本文整理汇总了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);
}
示例2: save
public function save($source, &$errors = array())
{
if (!parent::save()) {
return false;
}
return $this->update_owner_balance($errors);
}
示例3: save
public function save($id, $data, $langId)
{
if (!isset($data['NP_Categories'])) {
$data['NP_Categories'] = 0;
}
parent::save($id, $data, $langId);
}
示例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);
}
示例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);
}
示例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();
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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';
}
}
示例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;
}
示例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']));
}
}
}
}
示例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);
}
示例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/> <span style="color: #FF8000">//relate_article_one function<br /></span><br/>';
$content["code"] .= highlight_code_file(THISFILE, "//relatearticleone//", "//endrelatearticleone//");
$content["code"] .= '<br/><br/> <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);
}