root/trunk/app/models/result.php

Revision 843, 2.1 kB (checked in by aarkerio, 4 weeks ago)

Models extended

Line 
1<?php
2/**
3*  Karamelo E-Learning Platform
4*  Manuel Montoya 2002-2008
5*  Chipotle Software
6*  GPLv3 manuel<arroba>mononeurona<punto>org
7*  @version 0.3
8*/
9class Result extends AppModel {
10
11  public $name      = 'Result';
12   
13  public $belongsTo  = array(
14             'User' => array(
15                             'className'    => 'User',
16                             'foreignKey'   => 'user_id',
17                             'fields'       => 'id, username'
18                               ), 
19             'Test' => array(
20                             'className'    => 'Test',   
21                             'foreignKey'   => 'test_id',
22                             'fields'       => 'id, title'
23                              )
24             );
25   
26  public $validate = array(
27          'answer_id' => array(
28                      'rule'       => 'numeric',
29                      'allowEmpty' => false,         
30                      'required'   => true
31               ),
32                  'question_id' => array(
33                      'rule'       => 'numeric',
34                      'allowEmpty' => false,         
35                      'required'   => true                                                                                           
36                   ),                         
37          'vclassroom_id' => array(
38                      'rule'       => 'numeric', 
39                      'allowEmpty' => false,
40                      'on'         => 'create',
41                      'required'   => true
42                         ),                                                                                             
43                 'test_id' => array(
44                      'rule'       => 'numeric',                       
45              'allowEmpty' => false,
46                      'on'         => 'create', 
47                      'required'   => true
48              ),
49                 'user_id' => array(
50                      'rule'       => 'numeric',
51                      'on'         => 'create',   
52              'allowEmpty' => false, 
53                      'required'   => true
54                        )   
55  );
56}
57?>
Note: See TracBrowser for help on using the browser.