pix-digital / pixSortableBehaviorBundle

Offers a sortable feature for your Symfony2 admin listing
MIT License
46 stars 78 forks source link

how to sort multiple Admin with same entity #83

Closed TangMonk closed 5 years ago

TangMonk commented 5 years ago

Hey, This package is really awesome! and thanks your work!

I have a article Entity with multiple Admin class:

in src/Admin/ZCLL:

final class ArticleOne extends AbstractAdmin
{
    protected $baseRouteName = 'zcll-agaj';
    protected $baseRoutePattern = 'zcll-agaj';
}

final class ArticleTwo extends AbstractAdmin
{
    protected $baseRouteName = 'zcll-pxjm';
    protected $baseRoutePattern = 'zcll-pxjm';
}
final class ArticleThree extends AbstractAdmin
{
    protected $baseRouteName = 'zcll-zcfg';
    protected $baseRoutePattern = 'zcll-zcfg';
}

above three class are all using one Article Entity, I wanna to sort them in their own scope, without affect others, for example:

  1. I sort some rows in ArticleOne
  2. will generate SQL UPDATE articles SET position = position - 1 WHERE position >= 2 AND position < 4 [] []

this SQL will update ArticleTwo and ArticleThree that rows match the query condition.

I wanna only generate that sql: UPDATE articles SET position = position - 1 WHERE position >= 2 AND position < 4 [] [] and article_type='ArticleOne'

Is it possible?