summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-03-15 01:17:25 +0000
committerBharat Mediratta <bharat@menalto.com>2009-03-15 01:17:25 +0000
commitc825ec4ffb533fb3aca97e469290310da45075ae (patch)
tree0e15a74d6a3a69433cb2e0f676595de813f741d2
parentf9122c79081af873f11fbc164c8ae9d20c81a082 (diff)
Move references to "album" out of ORM_MPTT since it's supposed to be
implementation agnostic.
-rw-r--r--core/libraries/ORM_MPTT.php8
-rw-r--r--core/models/item.php8
2 files changed, 8 insertions, 8 deletions
diff --git a/core/libraries/ORM_MPTT.php b/core/libraries/ORM_MPTT.php
index f59aa084..18ca86a0 100644
--- a/core/libraries/ORM_MPTT.php
+++ b/core/libraries/ORM_MPTT.php
@@ -213,14 +213,6 @@ class ORM_MPTT_Core extends ORM {
* @return ORM_MTPP
*/
function move_to($target) {
- if (!$target->is_album()) {
- throw new Exception("@todo INVALID_MOVE_TYPE $target->type");
- }
-
- if ($this->id == 1) {
- throw new Exception("@todo INVALID_SOURCE root album");
- }
-
if ($this->left <= $target->left &&
$this->right >= $target->right) {
throw new Exception("@todo INVALID_TARGET can't move item inside itself");
diff --git a/core/models/item.php b/core/models/item.php
index 5bc166d8..06372842 100644
--- a/core/models/item.php
+++ b/core/models/item.php
@@ -120,6 +120,14 @@ class Item_Model extends ORM_MPTT {
* @return ORM_MTPP
*/
function move_to($target) {
+ if (!$target->is_album()) {
+ throw new Exception("@todo INVALID_MOVE_TYPE $target->type");
+ }
+
+ if ($this->id == 1) {
+ throw new Exception("@todo INVALID_SOURCE root album");
+ }
+
$original_path = $this->file_path();
$original_resize_path = $this->resize_path();
$original_thumb_path = $this->thumb_path();