# shiftcontroller/2.1.0/application/config/relations.php

ShiftController Employee Shift Scheduling, version 2.1.0. 40 lines.

- Page: https://pluginprobe.com/plugins/shiftcontroller/2.1.0/code/application/config/relations.php
- Raw: https://pluginprobe.com/plugins/shiftcontroller/2.1.0/raw/application/config/relations.php
- Modified: 2013-11-19T19:08:10+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/shiftcontroller/2.1.0/code/application/config/relations.php#L10-L20`.

```php
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/* this file defines model relationships runtime if needed */
$CI =& ci_get_instance();
if( $CI->hc_modules->exists('notes') )
{
	$config['note']['has_one']['timeoff'] = array(
		'class'			=> 'timeoff_model',
		'other_field'	=> 'note',
		);
	$config['note']['has_one']['shift'] = array(
		'class'			=> 'shift_model',
		'other_field'	=> 'note',
		);
	$config['timeoff']['has_many']['note'] = array(
		'class'			=> 'note_model',
		'other_field'	=> 'timeoff',
		);
	$config['shift']['has_many']['note'] = array(
		'class'			=> 'note_model',
		'other_field'	=> 'shift',
		);
	$config['user']['has_many']['note'] = array(
		'class'			=> 'note_model',
		'other_field'	=> 'author',
		);
}

if( $CI->hc_modules->exists('shift_trades') )
{

	$config['shift']['has_one']['trade'] = array(
		'class'			=> 'trade_model',
		'other_field'	=> 'shift',
		);

	$config['user']['has_many']['trade'] = array(
		'class'			=> 'trade_model',
		'other_field'	=> 'to_user',
		);
}
```
