<?php
class Uredjaj extends AppModel {
	var $name = 'Uredjaj';
	var $useTable = 'uredjaj';
	var $displayField = 'naziv_uredjaja';
	
	var $validate = array(
		'customer_id' => array(
			'numeric' => array(
				'rule' => array('numeric'),
				'message' => 'Kupac je obavezan',
				'allowEmpty' => false,
			),
		),
	);
	
	var $belongsTo = array(
		'Customer' => array(
			'className' => 'Customer',
			'foreignKey' => 'customer_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);
	
	var $hasMany = array(
		'RadniNalog' => array(
			'className' => 'RadniNalog',
			'foreignKey' => 'uredjaj_id',
			'dependent' => false
		)
	);
}
