From 2cd889046e16ed3b737e4734b70ac240f6515b3a Mon Sep 17 00:00:00 2001 From: mattab Date: Fri, 5 Dec 2014 20:40:25 +1300 Subject: Refactoring without changing logic, so I can understand the code --- core/Segment/SegmentExpression.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/Segment') diff --git a/core/Segment/SegmentExpression.php b/core/Segment/SegmentExpression.php index 4078321ce0..10cf0294e3 100644 --- a/core/Segment/SegmentExpression.php +++ b/core/Segment/SegmentExpression.php @@ -48,7 +48,7 @@ class SegmentExpression public function isEmpty() { - return empty($this->string); + return count($this->tree) == 0; } protected $joins = array(); @@ -342,7 +342,7 @@ class SegmentExpression */ public function getSql() { - if (count($this->tree) == 0) { + if ($this->isEmpty()) { throw new Exception("Invalid segment, please specify a valid segment."); } $sql = ''; -- cgit v1.2.3