Skip to content
This repository has been archived by the owner on Sep 4, 2022. It is now read-only.

ref 31 is not solved still: reopen #33

Open
yavasura opened this issue Mar 13, 2013 · 1 comment
Open

ref 31 is not solved still: reopen #33

yavasura opened this issue Mar 13, 2013 · 1 comment

Comments

@yavasura
Copy link

the above code do not work also:

sql looks like this: select SQL_CALC_FOUND_ROWS name,(select name from region where region.region_id = region.id ) region,id,region_id from region order by (select name from region where region.region_id = region.id ) limit 0, 25 []

my code:

class Model_Region extends Model_Table {
public $table='region';
function init(){
parent::init();
$this->addField('name')->mandatory('true');
$this->hasOne('Region_Parent','region_id');
}
}

class Model_Region_Parent extends Model_Region {
public $alias='region_parent';
}

class page_region extends Page {
function init(){
parent::init();
$crud=$this->add('CRUD');
$model = $crud->setModel('Model_Region');
$model->debug();
if($crud->grid){
$crud->grid->addPaginator();
$crud->grid->getColumn('name')->makeSortable();
$crud->grid->getColumn('region')->makeSortable();
$crud->grid->addQuickSearch(array('region','name'));
}
}
}

@yavasura
Copy link
Author

somebody please propose some solution!!!

I would like to propose in stead of using real table name to give it unique alias while generating sql.

What do you think?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant