Changeset 702 for trunk/app/models

Show
Ignore:
Timestamp:
08/08/08 18:58:10 (4 months ago)
Author:
aarkerio
Message:

New validates

Location:
trunk/app/models
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/models/acquaintance.php

    r282 r702  
    33*  Chipotle Software TM 
    44*  Manuel Montoya 2002-2008 
    5 *  GPLv3 manuel<at>mononeurona<dot>org 
     5*  GPLv3 manuel<arroba>mononeurona<punto>org 
    66*/ 
    77class Acquaintance extends AppModel { 
    88    
    9    public $name = 'Acquaintance'; 
     9 public $name = 'Acquaintance'; 
    1010    
    11    public $belongsTo = 'User'; 
    12 } 
     11 public $belongsTo = 'User'; 
     12  
     13 public $validate = array( 
     14  'name' => array( 
     15                    'rule'       => array('minLength', 4), 
     16                    'message'    => 'Title must be at least four characters long', 
     17            'allowEmpty' => false, 
     18                    'required'   => true  
     19            ), 
     20       
     21  'url' => array( 
     22                    'rule'       => 'url', 
     23                    'message'    => 'Entry must be at least 8 characters long', 
     24            'allowEmpty' => false, 
     25                    'required'   => true  
     26            ) 
     27   ); 
     28    
     29 } 
    1330?> 
  • trunk/app/models/entry.php

    r701 r702  
    11<?php 
    2 //AppModel gives you all of Cake's Model functionality 
     2/** 
     3*  Chipotle Software TM 
     4*  Karamelo Team 2002-2008 
     5*  GPLv3 manuel<arroba>mononeurona<punto>org 
     6**/ 
     7 
    38 
    49class Entry extends AppModel 
     
    6267 
    6368  return $data; 
    64 } 
    65  
    66  
    67 /* 
    68 public $validate = array( 
    69         'login' => array('alphanumeric' => array( 
    70                                                  'rule' => 'alphaNumeric', 
    71                                              'required' => true, 
    72                                                          'message' => 'Alphabets and numbers only' 
    73                                    ), 
    74                                 'between' => array( 
    75                                            'rule' => array('between', 5, 15), 
    76                                                                                'message' => 'Between 5 to 15 characters' 
    77                                            ) 
    78                                 ), 
    79                        'password' => array( 
    80                                    'rule' => array('minLength', '8'), 
    81                                                                'message' => 'Mimimum 8 characters long' 
    82                                    ), 
    83                        'email' => 'email', 
    84                        'born' => array( 
    85                                'rule' => 'date', 
    86                                'message' => 'Enter a valid date', 
    87                                                            'allowEmpty' => true 
    88                                ) 
    89                        ); */ 
     69 } 
    9070} 
    9171?> 
  • trunk/app/models/poll.php

    r535 r702  
    2222                         ) 
    2323                  ); 
    24 /* 
    25 public $validate = array( 
    26         'login' => array('alphanumeric' => array( 
    27                                                  'rule' => 'alphaNumeric', 
    28                                              'required' => true, 
    29                                                          'message' => 'Alphabets and numbers only' 
    30                                    ), 
    31                                 'between' => array( 
    32                                            'rule' => array('between', 5, 15), 
    33                                                                                'message' => 'Between 5 to 15 characters' 
    34                                            ) 
    35                                 ), 
    36                        'password' => array( 
    37                                    'rule' => array('minLength', '8'), 
    38                                                                'message' => 'Mimimum 8 characters long' 
    39                                    ), 
    40                        'email' => 'email', 
    41                        'born' => array( 
    42                                'rule' => 'date', 
    43                                'message' => 'Enter a valid date', 
    44                                                            'allowEmpty' => true 
    45                                ) 
    46                        ); */ 
     24 public $validate = array( 
     25  'question' => array( 
     26                    'rule'       => array('minLength', 4), 
     27                    'message'    => 'Title must be at least four characters long', 
     28            'allowEmpty' => false, 
     29                    'required'   => true  
     30            ) 
     31   ); 
    4732} 
    4833?>