Guest User

TicketResponse Model Class

a guest
Oct 3rd, 2014
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.38 KB | None | 0 0
  1. <?php
  2. App::uses('AppModel', 'Model');
  3. /**
  4.  * TicketResponse Model
  5.  *
  6.  * @property Ticket $Ticket
  7.  */
  8. class TicketResponse extends AppModel {
  9.  
  10. /**
  11.  * Display field
  12.  *
  13.  * @var string
  14.  */
  15.     public $displayField = 'id';
  16.  
  17. /**
  18.  * Validation rules
  19.  *
  20.  * @var array
  21.  */
  22.     public $validate = array(
  23.         'ticket_id' => array(
  24.             'numeric' => array(
  25.                 'rule' => array('numeric'),
  26.                 //'message' => 'Your custom message here',
  27.                 //'allowEmpty' => false,
  28.                 //'required' => false,
  29.                 //'last' => false, // Stop validation after this rule
  30.                 //'on' => 'create', // Limit validation to 'create' or 'update' operations
  31.             ),
  32.         ),
  33.         'content' => array(
  34.             'notEmpty' => array(
  35.                 'rule' => array('notEmpty'),
  36.                 //'message' => 'Your custom message here',
  37.                 //'allowEmpty' => false,
  38.                 //'required' => false,
  39.                 //'last' => false, // Stop validation after this rule
  40.                 //'on' => 'create', // Limit validation to 'create' or 'update' operations
  41.             ),
  42.         ),
  43.         'email' => array(
  44.             'email' => array(
  45.                 'rule' => array('email'),
  46.                 //'message' => 'Your custom message here',
  47.                 //'allowEmpty' => false,
  48.                 //'required' => false,
  49.                 //'last' => false, // Stop validation after this rule
  50.                 //'on' => 'create', // Limit validation to 'create' or 'update' operations
  51.             ),
  52.         ),
  53.         'assignee_response' => array(
  54.             'boolean' => array(
  55.                 'rule' => array('boolean'),
  56.                 //'message' => 'Your custom message here',
  57.                 //'allowEmpty' => false,
  58.                 //'required' => false,
  59.                 //'last' => false, // Stop validation after this rule
  60.                 //'on' => 'create', // Limit validation to 'create' or 'update' operations
  61.             ),
  62.         ),
  63.     );
  64.  
  65.     //The Associations below have been created with all possible keys, those that are not needed can be removed
  66.  
  67. /**
  68.  * belongsTo associations
  69.  *
  70.  * @var array
  71.  */
  72.     public $belongsTo = array(
  73.         'Ticket' => array(
  74.             'className' => 'Ticket',
  75.             'foreignKey' => 'ticket_id',
  76.             'conditions' => '',
  77.             'fields' => '',
  78.             'order' => ''
  79.         )
  80.     );
  81.  
  82. /**
  83.  * hasMany associations
  84.  *
  85.  * @var array
  86.  */
  87.     public $hasMany = array(
  88.         'TicketAttachment' => array(
  89.             'className' => 'TicketAttachment',
  90.             'foreignKey' => 'ticket_response_id',
  91.             'dependent' => false,
  92.             'conditions' => '',
  93.             'fields' => '',
  94.             'order' => '',
  95.             'limit' => '',
  96.             'offset' => '',
  97.             'exclusive' => '',
  98.             'finderQuery' => '',
  99.             'counterQuery' => ''
  100.         )
  101.     );
  102. }
Advertisement
Add Comment
Please, Sign In to add comment