From c825ec4ffb533fb3aca97e469290310da45075ae Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 15 Mar 2009 01:17:25 +0000 Subject: Move references to "album" out of ORM_MPTT since it's supposed to be implementation agnostic. --- core/models/item.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'core/models') 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(); -- cgit v1.2.3