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


PHP Scalr_Model::save方法代码示例

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


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

示例1: save

 public function save()
 {
     $id = $this->db->getOne('SELECT id FROM `account_teams` WHERE name = ? AND account_id = ?', array($this->name, $this->accountId));
     if ($id && $this->id != $id) {
         throw new Exception('Team with such name already exists');
     }
     return parent::save();
 }
开发者ID:rakesh-mohanta,项目名称:scalr,代码行数:8,代码来源:Team.php

示例2: save

 /**
  * {@inheritdoc}
  * @see Scalr_Model::save()
  */
 public function save($forceInsert = false)
 {
     if (!$this->id) {
         $forceInsert = true;
         $this->id = Scalr::GenerateUID(true);
     }
     parent::save($forceInsert);
 }
开发者ID:mheydt,项目名称:scalr,代码行数:12,代码来源:DeploymentTask.php

示例3: save

 /**
  * {@inheritdoc}
  * @see Scalr_Model::save()
  */
 public function save($forceInsert = false)
 {
     $id = $this->db->getOne('SELECT id FROM `account_teams` WHERE name = ? AND account_id = ? LIMIT 1', array($this->name, $this->accountId));
     if ($id && $this->id != $id) {
         throw new Exception('Team with such name already exists');
     }
     $ret = parent::save();
     return $ret;
 }
开发者ID:mheydt,项目名称:scalr,代码行数:13,代码来源:Team.php

示例4: save

 public function save($forceInsert = false)
 {
     parent::save();
     if ($this->preDeployScript !== false) {
         $this->db->Execute("UPDATE dm_applications SET pre_deploy_script = ? WHERE id = ?", array($this->preDeployScript, $this->id));
     }
     if ($this->postDeployScript !== false) {
         $this->db->Execute("UPDATE dm_applications SET post_deploy_script = ? WHERE id = ?", array($this->postDeployScript, $this->id));
     }
 }
开发者ID:rakesh-mohanta,项目名称:scalr,代码行数:10,代码来源:Application.php

示例5: save

 public function save()
 {
     parent::save();
     $this->db->Execute("DELETE FROM service_config_preset_data WHERE preset_id = ?", array($this->id));
     foreach ($this->parameters as $param) {
         if ($param->getValue() != null) {
             //Save params
             $this->db->Execute("INSERT INTO service_config_preset_data SET\n\t\t\t\t\t\t`preset_id`\t= ?,\n\t\t\t\t\t\t`key`\t\t= ?,\n\t\t\t\t\t\t`value`\t\t= ?\n\t\t\t\t\t", array($this->id, $param->getName(), $param->getValue()));
         }
     }
     return true;
 }
开发者ID:rakesh-mohanta,项目名称:scalr,代码行数:12,代码来源:ServiceConfiguration.php

示例6: save

 /**
  * {@inheritdoc}
  * @see Scalr_Model::save()
  */
 public function save($forceInsert = false)
 {
     parent::save($forceInsert);
     // Save parts
     if ($this->isPartsChanged && $this->id) {
         $this->db->Execute("DELETE FROM services_db_backup_parts WHERE backup_id = ?", array($this->id));
         foreach ($this->parts as $n => $part) {
             $this->db->Execute("INSERT INTO services_db_backup_parts SET\n                    `backup_id` \t= ?,\n                    `path`\t\t\t= ?,\n                    `size`\t\t\t= ?,\n                    `seq_number`\t= ?\n                ", array($this->id, $part['path'], $part['size'], $n + 1));
         }
     }
     return $this;
 }
开发者ID:mheydt,项目名称:scalr,代码行数:16,代码来源:Backup.php

示例7: save

 /**
  * {@inheritdoc}
  * @see Scalr_Model::save()
  */
 public function save($forceInsert = false)
 {
     return parent::save($forceInsert);
 }
开发者ID:mheydt,项目名称:scalr,代码行数:8,代码来源:Vhost.php

示例8: save

 /**
  * {@inheritdoc}
  * @see Scalr_Model::save()
  */
 public function save($forceInsert = false)
 {
     $ret = parent::save($forceInsert);
     if ($this->id && \Scalr::getContainer()->analytics->enabled) {
         \Scalr::getContainer()->analytics->tags->syncValue($this->accountId, \Scalr\Stats\CostAnalytics\Entity\TagEntity::TAG_ID_USER, $this->id, $this->fullname ?: $this->email);
     }
     return $ret;
 }
开发者ID:rickb838,项目名称:scalr,代码行数:12,代码来源:User.php

示例9: save

 /**
  * {@inheritdoc}
  * @see Scalr_Model::save()
  */
 public function save($forceInsert = false)
 {
     if ($this->db->GetOne("SELECT id FROM client_environments WHERE name = ? AND client_id = ? AND id != ? LIMIT 1", array($this->name, $this->clientId, $this->id))) {
         throw new Exception('This name already used');
     }
     parent::save();
 }
开发者ID:recipe,项目名称:scalr,代码行数:11,代码来源:Environment.php

示例10: save

 /**
  * {@inheritdoc}
  * @see Scalr_Model::save()
  */
 public function save($forceInsert = false)
 {
     if ($this->db->GetOne("SELECT id FROM client_environments WHERE name = ? AND client_id = ? AND id != ? LIMIT 1", array($this->name, $this->clientId, $this->id))) {
         throw new Exception('This name is already used');
     }
     parent::save();
     if ($this->id && \Scalr::getContainer()->analytics->enabled) {
         \Scalr::getContainer()->analytics->tags->syncValue($this->clientId, \Scalr\Stats\CostAnalytics\Entity\TagEntity::TAG_ID_ENVIRONMENT, $this->id, $this->name);
     }
 }
开发者ID:mheydt,项目名称:scalr,代码行数:14,代码来源:Environment.php

示例11: save

 /**
  * {@inheritdoc}
  * @see Scalr_Model::save()
  */
 public function save($forceInsert = false)
 {
     $this->httpdConf = str_replace(array("{literal}", "{/literal}"), array("", ""), $this->httpdConf);
     $this->httpdConfSsl = str_replace(array("{literal}", "{/literal}"), array("", ""), $this->httpdConfSsl);
     return parent::save($forceInsert);
 }
开发者ID:recipe,项目名称:scalr,代码行数:10,代码来源:Vhost.php

示例12: save

 /**
  * Save current object to database
  *
  * @param bool  $forceInsert    optional Force insert. (false by default)
  * @param array $ignoredFields  optional Fields that are not updated
  * @return Scalr_Model Return current object
  *
  * @throws  Exception
  */
 public function save($forceInsert = false, array $ignoredFields = null)
 {
     foreach ($ignoredFields ?: [] as $ignoredField) {
         if (array_key_exists($ignoredField, $this->dbPropertyMap)) {
             if (!is_array($this->dbPropertyMap[$ignoredField])) {
                 $this->dbPropertyMap[$ignoredField] = ['property' => $this->dbPropertyMap[$ignoredField]];
             }
             $this->dbPropertyMap[$ignoredField]['update'] = false;
         }
     }
     return parent::save($forceInsert);
 }
开发者ID:scalr,项目名称:scalr,代码行数:21,代码来源:FarmRoleMetric.php


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