Changeset 660 for trunk/app/models

Show
Ignore:
Timestamp:
07/21/08 18:29:34 (4 months ago)
Author:
aarkerio
Message:

Update general

Location:
trunk/app/models
Files:
2 modified

Legend:

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

    r535 r660  
    11<?php 
    2 /**  MM GPLv3 **/ 
     2/**  Chipotle Software 2002-2008  GPLv3 **/ 
     3 
    34class Share extends AppModel { 
    4    public $name      = 'Share'; 
    55    
    6    public $belongsTo = 'User'; 
     6 public $belongsTo = array('User' => 
     7                   array('className'  => 'User', 
     8                         'conditions' => '', 
     9                     'order'      => '', 
     10                     'foreignKey' => 'user_id' 
     11                     ), 
     12                   'Subject' => 
     13               array('className'  => 'Subject', 
     14                         'conditions' => '', 
     15                     'order'      => null, 
     16                 'foreignKey' => 'subject_id' 
     17                         ) 
     18                      ); 
     19 
    720/* 
    821public $validate = array( 
     
    1124                                             'required' => true, 
    1225                                                         'message' => 'Alphabets and numbers only' 
    13                                    ), 
    14                                 'between' => array( 
    15                                            'rule' => array('between', 5, 15), 
    16                                                                                'message' => 'Between 5 to 15 characters' 
    17                                            ) 
    18                                 ), 
    19                        'password' => array( 
    20                                    'rule' => array('minLength', '8'), 
    21                                                                'message' => 'Mimimum 8 characters long' 
    22                                    ), 
    23                        'email' => 'email', 
    24                        'born' => array( 
     26                                             ), 
     27                     'between'      => array( 
     28                                          'rule' => array('between', 5, 15), 
     29                                                          'message' => 'Between 5 to 15 characters' 
     30                                         ) 
     31                ), 
     32          'password' => array('rule'        => array( 
     33                                                          'minLength', '8'), 
     34                                                          'message' => 'Mimimum 8 characters long' 
     35                              ), 
     36           'email' => 'email', 
     37           'born' => array( 
    2538                               'rule' => 'date', 
    2639                               'message' => 'Enter a valid date', 
    2740                                                           'allowEmpty' => true 
    2841                               ) 
    29                        ); */ 
     42         ); */ 
    3043} 
    3144?> 
  • trunk/app/models/subject.php

    r535 r660  
    99class Subject extends AppModel 
    1010{ 
    11     public $hasMany = array('Ecourse' => 
    12                          array('className'     => 'Ecourse', 
    13                                'conditions'    => null, 
    14                                'order'         => null, 
    15                                'limit'         => null, 
     11    public $hasMany = array('Lesson' => 
     12                         array('className'     => 'Lesson', 
     13                               'conditions'    => 'status=1', 
     14                               'order'         => 'id DESC', 
     15                               'limit'         => 10, 
     16                               'fields'        => 'id, title', 
    1617                               'foreignKey'    => 'subject_id', 
    1718                               'dependent'     => true, 
     
    1920                               'finderQuery'   => '' 
    2021                         ), 
    21              /*'Forum' => 
    22                          array('className'     => 'Forum', 
    23                                'conditions'    => null, 
     22             'Share' => 
     23                         array('className'     => 'Share', 
     24                               'conditions'    => 'public=1', 
    2425                               'order'         => null, 
    25                                'limit'         => null, 
     26                               'fields'        => 'secret, description', 
     27                               'limit'         => 10, 
    2628                               'foreignKey'    => 'subject_id', 
    2729                               'dependent'     => true, 
     
    2931                               'finderQuery'   => '' 
    3032                         ), 
    31              */ 
    3233                       'Entry' => 
    3334                         array('className'     => 'Entry', 
    34                                'conditions'    => null, 
    35                                'order'         => null, 
    36                                'limit'         => null, 
     35                               'conditions'    => 'status=1', 
     36                               'order'         => 'id DESC', 
     37                               'limit'         => 10, 
     38                               'fields'        => 'id, title', 
    3739                               'foreignKey'    => 'subject_id', 
    3840                               'dependent'     => true,