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


PHP OnApp::save方法代碼示例

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


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

示例1: editAdminNote

 /**
  * Edit Administrator's Note
  *
  * @param int    $id         virtual machine id
  * @param string $admin_note Administrator's Note
  *
  * @return void
  */
 function editAdminNote($id, $admin_note)
 {
     if ($admin_note) {
         $this->_admin_note = $admin_note;
     }
     if ($id) {
         $this->_id = $id;
     }
     parent::save();
 }
開發者ID:jcomack,項目名稱:OnApp,代碼行數:18,代碼來源:VirtualMachine.php

示例2: save

 /**
  * The method saves an Object to your account
  *
  * After sending an API request to create an object or change the data in
  * the existing object, the method checks the response and loads the
  * exisitng object with the new data.
  *
  * This method can be closed for read only objects of the inherited class
  * <code>
  *    function save() {
  *        $this->logger->error(
  *            "Call to undefined method ".__CLASS__."::save()",
  *            __FILE__,
  *            __LINE__
  *        );
  *    }
  * </code>
  *
  * @return void
  * @access public
  */
 function save()
 {
     if (is_null($this->_limit)) {
         $this->_limit = isset($this->_limits->_limit) ? $this->_limits->_limit : (isset($this->_obj->_limits->_limit) ? $this->_obj->_limits->_limit : '');
     }
     if (is_null($this->_limit_free)) {
         $this->_limit_free = isset($this->_limits->_limit_free) ? $this->_limits->_limit_free : (isset($this->_obj->_limits->_limit_free) ? $this->_obj->_limits->_limit_free : '');
     }
     if (is_null($this->_price_on)) {
         $this->_price_on = isset($this->_prices->_price_on) ? $this->_prices->_price_on : (isset($this->_obj->_prices->_price_on) ? $this->_obj->_prices->_price_on : '');
     }
     if (is_null($this->_price_off)) {
         $this->_price_off = isset($this->_limits->_price_off) ? $this->_prices->_price_off : (isset($this->_obj->_prices->_price_off) ? $this->_obj->_prices->_price_off : "");
     }
     if (is_null($this->_price)) {
         $this->_price = isset($this->_limits->_price) ? $this->_prices->_price : (isset($this->_obj->_prices->_price) ? $this->_obj->_prices->_price : '');
     }
     return parent::save();
 }
開發者ID:jcomack,項目名稱:OnApp,代碼行數:40,代碼來源:BaseResource.php

示例3: save

 /**
  * The method saves an Object to your account
  *
  * @param integer $vm_id VM ID
  *
  * @return mixed Serialized API Response
  * @access private
  */
 function save()
 {
     if ($this->_virtual_machine_id) {
         $this->fields['require_format_disk'] = array(ONAPP_FIELD_MAP => '_require_format_disk', ONAPP_FIELD_TYPE => 'integer', ONAPP_FIELD_REQUIRED => true, ONAPP_FIELD_DEFAULT_VALUE => false);
     }
     if ($this->_id) {
         $this->fields['add_to_linux_fstab'][ONAPP_FIELD_REQUIRED] = false;
         $this->fields['data_store_id'][ONAPP_FIELD_REQUIRED] = false;
         $this->fields['is_swap'][ONAPP_FIELD_REQUIRED] = false;
         $this->fields['mount_point'][ONAPP_FIELD_REQUIRED] = false;
     }
     return parent::save();
 }
開發者ID:jcomack,項目名稱:OnApp,代碼行數:21,代碼來源:Disk.php

示例4: save

 /**
  * The method saves an Object to your account
  *
  * After sending an API request to create an object or change the data in
  * the existing object, the method checks the response and loads the
  * exisitng object with the new data.
  *
  * @return void
  * @access public
  */
 function save()
 {
     $fields = $this->fields;
     $_unset = array('priority', 'hostname', 'port', 'weight', 'ip', 'txt', 'serial', 'primaryNs', 'retry', 'refresh', 'minimum', 'expire', 'hostmaster');
     foreach ($_unset as $field) {
         $this->fields[$field][ONAPP_FIELD_REQUIRED] = false;
     }
     switch ($this->_type) {
         case 'MX':
             $this->fields['priority'][ONAPP_FIELD_REQUIRED] = $this->fields['hostname'][ONAPP_FIELD_REQUIRED] = true;
             break;
         case 'SRV':
             $this->fields['port'][ONAPP_FIELD_REQUIRED] = $this->fields['weight'][ONAPP_FIELD_REQUIRED] = $this->fields['priority'][ONAPP_FIELD_REQUIRED] = $this->fields['hostname'][ONAPP_FIELD_REQUIRED] = true;
             break;
         case 'A':
         case 'AAAA':
             $this->fields['ip'][ONAPP_FIELD_REQUIRED] = true;
             break;
         case 'CNAME':
         case 'NS':
             $this->fields['hostname'][ONAPP_FIELD_REQUIRED] = true;
             break;
         case 'TXT':
             $this->fields['txt'][ONAPP_FIELD_REQUIRED] = true;
             break;
         case 'SOA':
             trigger_error('Cannot save SOA record', E_USER_ERROR);
             break;
         default:
             trigger_error(sprintf("Cannot save '%s' record", $this->_type), E_USER_ERROR);
             break;
     }
     if (isset($this->_id)) {
         $obj = $this->_edit();
         $this->load();
     } else {
         return parent::save();
     }
     $this->fields = $fields;
 }
