diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-06-15 17:17:25 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-06-15 17:17:25 -0700 |
commit | 48dc07dbc8189eb16f97b7013b0481982286ab2c (patch) | |
tree | dfe6b59e175ed11e6e352260e81950fc71550547 /modules/gallery/helpers/item_rest.php | |
parent | 8fb56abf034dd1f5c561e7af12bf6e097a3de6f6 (diff) |
Revert "Fix for ticket #1118. Create a item::save_with_retries helper
method, which encapsulates saving an item and handling name and slug
conflicts. Call this instead of doing a save directly."
Rolled this back because it fails KISS. We already have an API for
saving models with Item_Model::save() that's consistent with all of
our other model code. Adding a new way to save items is confusing and
inconsistent.
This reverts commit 9504f71efcadc7ed27f6f09e5d663e8025bf3b86.
Diffstat (limited to 'modules/gallery/helpers/item_rest.php')
-rw-r--r-- | modules/gallery/helpers/item_rest.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/gallery/helpers/item_rest.php b/modules/gallery/helpers/item_rest.php index 74fab2e7..692d0895 100644 --- a/modules/gallery/helpers/item_rest.php +++ b/modules/gallery/helpers/item_rest.php @@ -112,6 +112,8 @@ class item_rest_Core { } break; + case "parent": + break; default: if (property_exists($entity, $key)) { $item->$key = $entity->$key; @@ -124,7 +126,7 @@ class item_rest_Core { $parent = rest::resolve($entity->parent); item::move($item, $parent); } else { - $item::save_with_retries($item); + $item->save(); } } @@ -155,7 +157,7 @@ class item_rest_Core { $item->title = isset($entity->title) ? $entity->title : $entity->name; $item->description = isset($entity->description) ? $entity->description : null; $item->slug = isset($entity->slug) ? $entity->slug : null; - $item::save_with_retries($item); + $item->save(); break; case "photo": @@ -170,7 +172,7 @@ class item_rest_Core { $item->title = isset($entity->title) ? $entity->title : $entity->name; $item->description = isset($entity->description) ? $entity->description : null; $item->slug = isset($entity->slug) ? $entity->slug : null; - $item::save_with_retries($item); + $item->save(); break; default: |