当前位置: 首页>>代码示例>>PHP>>正文


PHP type::save方法代码示例

本文整理汇总了PHP中type::save方法的典型用法代码示例。如果您正苦于以下问题:PHP type::save方法的具体用法?PHP type::save怎么用?PHP type::save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在type的用法示例。


在下文中一共展示了type::save方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: lastSeenEvent

 /**
  * Event - triggered every beforeFilter-callback.
  * Sets the date and time when the user is last seen.
  *
  * @param \Cake\Event\Event $event Event.
  * @return void
  */
 public function lastSeenEvent($event)
 {
     $user = $this->_getUsermetas();
     if ($user) {
         $user->set('last_seen', Time::now());
         $this->Usermetas->save($user);
     }
 }
开发者ID:jxav,项目名称:cakephp-whosonline,代码行数:15,代码来源:WhosOnlineComponent.php

示例2: get

 /** Perform a curl request based on url provided
  * @access public
  * @uses Zend_Cache
  * @uses Zend_Json_Decoder
  * @param string $method
  * @param array $params
  */
 public function get($method, array $params)
 {
     $this->_url = $this->_createUrl($method, $params);
     if (!$this->_cache->test(md5($this->_url))) {
         $config = array('adapter' => 'Zend_Http_Client_Adapter_Curl', 'curloptions' => array(CURLOPT_POST => true, CURLOPT_USERAGENT => $this->_getUserAgent(), CURLOPT_FOLLOWLOCATION => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_LOW_SPEED_TIME => 1));
         $client = new Zend_Http_Client($this->_url, $config);
         $response = $client->request();
         $data = $response->getBody();
         $this->_cache->save($data);
     } else {
         $data = $this->_cache->load(md5($this->_url));
     }
     if ($this->getFormat() === 'json') {
         return $this->_decoder($data);
     } else {
         return $data;
     }
 }
开发者ID:lesleyauk,项目名称:findsorguk,代码行数:25,代码来源:Edina.php

示例3: save_codejercicio

 /**
  * Establece un ejercicio como predeterminado para este usuario
  * @param type $cod el código del ejercicio
  */
 protected function save_codejercicio($cod)
 {
     if ($cod != $this->user->codejercicio) {
         $this->default_items->set_codejercicio($cod);
         $this->user->codejercicio = $cod;
         if (!$this->user->save()) {
             $this->new_error_msg('Error al establecer el ejercicio ' . $cod . ' como ejercicio predeterminado para este usuario.');
         }
     }
 }
开发者ID:BGCX067,项目名称:facturascripts-svn-to-git,代码行数:14,代码来源:fs_controller.php

示例4: addOrUpdateGlobalStatus

 /**
  * add or update global status (query)
  * @param type $o
  * @param type $data
  */
 protected function addOrUpdateGlobalStatus($o, $data)
 {
     $o->name = $data['name'];
     $o->manual_order = $data['manual_order'];
     $o->color = $data['color'];
     $flags = array('flag_first' => 0, 'flag_unreg' => 0, 'flag_error' => 0, 'flag_payment' => 0, 'flag_delivery' => 0, 'flag_close' => 0, 'secret' => 0);
     if (!empty($data['flag'])) {
         $flags[$data['flag']] = 1;
     }
     $o->fill($flags);
     $o->save();
 }
开发者ID:artemsk,项目名称:veer-core,代码行数:17,代码来源:Status.php

示例5: create_item

 /**
  * Создание категории точек на Google Maps
  * @param type $page_id ID страницы
  * @param type $model Ссылка на обрабатываемую модель
  */
 public function create_item($page_id = null, $model)
 {
     $controller = Yii::app()->getController();
     if (isset($_POST['ModuleYmapsCategories'])) {
         $_POST['ModuleYmapsCategories']['mpage_id'] = ModulesInPages::model()->getLink($page_id, $this->module_id);
         $model->attributes = $_POST['ModuleYmapsCategories'];
         if ($model->save()) {
             Yii::app()->user->setFlash($this->module_id . '_add_message', '<p style="color:green;">Добавлено</p>');
             $controller->redirect(Yii::app()->baseUrl . '?r=pages/update&id=' . $page_id . '&/#!/tab_' . $this->module_id);
         } else {
             Yii::app()->user->setFlash($this->module_id . '_add_message', '<p style="color:red;">Ошибка</p>');
         }
     }
 }
