modules/KBDocuments/SearchUtils.php
Functions
create_fts_search_list_query(
$db, $spec_SearchVars, $searchVars, $fullQuery
=
false
)
:
void| Name | Type | Description |
|---|---|---|
| $db | ||
| $spec_SearchVars | ||
| $searchVars | ||
| $fullQuery |
create_most_recent_articles_query(
$bean, $order_by, $where, $keywords, $row_offset, $limit, $date_filter
)
:
voidcreate_most_recent_articles_query
| Name | Type | Description |
|---|---|---|
| $bean | ||
| $order_by | ||
| $where | ||
| $keywords | ||
| $row_offset | ||
| $limit | ||
| $date_filter |
create_most_viewed_articles_query(
$bean, $order_by, $where, $keywords, $row_offset, $limit, $date_filter, $searchVars, $spec_SearchVars
)
:
voidcreate_most_viewed_articles_query
| Name | Type | Description |
|---|---|---|
| $bean | ||
| $order_by | ||
| $where | ||
| $keywords | ||
| $row_offset | ||
| $limit | ||
| $date_filter | ||
| $searchVars | ||
| $spec_SearchVars |
create_portal_list_query(
\$bean $bean, \$order_by $order_by, \$where $where, \$keywords $keywords, \$row_offset $row_offset, \$limit $limit
)
:
\$resultcreate_portal_list_query This is the function that handles the searches called by the KB Portal code.
| Name | Type | Description |
|---|---|---|
| $bean | \$bean | SugarBean instance (used to perform queries) |
| $order_by | \$order_by | String SQL for ORDER BY clause |
| $where | \$where | String SQL for additional WHERE clause |
| $keywords | \$keywords | Array of keyword arguments ([most_recent_articles] and [most_viewed_articles] are special) |
| $row_offset | \$row_offset | Integer value of row offset for LIMIT queries |
| $limit | \$limit | Interger value of LIMIT number |
| Type | Description |
|---|---|
| \$result | The result set of resulting query |
create_portal_most_recent_query(
\DBManager $db, int $n
=
'10', string $where
=
''
)
:
voidcreate_portal_most_recent_query() This method builds and returns query for most recent documents for portal
| Name | Type | Description |
|---|---|---|
| $db | \DBManager | DB Manager |
| $n | int | the number of articles to return. Default is 10 |
| $where | string | clause to use in where portion of query, if needed. |
get_admin_fts_list(
$where, $isMultiSelect
=
false
)
:
void| Name | Type | Description |
|---|---|---|
| $where | ||
| $isMultiSelect |
get_child_ids(
string $root_id, \SugarBean $bean
)
:
\$resultsget_child_ids This method returns an Array of id=>TagNode value pairs of the $root_id
| Name | Type | Description |
|---|---|---|
| $root_id | string | The root id value to query for (i.e. the id column in kbtags table) |
| $bean | \SugarBean | A sugarbean instance |
| Type | Description |
|---|---|
| \$results | Array of child id=>tag_name key/value pairs found where the root node is $root_id |
get_fts_list(
$qry_arr, $isMultiSelect
=
false, $ajaxSort
=
false
)
:
void| Name | Type | Description |
|---|---|---|
| $qry_arr | ||
| $isMultiSelect | ||
| $ajaxSort |
get_kbdocument_body(
$kbdoc_id, $bean
)
:
voidget_kbdocument_body
| Name | Type | Description |
|---|---|---|
| $kbdoc_id | ||
| $bean |
recursive_search(
\$node $node, \$data $data, \$list $list, \$root_id $root_id, \$id $id, $skip
)
:
voidrecursive_search This is a recursive function to find documents linked to a particular root tag id.
| Name | Type | Description |
|---|---|---|
| $node | \$node | The current TreeNode instance to search |
| $data | \$data | The Array of all TreeNode(s) |
| $list | \$list | The current Array of matching TreeNodes(s) |
| $root_id | \$root_id | The root id value to search for |
| $id | \$id | The current TreeNode id value being searched |
| $skip |
return_attachment_filter(
$db, $spec_SearchVars
)
:
void| Name | Type | Description |
|---|---|---|
| $db | ||
| $spec_SearchVars |
return_canned_query(
$db, $canned_search_opt
)
:
void| Name | Type | Description |
|---|---|---|
| $db | ||
| $canned_search_opt |
return_date_filter(
$db, $field, $filter, $filter_date
=
'', $filter_date2
=
''
)
:
void| Name | Type | Description |
|---|---|---|
| $db | ||
| $field | ||
| $filter | ||
| $filter_date | ||
| $filter_date2 |
return_view_frequency_filter(
$db, $freq_search_opt
)
:
void| Name | Type | Description |
|---|---|---|
| $db | ||
| $freq_search_opt |