Skip to content


Subversion checkout URL

You can clone with
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

141 lines (131 sloc) 5.196 kB
* This is the model class for table "invoiceline".
* The followings are the available columns in table 'invoiceline':
* @property integer $InvoiceLineId
* @property integer $InvoiceId
* @property integer $TrackId
* @property string $UnitPrice
* @property integer $Quantity
class Invoiceline extends CActiveRecord
* Returns the static model of the specified AR class.
* @param string $className active record class name.
* @return Invoiceline the static model class
public static function model($className=__CLASS__)
return parent::model($className);
* @return string the associated database table name
public function tableName()
return 'invoiceline';
* @return array validation rules for model attributes.
public function rules()
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
array('InvoiceId, TrackId, UnitPrice, Quantity', 'required'),
array('InvoiceId, TrackId, Quantity', 'numerical', 'integerOnly'=>true),
array('UnitPrice', 'length', 'max'=>10),
// The following rule is used by search().
// Please remove those attributes that should not be searched.
array('InvoiceLineId, InvoiceId, TrackId, UnitPrice, Quantity', 'safe', 'on'=>'search'),
// Related field aliases allowed during search.
array('TrackName,Bytes,Composer,Milliseconds,UnitPrice,AlbumTitle,Artist,MediaType,LastName,FirstName,InvoiceDate', 'safe', 'on'=>'search'),
array('Genre,BillingCountry,SupportLastName,SupportFirstName,SupportPhone,SupportEmail', 'safe', 'on'=>'search'),
* (non-PHPdoc)
* @see CModel::behaviors()
public function behaviors() {
return array(
// Add RelatedSearchBehavior
* @return array relational rules.
public function relations()
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
// Test for
* @return array customized attribute labels (name=>label)
public function attributeLabels()
return array(
'InvoiceLineId' => 'Invoice Line',
'InvoiceId' => 'Invoice',
'TrackId' => 'Track',
'UnitPrice' => 'Unit Price',
'Quantity' => 'Quantity',
* Retrieves a list of models based on the current search/filter conditions.
* @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
public function search()
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria=new CDbCriteria;
/** Next line added/changed to used related search behavior */
return $this->relatedSearch(
// ,array('sort'=>array('defaultOrder'=>$this->getTableAlias(true,false).'.date DESC'))
Jump to Line
Something went wrong with that request. Please try again.