22.07.2013 Views

download - Index of

download - Index of

download - Index of

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

**<br />

* @return array relational rules.<br />

*/<br />

public function relations()<br />

{<br />

// NOTE: you may need to adjust the relation name and the<br />

related<br />

// class name for the relations automatically generated<br />

below.<br />

return array(<br />

);<br />

}<br />

/**<br />

* @return array customized attribute labels (name=>label)<br />

*/<br />

public function attributeLabels()<br />

{<br />

return array(<br />

'id' => 'ID',<br />

'nama' => 'Nama',<br />

'alamat' => 'Alamat',<br />

);<br />

}<br />

/**<br />

* Retrieves a list <strong>of</strong> models based on the current<br />

search/filter conditions.<br />

* @return CActiveDataProvider the data provider that can<br />

return the models based on the search/filter conditions.<br />

*/<br />

public function search()<br />

{<br />

// Warning: Please modify the following code to remove<br />

attributes that<br />

// should not be searched.<br />

}<br />

}<br />

$criteria=new CDbCriteria;<br />

$criteria->compare('id',$this->id);<br />

$criteria->compare('nama',$this->nama,true);<br />

$criteria->compare('alamat',$this->alamat,true);<br />

return new CActiveDataProvider(get_class($this), array(<br />

'criteria'=>$criteria,<br />

));<br />

Beberapa bagian code di atas sudah pernah kita bahas di bagian<br />

pembahasan tentang AR Model (silahkan buka kembali halaman sebelumnya kalo<br />

Page 52

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!