Kohana_Model_Auth_Role   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A initialize() 0 19 1
1
<?php defined('SYSPATH') OR die('No direct access allowed.');
2
/**
3
 * Default auth role
4
 *
5
 * @package	   Kohana/Auth
6
 * @author     Ivan Kerin
7
 * @copyright  (c) 2011-2012 Despark Ltd.
8
 * @author	   creatoro
9
 * @copyright  (c) 2011 creatoro
10
 * @license	   http://creativecommons.org/licenses/by-sa/3.0/legalcode
11
 */
12
class Kohana_Model_Auth_Role extends Jam_Model {
13
14
	public static function initialize(Jam_Meta $meta)
15
	{
16
		$meta
17
			->name_key('name')
18
19
			->fields(array(
20
				'id' => Jam::field('primary'),
21
				'name' => Jam::field('string'),
22
				'description' => Jam::field('string'),
23
			))
24
25
			->associations(array(
26
				'users' => Jam::association('manytomany'),
27
			))
28
29
			->validator('name', array('present' => TRUE, 'length' => array('minimum' => 4, 'maximum' => 32), 'unique' => TRUE))
30
			->validator('description', array('length' => array('maximum' => 255)));
31
32
	}
33
} // End Kohana_Model_Auth_Role