private function getSearchableFields(stdClass $data, bool $multiLanguage = false)
    {
        $output = '';

        $model = $data->mainModel;

        $whereTpl = file_get_contents(__DIR__ . '/../templates/shared/where.hctpl');
        $orWhereTpl = file_get_contents(__DIR__ . '/../templates/shared/or.where.hctpl');
        $skip = array_merge($this->getAutoFill(), ['id']);


        if( $multiLanguage ) {
            if( array_key_exists('multiLanguage', $model) && ! empty($model->multiLanguage) )
                if( array_key_exists('columns', $model->multiLanguage) && ! empty($model->multiLanguage->columns) )
                    foreach ( $model->multiLanguage->columns as $index => $column ) {

                        if( in_array($column->Field, $skip) )
                            continue;

                        if( $output == '' )
                            $output .= str_replace('{key}', $column->Field, $whereTpl);
                        else
                            $output .= str_replace('{key}', $column->Field, $orWhereTpl);

                    }
        } else
            if( array_key_exists('columns', $model) && ! empty($model->columns) ) {

                foreach ( $model->columns as $index => $column ) {
                    if( in_array($column->Field, $skip) )
                        continue;

                    if( $output == '' )
                        $output .= str_replace('{key}', $column->Field, $whereTpl);
                    else
                        $output .= str_replace('{key}', $column->Field, $orWhereTpl);

                }
            }

        return $output;
    }
private function getSearchableFields(stdClass $data, bool $multiLanguage = false)
    {
        $output = '';

        $model = $data->mainModel;

        $whereTpl = file_get_contents(__DIR__ . '/../templates/shared/where.hctpl');
        $orWhereTpl = file_get_contents(__DIR__ . '/../templates/shared/or.where.hctpl');
        $skip = array_merge($this->getAutoFill(), ['id']);


        if( $multiLanguage ) {
            if( array_key_exists('multiLanguage', $model) && ! empty($model->multiLanguage) )
                if( array_key_exists('columns', $model->multiLanguage) && ! empty($model->multiLanguage->columns) )
                    foreach ( $model->multiLanguage->columns as $index => $column ) {

                        if( in_array($column->Field, $skip) )
                            continue;

                        if( $output == '' )
                            $output .= str_replace('{key}', $column->Field, $whereTpl);
                        else
                            $output .= str_replace('{key}', $column->Field, $orWhereTpl);

                    }
        } else
            if( array_key_exists('columns', $model) && ! empty($model->columns) ) {

                foreach ( $model->columns as $index => $column ) {
                    if( in_array($column->Field, $skip) )
                        continue;

                    if( $output == '' )
                        $output .= str_replace('{key}', $column->Field, $whereTpl);
                    else
                        $output .= str_replace('{key}', $column->Field, $orWhereTpl);

                }
            }

        return $output;
    }
private function getSearchableFields ( stdClass $ data , bool $ multiLanguage = false ) { $ output = '' ; $ model = $ data -> mainModel ; $ whereTpl = file_get_contents ( __DIR__ . '/../templates/shared/where.hctpl' ) ; $ orWhereTpl = file_get_contents ( __DIR__ . '/../templates/shared/or.where.hctpl' ) ; $ skip = array_merge ( $ this -> getAutoFill ( ) , [ 'id' ] ) ; if ( $ multiLanguage ) { if ( array_key_exists ( 'multiLanguage' , $ model ) && ! empty ( $ model -> multiLanguage ) ) if ( array_key_exists ( 'columns' , $ model -> multiLanguage ) && ! empty ( $ model -> multiLanguage -> columns ) ) foreach ( $ model -> multiLanguage -> columns as $ index => $ column ) { if ( in_array ( $ column -> Field , $ skip ) ) continue ; if ( $ output == '' ) $ output .= str_replace ( '{key}' , $ column -> Field , $ whereTpl ) ; else $ output .= str_replace ( '{key}' , $ column -> Field , $ orWhereTpl ) ; } } else if ( array_key_exists ( 'columns' , $ model ) && ! empty ( $ model -> columns ) ) { foreach ( $ model -> columns as $ index => $ column ) { if ( in_array ( $ column -> Field , $ skip ) ) continue ; if ( $ output == '' ) $ output .= str_replace ( '{key}' , $ column -> Field , $ whereTpl ) ; else $ output .= str_replace ( '{key}' , $ column -> Field , $ orWhereTpl ) ; } } return $ output ; }
Get searchable fields from model data

@param stdClass $data
@param bool $multiLanguage
@return string
Get searchable fields from model data