contao/test — Issue #2492: Optional Where clause filter in foreingKey
Author: importer
Created: 2011-11-29 09:46:22+00:00
State: closed
Labels: backend, Feature

Hi Leo,
It's possibile add a WHERE filter in prepareForWidget function so you can filter the items in the foreignKey table ?
Something like:

```
// function prepareForWidget(), line 2199 in system/libraries/Controller.php,
$arrKey = explode('.', $arrData['foreignKey']);
$objOptions = $this->Database->execute("SELECT id, " . $arrKey[1] . " FROM " . $arrKey[0] . " WHERE ".
(isset($arrData['foreignKeyWhere']) ? '('.$arrData['foreignKeyWhere'].') AND' :''). // <``` Where Filter
" tstamp>0 ORDER BY " . $arrKey[1]);

```

--- _Originally created by chalda on September 1st, 2010, at 01:23pm (ID 2492)_