開發者ID:prado1991,項目名稱:OnApp-PHP-Wrapper-External,代碼行數:50,代碼來源:Record.php

示例5: save

 public function save()
 {
     if (count($this->_countries) == 0) {
         unset($this->fields['countries']);
     }
     return parent::save();
 }
開發者ID:jcomack,項目名稱:OnApp,代碼行數:7,代碼來源:CDNResource.php

示例6: save

 /**
  * The method saves an Object to your account
  *
  * After sending an API request to create an object or change the data in
  * the existing object, the method checks the response and loads the
  * exisitng object with the new data.
  *
  * @return void
  * @access public
  */
 function save()
 {
     if (isset($this->_id)) {
         $obj = $this->_edit();
         $this->load();
     } else {
         parent::save();
     }
 }
開發者ID:prado1991,項目名稱:OnApp-PHP-Wrapper-External,代碼行數:19,代碼來源:NetworkInterface.php

示例7: save

 function save()
 {
     $passowrd = $this->fields['passwords'];
     unset($this->fields['passwords']);
     if (is_null($this->_countries) && isset($this->_obj)) {
         $this->_countries = $this->_obj->_countries;
     } elseif (is_null($this->_countries)) {
         $this->_countries = array('');
     }
     if (is_null($this->_secondary_hostnames) && isset($this->_obj) && count($this->_obj->_secondary_hostnames) != 0) {
         $this->_secondary_hostnames = $this->_obj->_secondary_hostnames;
     } else {
         $this->_secondary_hostnames = array('');
     }
     $return = parent::save();
     $this->fields['passwords'] = $passowrd;
     return $return;
 }
開發者ID:jcomack,項目名稱:OnApp,代碼行數:18,代碼來源:Advanced.php

示例8: save

 function save()
 {
     if ($this->_target_id) {
         $this->fields['target_id'][ONAPP_FIELD_REQUIRED] = true;
         $this->fields['target_type'][ONAPP_FIELD_REQUIRED] = true;
         $this->fields['target_type'][ONAPP_FIELD_DEFAULT_VALUE] = 'Disk';
         $this->fields['action'][ONAPP_FIELD_REQUIRED] = true;
         $this->fields['action'][ONAPP_FIELD_DEFAULT_VALUE] = 'autobackup';
     }
     return parent::save();
 }
開發者ID:jcomack,項目名稱:OnApp,代碼行數:11,代碼來源:Schedule.php

示例9: save

 /**
  * Creates or edits Load Balancing Cluster
  *
  * @return mixed API query response
  */
 function save()
 {
     $this->fields['load_balancer_attributes'] = array(ONAPP_FIELD_MAP => '_load_balancer_attributes');
     $this->fields['load_balancing_cluster_load_balancer_attributes'] = array(ONAPP_FIELD_MAP => '_load_balancing_cluster_load_balancer_attributes');
     $this->fields['auto_scaling_out_memory_attributes'] = array(ONAPP_FIELD_MAP => '_auto_scaling_out_memory_attributes');
     $this->fields['auto_scaling_out_cpu_attributes'] = array(ONAPP_FIELD_MAP => '_auto_scaling_out_cpu_attributes');
     $this->fields['auto_scaling_in_memory_attributes'] = array(ONAPP_FIELD_MAP => '_auto_scaling_in_memory_attributes');
     $this->fields['auto_scaling_in_cpu_attributes'] = array(ONAPP_FIELD_MAP => '_auto_scaling_in_cpu_attributes');
     $this->fields['available_vms'] = array(ONAPP_FIELD_MAP => '_available_vms');
     $this->fields['image_template_id'] = array(ONAPP_FIELD_MAP => '_image_template_id');
     parent::save();
     $this->initFields($this->getAPIVersion());
     return $result;
 }
開發者ID:prado1991,項目名稱:OnApp-PHP-Wrapper-External,代碼行數:19,代碼來源:LoadBalancingCluster.php

示例10: save

 function save()
 {
     if ($this->_id) {
         $this->fields['hypervisor_group_id'][ONAPP_FIELD_REQUIRED] = false;
     }
     return parent::save();
 }
開發者ID:prado1991,項目名稱:OnApp-PHP-Wrapper-External,代碼行數:7,代碼來源:Hypervisor.php


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