Skip to content

Instantly share code, notes, and snippets.

@kylejohnson
Created May 6, 2013 13:54
Show Gist options
  • Select an option

  • Save kylejohnson/5525307 to your computer and use it in GitHub Desktop.

Select an option

Save kylejohnson/5525307 to your computer and use it in GitHub Desktop.
function edit() {
if (!empty($this->data)) {
foreach ($this->data['Config'] as $key => $value) {
foreach ($value as $fieldName => $fieldValue) {
$id = intval($key);
$this->Config->id = $id;
$this->Config->read(); // Removing this has no affect
$this->Config->saveField($fieldName, $fieldValue, array('validate' => false, 'callbacks' => false));
$this->Config->create(); // Removing this has no affect
}
}
}
}
1 SELECT COUNT(*) AS `count` FROM `zm`.`Config` AS `Config` WHERE `Config`.`Id` = 109 1 1 0
2 SELECT `Config`.`Id`, `Config`.`Name`, `Config`.`Value`, `Config`.`Type`, `Config`.`DefaultValue`, `Config`.`Hint`, `Config`.`Pattern`, `Config`.`Format`, `Config`.`Prompt`, `Config`.`Help`, `Config`.`Category`, `Config`.`Readonly`, `Config`.`Requires` FROM `zm`.`Config` AS `Config` WHERE `Config`.`Id` = 110 LIMIT 1 1 1 0
3 SELECT COUNT(*) AS `count` FROM `zm`.`Config` AS `Config` WHERE `Config`.`Id` = 110 1 1 0
4 SELECT `Config`.`Id`, `Config`.`Name`, `Config`.`Value`, `Config`.`Type`, `Config`.`DefaultValue`, `Config`.`Hint`, `Config`.`Pattern`, `Config`.`Format`, `Config`.`Prompt`, `Config`.`Help`, `Config`.`Category`, `Config`.`Readonly`, `Config`.`Requires` FROM `zm`.`Config` AS `Config` WHERE `Config`.`Id` = 112 LIMIT 1 1 1 0
5 SELECT COUNT(*) AS `count` FROM `zm`.`Config` AS `Config` WHERE `Config`.`Id` = 112 1 1 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment