From bbe3bc05350c03b7e6d5d354920057006c5bbdcd Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Tue, 10 Feb 2009 06:21:08 +0000 Subject: [PATCH] MINOR Code formatting of ComponentSet::add() MINOR Removed unused variable $id in ComponentSet::add() git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71615 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/ComponentSet.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/core/model/ComponentSet.php b/core/model/ComponentSet.php index 5a0687404..5f804d5c9 100755 --- a/core/model/ComponentSet.php +++ b/core/model/ComponentSet.php @@ -84,18 +84,15 @@ class ComponentSet extends DataObjectSet { } if(is_object($item)) { - if(!is_a($item, $this->childClass)) { - user_error("ComponentSet::add() Tried to add an '{$item->class}' object, but a '{$this->childClass}' object expected", E_USER_ERROR); - } + if(!is_a($item, $this->childClass)) { + user_error("ComponentSet::add() Tried to add an '{$item->class}' object, but a '{$this->childClass}' object expected", E_USER_ERROR); + } } else { - $id = $item; - if(!$this->childClass) { user_error("ComponentSet::add() \$this->childClass not set", E_USER_ERROR); } - $item = DataObject::get_by_id($this->childClass, $item); - + $item = DataObject::get_by_id($this->childClass, $item); if(!$item) return; }