Kohana_Model_Terms_Item::initialize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 14
ccs 0
cts 8
cp 0
rs 9.7998
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php defined('SYSPATH') OR die('No direct script access.');
2
3
/**
4
 * @author     Ivan Kerin <[email protected]>
5
 * @copyright  (c) 2014 Clippings Ltd.
6
 * @license    http://spdx.org/licenses/BSD-3-Clause
7
 */
8
class Kohana_Model_Terms_Item extends Jam_Model {
9
10
	public static function initialize(Jam_Meta $meta)
11
	{
12
		$meta
13
			->name_key('id');
14
15
		$meta->associations(array(
16
			'term' => Jam::association('belongsto'),
17
			'item' => Jam::association('belongsto', array('polymorphic' => TRUE)),
18
		));
19
20
		$meta->fields(array(
21
			'id' => Jam::field('primary'),
22
		));
23
	}
24
}
25