BasicRelationsBelongsTo.php | ||||
![]() | ||||
|
||||
![]() |
Coverage | ||||||||||
Classes | Functions / Methods | Lines | ||||||||
Total |
|
0.00% | 0 / 1 |
|
50.00% | 3 / 6 | CRAP |
|
23.53% | 4 / 17 |
BasicRelationsBelongsTo |
|
0.00% | 0 / 1 |
|
50.00% | 3 / 6 | 22.10 |
|
23.53% | 4 / 17 |
model($className=__CLASS__) |
|
100.00% | 1 / 1 | 1 |
|
100.00% | 1 / 1 | |||
tableName() |
|
100.00% | 1 / 1 | 1 |
|
100.00% | 1 / 1 | |||
rules() |
|
0.00% | 0 / 1 | 2 |
|
0.00% | 0 / 4 | |||
relations() |
|
100.00% | 1 / 1 | 1 |
|
100.00% | 2 / 2 | |||
attributeLabels() |
|
0.00% | 0 / 1 | 2 |
|
0.00% | 0 / 3 | |||
search() |
|
0.00% | 0 / 1 | 2 |
|
0.00% | 0 / 6 |
1 : <?php 2 : 3 : /** 4 : * This is the model class for table "tbl_basic_relations_belongs_to". 5 : * 6 : * The followings are the available columns in table 'tbl_basic_relations_belongs_to': 7 : * @property integer $id 8 : * @property string $column_belongs_to_content 9 : */ 10 : class BasicRelationsBelongsTo extends BasicRelationsModel { 11 : /** 12 : * Returns the static model of the specified AR class. 13 : * @return BasicRelationsBelongsTo the static model class 14 : */ 15 : public static function model($className=__CLASS__) { 16 4 : return parent::model($className); 17 : } 18 : 19 : /** 20 : * @return string the associated database table name 21 : */ 22 : public function tableName() { 23 10 : return 'tbl_basic_relations_belongs_to'; 24 : } 25 : 26 : /** 27 : * @return array validation rules for model attributes. 28 : */ 29 : public function rules() { 30 : return array( 31 0 : array ('column_belongs_to_content', 'required'), 32 0 : array ('column_belongs_to_content', 'length', 'max' => 255), 33 0 : array ('id, column_belongs_to_content', 'safe', 'on' => 'search'), 34 0 : ); 35 : } 36 : 37 : /** 38 : * @return array relational rules. 39 : */ 40 : public function relations() { 41 : return array( 42 1 : 'relation_has_many_mains' => array (self::HAS_MANY, 'BasicRelationsMain', 'column_belongs_to_id'), 43 1 : ); 44 : } 45 : 46 : /** 47 : * @return array customized attribute labels (name=>label) 48 : */ 49 : public function attributeLabels() { 50 : return array( 51 0 : 'id' => 'ID', 52 0 : 'column_belongs_to_content' => 'Column Belongs To Content', 53 0 : ); 54 : } 55 : 56 : /** 57 : * Retrieves a list of models based on the current search/filter conditions. 58 : * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions. 59 : */ 60 : public function search() { 61 0 : $criteria=new CDbCriteria; 62 0 : $criteria->compare('id',$this->id); 63 0 : $criteria->compare('column_belongs_to_content',$this->column_belongs_to_content,true); 64 0 : return new CActiveDataProvider('BasicRelationsBelongsTo', array( 65 0 : 'criteria'=>$criteria, 66 0 : )); 67 : } 68 : } |
![]() |
Generated by PHP_CodeCoverage 1.1.2 using PHP 5.4.4-14+deb7u2 and PHPUnit 3.6.10 at Tue Aug 13 16:58:12 CDT 2013. |