Skip to content

Commit

Permalink
Merge pull request #704 from joomlatools/feature/703-searchable
Browse files Browse the repository at this point in the history
Add column ignore to model searchable behavior
  • Loading branch information
amazeika authored Apr 24, 2024
2 parents d9f7998 + 98b319a commit 5daf1cf
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,11 @@ protected function _getConditions($search, KModelContextInterface $context)
// Search in the form of id:NUM
if ($search_column !== 'id')
{
$ignore = isset($context->_ignore_columns) ? (array) $context->_ignore_columns : [];

foreach ($this->_columns as $column)
{
if (!$search_column || $column === $search_column)
if ((!$search_column || $column === $search_column) && !in_array($column, $ignore))
{
$alias = $this->_alias_map[$column] ?? 'tbl';

Expand Down

0 comments on commit 5daf1cf

Please sign in to comment.