| Conditions | 1 | 
| Paths | 1 | 
| Total Lines | 26 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Tests | 14 | 
| CRAP Score | 1 | 
| Changes | 0 | ||
| 1 | <?php defined('SYSPATH') OR die('No direct script access.'); | ||
| 10 | 1 | public static function initialize(Jam_Meta $meta) | |
| 11 | 	{ | ||
| 12 | $meta | ||
| 13 | 1 | 			->table('vocabularies') | |
| 14 | 1 | 			->name_key('name'); | |
| 15 | |||
| 16 | 1 | $meta->behaviors(array( | |
| 17 | 1 | 			'paranoid' => Jam::behavior('paranoid', array()), | |
| 18 | )); | ||
| 19 | |||
| 20 | 1 | $meta->associations(array( | |
| 21 | 1 | 			'terms' => Jam::association('hasmany', array('inverse_of' => 'vocabulary')), | |
| 22 | )); | ||
| 23 | |||
| 24 | 1 | $meta->fields(array( | |
| 25 | 1 | 			'id' => Jam::field('primary'), | |
| 26 | 1 | 			'name' => Jam::field('string'), | |
| 27 | |||
| 28 | // whether to show / hide the whole vocabulary from the frontend | ||
| 29 | 1 | 			'is_hidden' => Jam::field('boolean', array()), | |
| 30 | |||
| 31 | // Analitics | ||
| 32 | 1 | 			'created_at' => Jam::field('timestamp', array('auto_now_create' => TRUE, 'format' => 'Y-m-d H:i:s')), | |
| 33 | 1 | 			'updated_at' => Jam::field('timestamp', array('auto_now_update' => TRUE, 'format' => 'Y-m-d H:i:s', 'label' => "Last edited")), | |
| 34 | )); | ||
| 35 | } | ||
| 36 | } |