{
    "name": "autoJoin",
    "parent": "",
    "title": "",
    "permname": "",
    "modOrder": "001",
    "items": [
        {
            "name": "autoJoin",
            "purpose": " using the links.ini file, it builds a query with all the joins",
            "stype": "function",
            "|xns": "Roo.doc",
            "xtype": "Entry",
            "items": [
                {
                    "name": "autoJoin",
                    "is_static": false,
                    "is_constructor": false,
                    "memberof": "PDO_DataObject",
                    "returndesc": "info about joins (see above)",
                    "returntype": "array",
                    "|xns": "Roo.doc",
                    "xtype": "Synopsis",
                    "items": [
                        {
                            "desc": "Configuration (see above)",
                            "is_optional": false,
                            "name": "$cfg",
                            "type": "array",
                            "|xns": "Roo.doc",
                            "xtype": "Param"
                        }
                    ]
                },
                {
                    "stype": "desc",
                    "|xns": "Roo.doc",
                    "xtype": "Section",
                    "items": [
                        {
                            "html": " Note: it will clears and replace the existing settings for 'select' arguments.\n\n Usage:\n ```\n $x = PDO_DataObject::factory('mytable');\n $x->autoJoin();\n $x->get(123);\n ```\n   will result in all of the joined data being added to the fetched object..\n\n ```\n $x = PDO_DataObject::factory('mytable');\n $x->autoJoin();\n $ar = $x->fetchAll();\n ```\n   will result in an array containing all the data from the table, and any joined tables..\n\n ```\n $x = PDO_DataObject::factory('mytable');\n $jdata = $x->autoJoin();\n $x->selectAdd(); \/\/reset..\n foreach($_REQUEST['requested_cols'] as $c) {\n    if (!isset($jdata[$c])) continue; \/\/ ignore columns not available..\n    $x->selectAdd( $jdata[$c] . ' as ' . $c);\n }\n $ar = $x->fetchAll();\n ```\n   will result in only the columns requested being fetched...\n\n\n ### configuration using an array\n\n | Key | Description |\n | --- | ------------|\n | exclude |  Array of columns to exclude from results (eg. modified_by_id) <br\/>\\\n                    Use TABLENAME.* to prevent a join occuring to a specific table. |\n | include |  Array of specific columns to include (none others are added to select, join is still done though) |\n | links |   The equivilant links.ini data for this table eg. <br\/>\\\n                    `array( 'person_id' => 'person:id', .... )` <br\/>\\\n                      only applied to this instance of the DataObject (used to be applied globally)\n  | distinct | Array of distinct columns. (note you may need to add GROUP BY for this to work) |\n\n\n ### Return format:\n | Key | Description |\n | --- | ------------|\n | cols |        map of resulting `{joined_tablename}.{joined_table_column_name}` |\n | join_names |map of resulting `{join_name_as}.{joined_table_column_name}` |\n | count |       the column to count on. |\n\n\n\n",
                            "|xns": "Roo.doc",
                            "xtype": "Para"
                        }
                    ]
                },
                {
                    "stype": "parameter",
                    "|xns": "Roo.doc",
                    "xtype": "Section"
                },
                {
                    "stype": "return",
                    "|xns": "Roo.doc",
                    "xtype": "Section"
                }
            ]
        }
    ]
}