Skip to content

Commit

Permalink
external relations with datatables
Browse files Browse the repository at this point in the history
  • Loading branch information
jonseg committed Oct 24, 2014
1 parent 6b40b4b commit 7c46ba5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion gen/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,20 @@

$find_sql = "SELECT * FROM `__TABLENAME__`". $whereClause . $orderClause . " LIMIT ". $index . "," . $rowsPerPage;
$rows_sql = $app['db']->fetchAll($find_sql, array());

foreach($rows_sql as $row_key => $row_sql){
for($i = 0; $i < count($table_columns); $i++){

__EXTERNALS_FOR_LIST__

This comment has been minimized.

Copy link
@danicomas

danicomas Oct 26, 2015

We should change the way we add the relations because for each row we do a sql query.

for(col in columns)
{
if()
{
call to database
}
}

We should think in add them in the select clause (more difficult but more efficient)


}
}

$queryData = new queryData();
$queryData->draw = $draw;
$queryData->recordsTotal = $recordsTotal;
$queryData->recordsFiltered = $recordsTotal;
$queryData->data = $rows_sql;
$queryData->data = $rows;

return new Symfony\Component\HttpFoundation\Response(json_encode($queryData), 200);
});
Expand Down

0 comments on commit 7c46ba5

Please sign in to comment.