BasicRelationsPivot.php | ||||
![]() | ||||
|
||||
![]() |
Coverage | ||||||||||
Classes | Functions / Methods | Lines | ||||||||
Total |
|
0.00% | 0 / 1 |
|
50.00% | 3 / 6 | CRAP |
|
25.00% | 5 / 20 |
BasicRelationsPivot |
|
0.00% | 0 / 1 |
|
50.00% | 3 / 6 | 21.19 |
|
25.00% | 5 / 20 |
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% | 3 / 3 | |||
attributeLabels() |
|
0.00% | 0 / 1 | 2 |
|
0.00% | 0 / 4 | |||
search() |
|
0.00% | 0 / 1 | 2 |
|
0.00% | 0 / 7 |
1 : <?php 2 : 3 : /** 4 : * This is the model class for table "tbl_basic_relations_pivot". 5 : * 6 : * The followings are the available columns in table 'tbl_basic_relations_pivot': 7 : * @property integer $id 8 : * @property integer $column_main_id 9 : * @property string $column_many_many_id 10 : */ 11 : class BasicRelationsPivot extends BasicRelationsModel { 12 : /** 13 : * Returns the static model of the specified AR class. 14 : * @return BasicRelationsPivot the static model class 15 : */ 16 : public static function model($className=__CLASS__) { 17 1 : return parent::model($className); 18 : } 19 : 20 : /** 21 : * @return string the associated database table name 22 : */ 23 : public function tableName() { 24 10 : return 'tbl_basic_relations_pivot'; 25 : } 26 : 27 : /** 28 : * @return array validation rules for model attributes. 29 : */ 30 : public function rules() { 31 : return array( 32 0 : array ('column_main_id', 'numerical', 'integerOnly' => true), 33 0 : array ('column_many_many_id', 'length', 'max' => 255), 34 0 : array ('id, column_main_id, column_many_many_id', 'safe', 'on' => 'search'), 35 0 : ); 36 : } 37 : 38 : /** 39 : * @return array relational rules. 40 : */ 41 : public function relations() { 42 : return array( 43 1 : 'relation_belongs_to_main' => array (self::BELONGS_TO, 'BasicRelationsMain', 'column_main_id'), 44 1 : 'relation_belongs_to_many_many' => array (self::BELONGS_TO, 'BasicRelationsManyMany', 'column_many_many_id'), 45 1 : ); 46 : } 47 : 48 : /** 49 : * @return array customized attribute labels (name=>label) 50 : */ 51 : public function attributeLabels() { 52 : return array( 53 0 : 'id' => 'ID', 54 0 : 'column_main_id' => 'Column Main ID', 55 0 : 'column_many_many_id' => 'Column Many Many ID', 56 0 : ); 57 : } 58 : 59 : /** 60 : * Retrieves a list of models based on the current search/filter conditions. 61 : * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions. 62 : */ 63 : public function search() { 64 0 : $criteria=new CDbCriteria; 65 0 : $criteria->compare('id',$this->id); 66 0 : $criteria->compare('column_main_id',$this->column_main_id); 67 0 : $criteria->compare('column_many_many_id',$this->column_many_many_id,true); 68 0 : return new CActiveDataProvider('BasicRelationsPivot', array( 69 0 : 'criteria'=>$criteria, 70 0 : )); 71 : } 72 : } |
![]() |
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. |