ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilShopObjectSearch Class Reference
+ Inheritance diagram for ilShopObjectSearch:
+ Collaboration diagram for ilShopObjectSearch:

Public Member Functions

 __construct ($qp_obj)
 setCustomSearchResultObject ($a_search_result_obect)
 setFilterShopTopicId ($a_topic_id)
 getFilterShopTopicId ()
 performSearch ()
 __createInStatement ()
 __createLocateString ()
 build locate string in case of AND search
 __prepareFound (&$row)
- Public Member Functions inherited from ilAbstractSearch
 ilAbstractSearch (&$qp_obj)
 Constructor public.
 setFields ($a_fields)
 Set fields to search.
 getFields ()
 Get fields to search.
 setFilter ($a_filter)
 set object type to search in
 setIdFilter ($a_id_filter)
 Set id filter Filters search by given object id.
 getIdFilter ()
 Get Id filter.
 appendToFilter ($a_type)
 Append object type to filter.
 getFilter ()
 get object type to search in

Private Attributes

 $filter_shop_topic_id = 0

Additional Inherited Members

- Data Fields inherited from ilAbstractSearch
 $db = null
 $query_parser = null
 $search_result = null
 $object_types

Detailed Description

Definition at line 13 of file class.ilShopObjectSearch.php.

Constructor & Destructor Documentation

ilShopObjectSearch::__construct (   $qp_obj)

Reimplemented in ilLikeShopObjectSearch.

Definition at line 17 of file class.ilShopObjectSearch.php.

References ilAbstractSearch\setFields().

{
$this->setFields(array('title', 'description'));
}

+ Here is the call graph for this function:

Member Function Documentation

ilShopObjectSearch::__createInStatement ( )

Definition at line 72 of file class.ilShopObjectSearch.php.

Referenced by performSearch().

{
return ' AND ' . $this->db->in('type', $this->object_types, false, 'text');
}

+ Here is the caller graph for this function:

ilShopObjectSearch::__createLocateString ( )

build locate string in case of AND search

Returns
string public

Reimplemented from ilAbstractSearch.

Definition at line 82 of file class.ilShopObjectSearch.php.

References $ilDB, and fields.

Referenced by performSearch().

{
global $ilDB;
if($this->query_parser->getCombination() == 'or')
{
return '';
}
if(!strlen($this->query_parser->getQueryString()))
{
return '';
}
$locate = '';
if(count($this->fields) > 1)
{
$tmp_fields = array();
foreach($this->fields as $field)
{
$tmp_fields[] = array($field,'text');
}
$complete_str = $ilDB->concat($tmp_fields);
}
else
{
$complete_str = $this->fields[0];
}
$counter = 0;
foreach($this->query_parser->getQuotedWords() as $word)
{
$locate .= ',';
$locate .= $ilDB->locate($ilDB->quote($word, 'text'), $complete_str, 1);
$locate .= (' found'.$counter++);
$locate .= ' ';
}
return $locate;
}

+ Here is the caller graph for this function:

ilShopObjectSearch::__prepareFound ( $row)

Reimplemented from ilAbstractSearch.

Definition at line 124 of file class.ilShopObjectSearch.php.

References $row.

{
if($this->query_parser->getCombination() == 'or')
{
return array();
}
if(!strlen($this->query_parser->getQueryString()))
{
return array();
}
$counter = 0;
foreach($this->query_parser->getQuotedWords() as $word)
{
$res_found = 'found'.$counter++;
$found[] = $row->$res_found;
}
return $found ? $found : array();
}
ilShopObjectSearch::getFilterShopTopicId ( )

Definition at line 32 of file class.ilShopObjectSearch.php.

References $filter_shop_topic_id.

Referenced by ilLikeShopObjectSearch\__createWhereCondition().

+ Here is the caller graph for this function:

ilShopObjectSearch::performSearch ( )

Reimplemented from ilAbstractSearch.

Definition at line 37 of file class.ilShopObjectSearch.php.

References $in, $query, $row, ilAbstractSearch\$search_result, __createInStatement(), __createLocateString(), and DB_FETCHMODE_OBJECT.

{
$types = array();
$values = array();
$where = $this->__createWhereCondition();
$locate = $this->__createLocateString();
$query = "SELECT object_reference.ref_id, object_data.obj_id,object_data.type ".$locate."
FROM payment_objects
INNER JOIN object_reference ON object_reference.ref_id = payment_objects.ref_id
INNER JOIN object_data ON object_data.obj_id = object_reference.obj_id ";
$query .= $where['query'];
$types = array_merge($types, $where['types']);
$values = array_merge($values, $where['values']);
$query .= $in;
$query .= " GROUP BY object_reference.ref_id, object_data.obj_id,object_data.type,object_data.title,object_data.description";
$query .= " ORDER BY object_data.obj_id DESC";
$statement = $this->db->queryf(
$types,
$values
);
while($row = $statement->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->search_result->addEntry($row->ref_id, $row->type, $this->__prepareFound($row));
}
}

+ Here is the call graph for this function:

ilShopObjectSearch::setCustomSearchResultObject (   $a_search_result_obect)

Definition at line 23 of file class.ilShopObjectSearch.php.

{
$this->search_result = $a_search_result_obect;
}
ilShopObjectSearch::setFilterShopTopicId (   $a_topic_id)

Definition at line 28 of file class.ilShopObjectSearch.php.

{
$this->filter_shop_topic_id = $a_topic_id;
}

Field Documentation

ilShopObjectSearch::$filter_shop_topic_id = 0
private

Definition at line 15 of file class.ilShopObjectSearch.php.

Referenced by getFilterShopTopicId().


The documentation for this class was generated from the following file: