diff options
author | mattab <matthieu.aubry@gmail.com> | 2014-12-05 10:40:25 +0300 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2014-12-05 10:40:25 +0300 |
commit | 2cd889046e16ed3b737e4734b70ac240f6515b3a (patch) | |
tree | 5eec9a1d1b93379ae744a0040d2bf825eae7aaba /core/Segment | |
parent | 3980f9eeed4535032c1e563f39adf8efa4520914 (diff) |
Refactoring without changing logic, so I can understand the code
Diffstat (limited to 'core/Segment')
-rw-r--r-- | core/Segment/SegmentExpression.php | 4 |
1 files changed, 2 insertions, 2 deletions
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 = ''; |