本文整理汇总了PHP中Family::save方法的典型用法代码示例。如果您正苦于以下问题:PHP Family::save方法的具体用法?PHP Family::save怎么用?PHP Family::save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Family
的用法示例。
在下文中一共展示了Family::save方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: store
/**
* Store a newly created resource in storage.
* POST /familylaws
*
* @return Response
*/
public function store()
{
$validator = Family::validate(Input::only('name', 'description'));
if ($validator->fails()) {
return Redirect::to('/allfamilyLaws')->withErrors($validator)->withInput(Input::all());
} else {
$family = new Family();
$family->name = Input::get('name');
$family->description = Input::get('description');
$family->save();
return Redirect::to('allfamilyLaws')->with('message', 'Family Law Practice Area was successfully created');
}
}
示例2: actionCreate
/**
* 录入
*
*/
public function actionCreate()
{
parent::_acl();
$model = new Family();
$imageList = $this->_gets->getPost('imageList');
$imageListSerialize = XUtils::imageListSerialize($imageList);
if (isset($_POST['Family'])) {
$acl = $this->_gets->getPost('acl');
$model->attributes = $_POST['Family'];
$model->actual_people = 0;
$model->pic_other = $imageListSerialize['dataSerialize'];
if ($model->save()) {
AdminLogger::_create(array('catalog' => 'create', 'intro' => '录入内容,ID:' . $model->id));
$this->redirect(array('index'));
}
}
$this->render('family_create', array('model' => $model, 'imageList' => $imageListSerialize['data']));
}
示例3: family
function family($employee_id = '')
{
$data['page_name'] = '<b>Personal Data Sheet</b>';
$data['section_name'] = '<b>Personal Information</b>';
$data['focus_field'] = 'spouse_lname';
$data['msg'] = '';
$e = new Employee_m();
$data['employee'] = $e->get_by_id($employee_id);
$family = new Family();
if (Input::get('op')) {
$family->get_by_employee_id($employee_id);
$family->employee_id = $employee_id;
$family->spouse_lname = Input::get('spouse_lname');
$family->spouse_fname = Input::get('spouse_fname');
$family->spouse_mname = Input::get('spouse_mname');
$family->spouse_occupation = Input::get('spouse_occupation');
$family->spouse_employer = Input::get('spouse_employer');
$family->spouse_biz_ad = Input::get('spouse_biz_ad');
$family->spouse_tel = Input::get('spouse_tel');
$family->father_lname = Input::get('father_lname');
$family->father_fname = Input::get('father_fname');
$family->father_mname = Input::get('father_mname');
$family->mother_lname = Input::get('mother_lname');
$family->mother_fname = Input::get('mother_fname');
$family->mother_mname = Input::get('mother_mname');
$family->save();
// Children
$c = new Children();
$c->get_by_employee_id($employee_id);
$c->delete_all();
$children = Input::get('children');
$children_birth_day = Input::get('children_birth_day');
$i = 0;
foreach ($children as $child) {
if ($child != "") {
$c = new Children();
$c->employee_id = $employee_id;
$c->children = $children[$i];
$c->birth_date = $children_birth_day[$i];
$c->save();
}
$i++;
}
$data['msg'] = 'Family Background has been saved!';
}
$family = new Family();
$data['family'] = $family->get_by_employee_id($employee_id);
// Children===================================================
$children = new Children();
$children->order_by('birth_date');
$children = $children->get_by_employee_id($employee_id);
$i = 0;
foreach ($children as $child) {
$data['children']['name'][] = $child->children;
$data['children']['birth_date'][] = $child->birth_date;
$i++;
}
if ($i <= 14) {
while ($i != 14) {
$data['children']['name'][] = '';
$data['children']['birth_date'][] = '';
$i++;
}
}
$data['selected'] = $e->office_id;
// Use for office listbox
$data['options'] = $this->options->office_options();
$data['employee_id'] = $employee_id;
$data['main_content'] = 'family';
return View::make('includes/template', $data);
}
示例4: addFamily
/**
* @before _secure
*/
public function addFamily()
{
$this->JSONview();
$view = $this->getActionView();
if (RequestMethods::post("action") == "patient") {
$email = RequestMethods::post("email");
$patient = null;
if (strlen($email) > 4) {
$patient = User::first(array("email = ?" => $email));
$m = "Email exists enter a different email";
}
$phone = RequestMethods::post("phone", "");
if (strlen($phone) >= 10) {
$patient = User::first(array("phone = ?" => $phone));
$m = "Phone already exists please choose a different one";
}
if ($patient) {
$view->set("success", false);
$view->set("message", $m);
return;
}
$patient = new User(array("name" => RequestMethods::post("name", ""), "email" => $email, "phone" => $phone, "password" => sha1($this->randomPassword()), "gender" => RequestMethods::post("gender", ""), "birthday" => RequestMethods::post("birthday", ""), "live" => 1));
$patient->save();
$family = new Family(array("user_id" => $this->user->id, "member_id" => $patient->id, "relation" => RequestMethods::post("relation")));
$family->save();
Location::saveRecord($patient);
if ($email) {
Mail::notify(array("template" => "notifyFamily", "subject" => "Getting Started on HealthLitmus.com", "user" => $patient, "patient" => $patient, "member" => $this->user, "family" => $family));
}
Mail::notify(array("template" => "addFamily", "subject" => "New Beneficiary Added {$patient->name} on HealthLitmus.com", "user" => $this->user, "mail" => $email, "patient" => $patient, "family" => $family));
$fs = Shared\Services\Patient::findFamily($this->user);
$view->set("patient", $patient);
$view->set("families", $fs);
$view->set("success", true);
}
//$this->redirect($_SERVER['HTTP_REFERER']);
}
示例5: save
function save()
{
$family = new Family();
$staff_id = $this->uri->segment(2);
$family->staff_fam_staff_id = $staff_id;
$family->staff_fam_order = $this->input->post('staff_fam_order');
$family->staff_fam_name = $this->input->post('staff_fam_name');
$family->staff_fam_birthdate = $this->input->post('staff_fam_birthdate');
$family->staff_fam_birthplace = $this->input->post('staff_fam_birthplace');
$family->staff_fam_sex = $this->input->post('staff_fam_sex');
$family->staff_fam_relation = $this->input->post('staff_fam_relation');
if ($family->save()) {
$this->session->set_flashdata('message', 'Family successfully created!');
redirect('staffs/' . $staff_id . '/families/index');
} else {
// Failed
$family->error_message('custom', 'Field required');
$msg = $family->error->custom;
$this->session->set_flashdata('message', $msg);
redirect('staff/' . $staff_id . '/families/add');
}
}
示例6: add_family
/**
* Add a family
*
* @param string $passkey
* @param string $strFamily
* @return string
*/
public function add_family($passkey, $strFamily)
{
if (!$this->check_passkey($passkey)) {
return self::FAIL_AUTH;
}
if (trim($strFamily) == '') {
//ignore blank families
return self::OK;
}
$family = Family::LoadByFamily($strFamily);
if (!$family) {
$family = new Family();
}
$family->family = $strFamily;
$family->request_url = _xls_seo_url($strFamily);
if (!$family->save()) {
Yii::log("SOAP ERROR : Error saving family {$strFamily} " . print_r($family->getErrors()), 'error', 'application.' . __CLASS__ . "." . __FUNCTION__);
return self::UNKNOWN_ERROR . " Error saving family {$strFamily} " . print_r($family->getErrors(), true);
}
return self::OK;
}
示例7: save_product
/**
* Save a product in the database (Create if need be)
*
* @param string $passkey
* @param int $intRowid
* @param string $strCode
* @param string $strName
* @param string $blbImage
* @param string $strClassName
* @param int $blnCurrent
* @param string $strDescription
* @param string $strDescriptionShort
* @param string $strFamily
* @param int $blnGiftCard
* @param int $blnInventoried
* @param double $fltInventory
* @param double $fltInventoryTotal
* @param int $blnMasterModel
* @param int $intMasterId
* @param string $strProductColor
* @param string $strProductSize
* @param double $fltProductHeight
* @param double $fltProductLength
* @param double $fltProductWidth
* @param double $fltProductWeight
* @param int $intTaxStatusId
* @param double $fltSell
* @param double $fltSellTaxInclusive
* @param double $fltSellWeb
* @param string $strUpc
* @param int $blnOnWeb
* @param string $strWebKeyword1
* @param string $strWebKeyword2
* @param string $strWebKeyword3
* @param int $blnFeatured
* @param int $intCategoryId
* @return string
* @throws SoapFault
*
* @soap
*/
public function save_product($passkey, $intRowid, $strCode, $strName, $blbImage, $strClassName, $blnCurrent, $strDescription, $strDescriptionShort, $strFamily, $blnGiftCard, $blnInventoried, $fltInventory, $fltInventoryTotal, $blnMasterModel, $intMasterId, $strProductColor, $strProductSize, $fltProductHeight, $fltProductLength, $fltProductWidth, $fltProductWeight, $intTaxStatusId, $fltSell, $fltSellTaxInclusive, $fltSellWeb, $strUpc, $blnOnWeb, $strWebKeyword1, $strWebKeyword2, $strWebKeyword3, $blnFeatured, $intCategoryId)
{
self::check_passkey($passkey);
// We must preservice the Rowid of Products within the Web Store
// database and must therefore see if it already exists
$objProduct = Product::model()->findByPk($intRowid);
if (!$objProduct) {
$objProduct = new Product();
$objProduct->id = $intRowid;
}
$strName = trim($strName);
$strName = trim($strName, '-');
$strName = substr($strName, 0, 255);
$strCode = trim($strCode);
$strCode = str_replace('"', '', $strCode);
$strCode = str_replace("'", '', $strCode);
if (empty($strName)) {
$strName = 'missing-name';
}
if (empty($strDescription)) {
$strDescription = '';
}
$objProduct->code = $strCode;
$objProduct->title = $strName;
//$objProduct->class_name = $strClassName;
$objProduct->current = $blnCurrent;
$objProduct->description_long = $strDescription;
$objProduct->description_short = $strDescriptionShort;
//$objProduct->family = $strFamily;
$objProduct->gift_card = $blnGiftCard;
$objProduct->inventoried = $blnInventoried;
$objProduct->inventory = $fltInventory;
$objProduct->inventory_total = $fltInventoryTotal;
$objProduct->master_model = $blnMasterModel;
if ($intMasterId > 0) {
$objProduct->parent = $intMasterId;
} else {
$objProduct->parent = null;
}
$objProduct->product_color = $strProductColor;
$objProduct->product_size = $strProductSize;
$objProduct->product_height = $fltProductHeight;
$objProduct->product_length = $fltProductLength;
$objProduct->product_width = $fltProductWidth;
$objProduct->product_weight = $fltProductWeight;
$objProduct->tax_status_id = $intTaxStatusId;
$objProduct->sell = $fltSell;
$objProduct->sell_tax_inclusive = $fltSellTaxInclusive;
//If we're in TaxIn Mode, then SellWeb has tax and we reverse it.
if (_xls_get_conf('TAX_INCLUSIVE_PRICING', 0) == 1) {
if ($fltSellWeb != 0) {
//Tax in with a sell on web price
$objProduct->sell_web_tax_inclusive = $fltSellWeb;
//LS sends tax in web already
$objProduct->sell_web = Tax::StripTaxesFromPrice($fltSellWeb, $intTaxStatusId);
} else {
//We use our regular prices and copy them price
$objProduct->sell_web_tax_inclusive = $fltSellTaxInclusive;
$objProduct->sell_web = $fltSell;
//.........这里部分代码省略.........