Choose your database:
AnySQL
MySQL
MS SQL Server
PostgreSQL
SQLite
Firebird
Oracle
SQL Anywhere
DB2
MaxDB

Subscribe to our news:
Partners
Testimonials
Steven Langfield: "I wanted to drop you a mail to say how freaking AMAZING your software is. It will be the best £100 I have ever spent. I have still to read all your documentation to take full advantage but what you have created is truly amazing".
Grey: "We're a two-person company, it's just me an my wife. I'm the technical guru, and she handles the business operations. I have to know a lot about MySQL, but that's much too technical for her. I have frequently had to setup CGI scripts (I code in Perl) so she can manage some of our tables (suppliers, manufacturers, etc).

I discovered PHP Generator a couple of days ago, tried the free version,and within a few hours I had purchased the Pro version (as well as SQL Maestro for MySQL).

Today I am completing the conversion of the last of my custom table managers to PHP Generator. This is eliminating several thousand lines of code that I don't have to support any more!

Thanks for this fantastic product".

More

Add your opinion

PHP Generator for MySQL online Help

Prev Return to chapter overview Next

OnPrepareColumnFilter

This event allows you to customize column-specific filters.

 

Signature:

function OnPrepareColumnFilter ($columnFilter)

 

Parameters:

$columnFilter

An instance of the ColumnFilter class.

 

All examples below can be seen in action in the Feature Demo.

 

Example 1

This example shows how to setup a column filter as a list of custom values.

 

$columnFilter->setOptionsFor(

    'rating',

    array(

        "Less than 3" => FilterCondition::lessThan(3),

        "4-5" => FilterCondition::between(4, 5),

        "6-7" => FilterCondition::between(6, 7),

        "7-8" => FilterCondition::between(7, 8),

        "Higher than 8" => FilterCondition::greaterThan(8)

    ),

    false // no default values

);

 

Example 2

This example shows how to group custom values.

 

$columnFilter->setOptionsFor(

    'runtime',

    array(

        'Shorter than 90 min' => FilterCondition::lessThan(90),

        '90 - 180 min' => FilterGroup::orX(

            array(

                '90-120 min' => FilterCondition::between(90, 120),

                '120-150 min' => FilterCondition::between(120, 150),

                '150-180 min' => FilterCondition::between(150, 180)

            )

        ),

        'Longer than 180 min' => FilterCondition::greaterThan(180)

    ),

    false // no default values

);

 

Example 3

This example shows how to add custom values to default ones.

 

$columnFilter->setOptionsFor('release_date',

    array(

        '2010s' => FilterCondition::between('2010-01-01', '2019-12-31'),

        '2000s' => FilterCondition::between('2000-01-01', '2009-12-31')

    ),

    true // add default values (this parameter can be omitted)

);

 



Prev Return to chapter overview Next