Releases for sf 1.1
| Version |
License |
API |
Released |
|
0.1.0beta
|
MIT license |
0.1.0beta
|
20/09/2008 |
Releases for sf 1.0
| Version |
License |
API |
Released |
|
0.1.0beta
|
MIT license |
0.1.0beta
|
20/09/2008 |
Copyright (c) 2008 Boutell.Com, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Changelog for release 0.1.0 - 20/09/2008
Other releases
Release 0.1.0 - 20/09/2008
Installation for sf 1.1
php symfony plugin:install sfAdminSortByForeignNamePlugin --release=0.1.0
Installation for sf 1.0
php symfony plugin-install http://plugins.symfony-project.org/sfAdminSortByForeignNamePlugin
PEAR
Download the PEAR package
sfAdminSortByForeignNamePlugin
Introduction
The Symfony admin generator provides an easy way to manage your tables,
including support for sorting the list view on any column. However,
when the user attempts to sort on a column that contains a foreign key
referencing another table, the rows are sorted numerically by foreign ID.
This is probably not what the user expects. Unfortunately the
Symfony admin generator currently does not provide a way to sort on
the name field of a foreign table. This plugin fills that gap.
Installation and Configuration
Let's assume your schema looks like this:
event:
id:
name: varchar(100)
venue_id:
studio_id:
instructor_id:
# Other stuff
venue:
id:
name: varchar(100)
# Other stuff
studio:
id:
name: varchar(100)
# Other stuff
instructor:
id:
name: varchar(100)
# Other stuff
You have used the `symfony propel-init-admin backend event' command to
build an admin-generated module that manages the event class. Now you
want to allow users to sort the table by instructor, venue, or studio
name with a minimum of effort.
To do that, just:
Note that you must pass the name of the class being managed as the second
parameter to the addSortByForeignName method.
Note also that when addSortByForeignName returns false, we keep going
and call the parent class version of addSortCriteria. Without this
code, it would no longer be possible to sort on non-foreign-key fields
of the Event class itself.
Changelog
version 0.1 - 2008-09-20
Initial version.
TODO
- It would be nice to support field names other than NAME via
app.yml.
Contact
sfTagtoolsPlugin was created by Tom Boutell at
[http://www.boutell.com/ Boutell.Com].
Please address questions, concerns and patches to [mailto:boutell@boutell.com Tom Boutell].