Kohana_Model_Collection_Promotion   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 11
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A not_expired() 0 8 2
1
<?php defined('SYSPATH') OR die('No direct script access.');
2
3
/**
4
 * @package    openbuildings\promotions
5
 * @author     Ivan Kerin <[email protected]>
6
 * @copyright  (c) 2013 OpenBuildings Ltd.
7
 * @license    http://spdx.org/licenses/BSD-3-Clause
8
 */
9
class Kohana_Model_Collection_Promotion extends Jam_Query_Builder_Collection {
10
11 1
	public function not_expired($current_time = NULL)
12
	{
13
		return $this
14 1
			->where_open()
15 1
				->where('expires_at', '=', NULL)
16 1
				->or_where('expires_at', '>=', date('Y-m-d H:i:s', $current_time ?: time()))
17 1
			->where_close();
18
	}
19
}
20