~fusonic/chive/1.1

« back to all changes in this revision

Viewing changes to protected/models/Schema.php

  • Committer: Matthias Burtscher
  • Date: 2010-02-12 09:12:35 UTC
  • Revision ID: matthias.burtscher@fusonic.net-20100212091235-jqxrb62klx872ajc
* Updated Yii to 1.1.0
* Removed CodePress and CodeMirror
* Updated jQuery and some plugins
* Cleaned some code ...

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
        public $DEFAULT_COLLATION_NAME = Collation::DEFAULT_COLLATION;
30
30
 
31
31
        /**
32
 
         * @see         CActiveRecord::model()
 
32
         * @see         ActiveRecord::model()
33
33
         */
34
34
        public static function model($className = __CLASS__)
35
35
        {
37
37
        }
38
38
 
39
39
        /**
40
 
         * @see         CActiveRecord::tableName()
 
40
         * @see         ActiveRecord::tableName()
41
41
         */
42
42
        public function tableName()
43
43
        {
45
45
        }
46
46
 
47
47
        /**
48
 
         * @see         CActiveRecord::primaryKey()
 
48
         * @see         ActiveRecord::primaryKey()
49
49
         */
50
50
        public function primaryKey()
51
51
        {
53
53
        }
54
54
 
55
55
        /**
56
 
         * @see         CActiveRecord::safeAttributes()
 
56
         * @see         ActiveRecord::rules()
57
57
         */
58
 
        public function safeAttributes()
 
58
        public function rules()
59
59
        {
60
60
                return array(
61
 
                        'SCHEMA_NAME',
62
 
                        'DEFAULT_COLLATION_NAME',
 
61
                        array('SCHEMA_NAME', 'type', 'type' => 'string'),
 
62
                        array('DEFAULT_COLLATION_NAME', 'type', 'type' => 'string'),
63
63
                );
64
64
        }
65
65
 
66
66
        /**
67
 
         * @see         CActiveRecord::relations()
 
67
         * @see         ActiveRecord::relations()
68
68
         */
69
69
        public function relations()
70
70
        {
71
71
                return array(
72
 
                        'tables' => array(self::HAS_MANY, 'Table', 'TABLE_SCHEMA', 'condition' => '??.TABLE_TYPE IS NULL OR ??.TABLE_TYPE NOT IN (\'VIEW\')'),
 
72
                        'tables' => array(self::HAS_MANY, 'Table', 'TABLE_SCHEMA', 'condition' => 'tables.TABLE_TYPE IS NULL OR tables.TABLE_TYPE NOT IN (\'VIEW\')'),
73
73
                        'views' => array(self::HAS_MANY, 'View', 'TABLE_SCHEMA'),
74
74
                        'collation' => array(self::BELONGS_TO, 'Collation', 'DEFAULT_COLLATION_NAME'),
75
75
                        'routines' => array(self::HAS_MANY, 'Routine', 'ROUTINE_SCHEMA'),
77
77
        }
78
78
 
79
79
        /**
80
 
         * @see         CActiveRecord::attributeLabels()
 
80
         * @see         ActiveRecord::attributeLabels()
81
81
         */
82
82
        public function attributeLabels()
83
83
        {