{
    "mode": "perldoc",
    "parameter": "Class::DBI::Search::Basic",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Class%3A%3ADBI%3A%3ASearch%3A%3ABasic/json",
    "generated": "2026-06-17T19:18:03Z",
    "synopsis": "my $searcher = Class::DBI::Search::Basic->new(\n$cdbiclass, @searchargs\n);\nmy @results = $searcher->runsearch;\n# Over in your Class::DBI subclass:\nPACKAGE->addsearcher(\nsearch  => \"Class::DBI::Search::Basic\",\nisearch => \"Class::DBI::Search::Plugin::CaseInsensitive\",\n);",
    "sections": {
        "NAME": {
            "content": "Class::DBI::Search::Basic - Simple Class::DBI search\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "my $searcher = Class::DBI::Search::Basic->new(\n$cdbiclass, @searchargs\n);\n\nmy @results = $searcher->runsearch;\n\n# Over in your Class::DBI subclass:\n\nPACKAGE->addsearcher(\nsearch  => \"Class::DBI::Search::Basic\",\nisearch => \"Class::DBI::Search::Plugin::CaseInsensitive\",\n);\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This is the start of a pluggable Search infrastructure for Class::DBI.\n\nAt the minute Class::DBI::Search::Basic doubles up as both the default search within Class::DBI\nas well as the search base class. We will probably need to tease this apart more later and\ncreate an abstract base class for search plugins.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "new\nmy $searcher = Class::DBI::Search::Basic->new(\n$cdbiclass, @searchargs\n);\n\nA Searcher is created with the class to which the results will belong, and the arguments passed\nto the search call by the user.\n\nopt\nif (my $order = $self->opt('orderby')) { ... }\n\nThe arguments passed to search may contain an options hash. This will return the value of a\ngiven option.\n\nrunsearch\nmy @results = $searcher->runsearch;\nmy $iterator = $searcher->runsearch;\n\nActually run the search.\n",
            "subsections": []
        },
        "SUBCLASSING": {
            "content": "sql / bind / fragment\nThe actual mechanics of generating the SQL and executing it split up into a variety of methods\nfor you to override.\n",
            "subsections": [
                {
                    "name": "run_search",
                    "content": "return $cdbi->sthtoobjects($self->sql, $self->bind);\n\nWhere sql() is\n\n$cdbi->sqlRetrieve($self->fragment);\n\nThere are also a variety of private methods underneath this that could be overridden in a pinch,\nbut if you need to do this I'd rather you let me know so that I can make them public, or at\nleast so that I don't remove them from under your feet.\n"
                }
            ]
        }
    },
    "summary": "Class::DBI::Search::Basic - Simple Class::DBI search",
    "flags": [],
    "examples": [],
    "see_also": []
}