Hello,
I want to inject sql dependency for CActiveDataProvider. See below is my code returning CActiveDataProvider.
public function search() {
$CADP = parent::search(); // Instance of CActiveDataProvider
$CADP
->getCriteria()
->compare('id', $this->id)
->compare('application_code', $this->application_code, true)
->compare('first_name', $this->first_name)
->compare('last_name', $this->last_name)
->compare('date_of_birth', $this->date_of_birth, true)
->compare('designation', $this->designation, true)
->compare('company_name', $this->company_name, true)
->compare('email_id', $this->email_id, true)
->compare('phone_number', $this->phone_number, true)
->compare('heq_title_program_name', $this->heq_title_program_name, true)
->compare('heq_school_college_name', $this->heq_school_college_name, true)
->compare('heq_year_of_passing_out', $this->heq_year_of_passing_out)
->compare('total_experience_months', $this->total_experience_months)
->compare('work_history_current_organization', $this->work_history_current_organization, true)
->compare('work_history_current_domain_areas', $this->work_history_current_domain_areas, true)
->compare('work_history_current_tenure', $this->work_history_current_tenure)
->compare('work_history_current_work_location', $this->work_history_current_work_location, true)
->compare('registration_date', $this->registration_date, true)
->compare('final_submission_date', $this->final_submission_date, true)
->compare('approved_by', $this->approved_by)
->compare('approved_on', $this->approved_on)
->compare('approved', self::STATUS_ON_HOLD)
->compare('active', 1/* $this->active */)
->compare('deleted', 0/* $this->deleted */)
;
$CADP->sort = array(
'defaultOrder' => '`t`.`final_submission_date` DESC',
);
return $CADP;
}
Now, How can I inject dependency.
Normally I use as:
$model = SomeModel::model()->cache($dependency, 100)->findAll();
But how in this condition!