本文整理汇总了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();
}
示例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);
}
示例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;
}
示例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));
}
}
示例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;
}
示例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;
}
示例7: save
/**
* {@inheritdoc}
* @see Scalr_Model::save()
*/
public function save($forceInsert = false)
{
return parent::save($forceInsert);
}
示例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;
}
示例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();
}
示例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);
}
}
示例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);
}
示例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);
}