开发者ID:arduanov,项目名称:eco,代码行数:19,代码来源:Module_ymaps.php

示例6: resourceToModel

 /**
  * @param type $res
  * @param type $measurement
  *
  * @return type
  */
 public function resourceToModel($res, $measurement)
 {
     //$measurement->patient_id = $res->patient_id;
     foreach ($res as $key => $value) {
         if ($key == 'resourceType') {
             continue;
         }
         $measurement->{$key} = $value;
     }
     $saved = $measurement->save();
     if (!$saved) {
         print_r($measurement->getErrors());
     }
     return $measurement;
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:21,代码来源:MeasurementIOLMasterService.php

示例7: save

 /**
  * Saves the profile field type
  *
  * The settings/configuration for a ProfileFieldType are saved in ProfileField
  * in attribute "field_type_config" as JSON data.
  *
  * The ProfileFieldType Class itself can overwrite this behavior.
  */
 public function save()
 {
     $data = array();
     foreach ($this->attributeNames() as $attributeName) {
         // Dont save profile field attribute
         if ($attributeName == 'profileField') {
             continue;
         }
         $data[$attributeName] = $this->{$attributeName};
     }
     $this->profileField->field_type_config = CJSON::encode($data);
     $this->profileField->save();
     // Clear Database Schema
     Yii::app()->db->schema->getTable('profile', true);
     Profile::model()->refreshMetaData();
 }
开发者ID:alefernie,项目名称:intranet,代码行数:24,代码来源:ProfileFieldType.php

示例8: save

 /**
  * Saves the profile field type
  *
  * The settings/configuration for a ProfileFieldType are saved in ProfileField
  * in attribute "field_type_config" as JSON data.
  *
  * The ProfileFieldType Class itself can overwrite this behavior.
  */
 public function save()
 {
     $data = array();
     foreach ($this->attributes as $attributeName => $value) {
         // Dont save profile field attribute
         if ($attributeName == 'profileField') {
             continue;
         }
         $data[$attributeName] = $this->{$attributeName};
     }
     $this->profileField->field_type_config = \yii\helpers\Json::encode($data);
     if (!$this->profileField->save()) {
         throw new \yii\base\Exception("Could not save profile field!");
     }
     // Clear Database Schema
     Yii::$app->getDb()->getSchema()->getTableSchema(\humhub\modules\user\models\Profile::tableName(), true);
     return true;
 }
开发者ID:kreativmind,项目名称:humhub,代码行数:26,代码来源:BaseType.php

示例9: run

 /**
  * This method prepares the response of the current element based on the
  * $bean object and the $flowData, an external action such as
  * ROUTE or ADHOC_REASSIGN could be also processed.
  *
  * This method probably should be override for each new element, but it's
  * not mandatory. However the response structure always must pass using
  * the 'prepareResponse' Method.
  *
  * As defined in the example:
  *
  * $response['route_action'] = 'ROUTE'; //The action that should process the Router
  * $response['flow_action'] = 'CREATE'; //The record action that should process the router
  * $response['flow_data'] = $flowData; //The current flowData
  * $response['flow_filters'] = array('first_id', 'second_id'); //This attribute is used to filter the execution of the following elements
  * $response['flow_id'] = $flowData['id']; // The flowData id if present
  *
  *
  * @param type $flowData
  * @param type $bean
  * @param type $externalAction
  * @return type
  */
 public function run($flowData, $bean = null, $externalAction = '', $arguments = array())
 {
     switch ($externalAction) {
         case 'RESUME_EXECUTION':
             $flowAction = 'UPDATE';
             break;
         default:
             $flowAction = 'CREATE';
             break;
     }
     $bpmnElement = $this->retrieveDefinitionData($flowData['bpmn_id']);
     $act_assign_user = $bpmnElement['act_assign_user'];
     $userData = $this->retrieveUserData($act_assign_user);
     if (isset($bean->field_name_map['assigned_user_id']) && (isset($userData->id) && $userData->id == $act_assign_user)) {
         $this->logger->debug("Assign user to '{$act_assign_user}'");
         $bean->skipPartialUpdate = true;
         $historyData = $this->retrieveHistoryData($flowData['cas_sugar_module']);
         $historyData->savePreData('assigned_user_id', $flowData['cas_user_id']);
         //$bean->assigned_user_id = $act_assign_user;
         if (isset($bpmnElement['act_update_record_owner']) && $bpmnElement['act_update_record_owner'] == 1) {
             $bean->assigned_user_id = $act_assign_user;
             $bean->save();
         }
         $flowData['cas_user_id'] = $act_assign_user;
         $historyData->savePostData('assigned_user_id', $act_assign_user);
         //$bean->team_id = '1';
         $params = array();
         $params['cas_id'] = $flowData['cas_id'];
         $params['cas_index'] = $flowData['cas_index'];
         $params['act_id'] = $bpmnElement['id'];
         $params['pro_id'] = $bpmnElement['pro_id'];
         $params['user_id'] = $this->currentUser->id;
         $params['frm_action'] = 'Assing user';
         $params['frm_comment'] = 'Assing user Applied';
         $params['log_data'] = $historyData->getLog();
         $this->caseFlowHandler->saveFormAction($params);
         // just update the record instead
         //$query = "update pmse_bpm_flow set " .
         //    " cas_user_id = '$act_assign_user' " .
         //    " where cas_id = {$flowData['cas_id']} and cas_index = {$flowData['cas_index']} ";
         //$bean->db->query($query);
     }
     return $this->prepareResponse($flowData, 'ROUTE', $flowAction);
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:67,代码来源:PMSEAssignUser.php

示例10: updateProcessDefinition

 /**
  *
  * @param type $args
  */
 public function updateProcessDefinition($args)
 {
     $this->initWrapper();
     //Update ProcessDefinition
     $this->processDefinition = $this->getBean('pmse_BpmProcessDefinition')->retrieve_by_string_fields(array('prj_id' => $args['record']));
     //Update Diagrams
     $this->diagram = $this->getBean('pmse_BpmnDiagram')->retrieve_by_string_fields(array('prj_id' => $args['record']));
     //Update Process
     $this->process = $this->getBean('pmse_BpmnProcess')->retrieve_by_string_fields(array('prj_id' => $args['record']));
     foreach ($args as $key => $value) {
         $this->diagram->{$key} = $value;
         $this->process->{$key} = $value;
         $this->processDefinition->{$key} = $value;
     }
     $this->diagram->save();
     $this->process->save();
     $this->processDefinition->save();
     $this->notify();
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:23,代码来源:PMSEProjectWrapper.php

示例11: _cancelRefundOrder

 /**
  * Annulation des remboursement de la commande
  * @param type $order
  */
 protected function _cancelRefundOrder($order)
 {
     //On mets tous les champs relatifs au remboursement à NULL
     $order->setBaseDiscountRefunded(NULL);
     $order->setBaseShippingTaxRefunded(NULL);
     $order->setBaseSubtotalRefunded(NULL);
     $order->setBaseTaxRefunded(NULL);
     $order->setBaseTotalOfflineRefunded(NULL);
     $order->setBaseTotalOnlineRefunded(NULL);
     $order->setBaseTotalRefunded(NULL);
     $order->setBaseHiddenTaxRefunded(NULL);
     $order->setDiscountRefunded(NULL);
     $order->setShippingTaxRefunded(NULL);
     $order->setSubtotalRefunded(NULL);
     $order->setTaxRefunded(NULL);
     $order->setTotalOfflineRefunded(NULL);
     $order->setTotalOnlineRefunded(NULL);
     $order->setTotalRefunded(NULL);
     $order->setBaseHiddenTaxRefunded(NULL);
     $order->save();
 }
开发者ID:nenes25,项目名称:magento_creditMemo,代码行数:25,代码来源:CreditMemoController.php

示例12: update

 /**
  * Update user records
  * @param type $model
  */
 protected function update($model)
 {
     $model_class_name = $model->getClassName();
     if (isset($_POST[$model_class_name])) {
         $model->attributes = $_POST[$model_class_name];
         if ($model->save()) {
             Yii::app()->user->setFlash('success', Lang::t('SUCCESS_MESSAGE'));
             $this->refresh();
         }
     }
 }
开发者ID:jacjimus,项目名称:furahia_mis,代码行数:15,代码来源:DefaultController.php

示例13: atualizaAnaliseProrrogacao

 /**
  * 
  * @param type $prorrogacaoRow
  * @param type $observacao
  * @param type $atendimento
  * @param type $logon
  * @param type $dataInicial
  * @param type $dataFinal
  */
 public function atualizaAnaliseProrrogacao($prorrogacaoRow, $observacao, $atendimento, $logon, $dataInicial, $dataFinal)
 {
     $prorrogacaoRow->Observacao = $observacao;
     $prorrogacaoRow->Atendimento = $atendimento;
     $prorrogacaoRow->Logon = $logon;
     $prorrogacaoRow->DtInicio = Data::dataAmericana($dataInicial);
     $prorrogacaoRow->DtFinal = Data::dataAmericana($dataFinal);
     $prorrogacaoRow->save();
 }
开发者ID:hackultura,项目名称:novosalic,代码行数:18,代码来源:ProrrogacaoModel.php

示例14: getActivityContent

 /**
  * Return activity content by given user.
  *
  * This output is generated by current mode.
  *
  * @param type $user
  * @return string
  */
 private function getActivityContent($user)
 {
     $receive_email_activities = $user->getSetting("receive_email_activities", 'core', HSetting::Get('receive_email_activities', 'mailing'));
     // User never wants activity content
     if ($receive_email_activities == User::RECEIVE_EMAIL_NEVER) {
         return "";
     }
     // We are in hourly mode and user wants receive a daily summary
     if ($this->mode == 'hourly' && $receive_email_activities == User::RECEIVE_EMAIL_DAILY_SUMMARY) {
         return "";
     }
     // We are in daily mode and user wants receive not daily
     if ($this->mode == 'daily' && $receive_email_activities != User::RECEIVE_EMAIL_DAILY_SUMMARY) {
         return "";
     }
     // User is online and want only receive when offline
     if ($this->mode == 'hourly') {
         $isOnline = count($user->httpSessions) > 0;
         if ($receive_email_activities == User::RECEIVE_EMAIL_WHEN_OFFLINE && $isOnline) {
             return "";
         }
     }
     $lastMailDate = $user->last_activity_email;
     if ($lastMailDate == "" || $lastMailDate == "0000-00-00 00:00:00") {
         $lastMailDate = new CDbExpression('NOW() - INTERVAL 24 HOUR');
     }
     // Get Stream contents
     $action = new StreamAction(null, 'console');
     $action->mode = StreamAction::MODE_ACTIVITY;
     $action->type = Wall::TYPE_DASHBOARD;
     $action->userId = $user->id;
     $action->userWallId = $user->wall_id;
     $action->wallEntryLimit = 50;
     $action->wallEntryDateTo = $lastMailDate;
     $activities = $action->runConsole();
     # Save last run
     $user->last_activity_email = new CDbExpression('NOW()');
     $user->save();
     // Nothin new
     if ($activities['counter'] == 0) {
         return "";
     }
     // Return Output
     return $activities['output'];
 }
开发者ID:ahdail,项目名称:humhub,代码行数:53,代码来源:EMailing.php

示例15: _addStatusHistoryComment

 /**
  * @desc order comments or history
  * @param type $order
  * @param Varien_Object $response
  */
 protected function _addStatusHistoryComment($order, Varien_Object $response, $status = false)
 {
     Mage::log("_addStatusHistoryComment", Zend_Log::DEBUG, "adyen_notification.log", true);
     //notification
     $pspReference = $response->getData('pspReference');
     $success = trim($response->getData('success'));
     $success_result = strcmp($success, 'false') == 0 || !$success ? 'false' : 'true';
     $eventCode = $response->getData('eventCode');
     $reason = $response->getData('reason');
     $success = !empty($reason) ? "{$success_result} <br />reason:{$reason}" : $success_result;
     $klarnaReservationNumber = $response->getData('additionalData_additionalData_acquirerReference');
     $boletoPaidAmount = $response->getData('additionalData_boletobancario_paidAmount');
     //post
     $authResult = $response->getData('authResult');
     $pspReference = $response->getData('pspReference');
     //payment method
     $paymentMethod = $response->getData('paymentMethod');
     //data type
     $type = !empty($authResult) ? 'Adyen Result URL Notification(s):' : 'Adyen HTTP Notification(s):';
     switch ($type) {
         case 'Adyen Result URL Notification(s):':
             /*PCD*/
             // choose not to update the adyen_event_code in the order when the order is already on notification:Authorisation status and authresult = resultURL:Authorised
             if (!(substr($order->getAdyenEventCode(), 0, 13) == Adyen_Payment_Model_Event::ADYEN_EVENT_AUTHORISATION && $authResult == Adyen_Payment_Model_Event::ADYEN_EVENT_AUTHORISED)) {
                 Mage::log("Adyen Result URL order authResult:" . $authResult, Zend_Log::DEBUG, "adyen_notification.log", true);
                 $order->setAdyenEventCode($authResult);
             }
             $comment = Mage::helper('adyen')->__('%s <br /> authResult: %s <br /> pspReference: %s <br /> paymentMethod: %s', $type, $authResult, $pspReference, $paymentMethod);
             break;
         default:
             Mage::log("default order authResult:" . $eventCode . " : " . strtoupper($success_result), Zend_Log::DEBUG, "adyen_notification.log", true);
             if ($eventCode == Adyen_Payment_Model_Event::ADYEN_EVENT_REFUND) {
                 $currency = $order->getOrderCurrencyCode();
                 // check if it is a full or partial refund
                 $amount = Mage::helper('adyen')->formatAmount($response->getValue() / 100, $currency);
                 $orderAmount = Mage::helper('adyen')->formatAmount($order->getGrandTotal(), $currency);
                 if ($amount == $orderAmount) {
                     $order->setAdyenEventCode($eventCode . " : " . strtoupper($success_result));
                 } else {
                     $order->setAdyenEventCode("(PARTIAL) " . $eventCode . " : " . strtoupper($success_result));
                 }
             } else {
                 $order->setAdyenEventCode($eventCode . " : " . strtoupper($success_result));
             }
             // if payment method is klarna or openinvoice/afterpay show the reservartion number
             if (($paymentMethod == "klarna" || $paymentMethod == "afterpay_default" || $paymentMethod == "openinvoice") && ($klarnaReservationNumber != null && $klarnaReservationNumber != "")) {
                 $klarnaReservationNumberText = "<br /> reservationNumber: " . $klarnaReservationNumber;
             } else {
                 $klarnaReservationNumberText = "";
             }
             if ($boletoPaidAmount != null && $boletoPaidAmount != "") {
                 $boletoPaidAmountText = "<br /> Paid amount: " . $boletoPaidAmount;
             } else {
                 $boletoPaidAmountText = "";
             }
             $comment = Mage::helper('adyen')->__('%s <br /> eventCode: %s <br /> pspReference: %s <br /> paymentMethod: %s <br /> success: %s %s %s', $type, $eventCode, $pspReference, $paymentMethod, $success, $klarnaReservationNumberText, $boletoPaidAmountText);
             break;
     }
     $order->addStatusHistoryComment($comment, $status);
     $order->save();
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:66,代码来源:Process.php


注:本文中的type::save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。