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

Public Member Functions

 __construct ($qp_obj)
 setCustomSearchResultObject ($a_search_result_obect)
 setFilterShopTopicId ($a_topic_id)
 getFilterShopTopicId ()
 setMode ($a_mode)
 getMode ()
 performSearch ()
 __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

Data Fields

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

Private Member Functions

 __createInStatement ()
 __searchContribute ()
 __searchKeywords ()
 __searchTitles ()
 __searchDescriptions ()

Private Attributes

 $filter_shop_topic_id = 0

Detailed Description

Definition at line 33 of file class.ilShopMetaDataSearch.php.

Constructor & Destructor Documentation

ilShopMetaDataSearch::__construct (   $qp_obj)

Reimplemented in ilLikeShopMetaDataSearch.

Definition at line 46 of file class.ilShopMetaDataSearch.php.

{
}

Member Function Documentation

ilShopMetaDataSearch::__createInStatement ( )
private

Definition at line 96 of file class.ilShopMetaDataSearch.php.

References ilAbstractSearch\getFilter().

Referenced by __searchContribute(), __searchDescriptions(), __searchKeywords(), and __searchTitles().

{
if(!$this->getFilter())
{
return '';
}
else
{
return ' AND ' . $this->db->in('obj_type', $this->getFilter(), false, 'text');
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopMetaDataSearch::__createLocateString ( )

build locate string in case of AND search

Returns
string public

Reimplemented from ilAbstractSearch.

Definition at line 261 of file class.ilShopMetaDataSearch.php.

References fields.

Referenced by __searchContribute(), __searchDescriptions(), __searchKeywords(), and __searchTitles().

{
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:

ilShopMetaDataSearch::__prepareFound ( $row)

Reimplemented from ilAbstractSearch.

Definition at line 303 of file class.ilShopMetaDataSearch.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();
}
ilShopMetaDataSearch::__searchContribute ( )
private

Definition at line 108 of file class.ilShopMetaDataSearch.php.

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

Referenced by performSearch().

{
$types = array();
$values = array();
$this->setFields(array('entity'));
$where = $this->__createContributeWhereCondition();
$locate = $this->__createLocateString();
$query = "SELECT object_reference.ref_id,rbac_id,il_meta_entity.obj_id,obj_type ".$locate."
FROM payment_objects
INNER JOIN object_reference ON object_reference.ref_id = payment_objects.ref_id
INNER JOIN il_meta_entity ON il_meta_entity.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,il_meta_entity.obj_id,rbac_id,obj_type,il_meta_entity.entity ";
$statement = $this->db->queryf(
$types,
$values
);
while($row = $statement->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->search_result->addEntry($row->ref_id,$row->obj_type,$this->__prepareFound($row),$row->obj_id);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopMetaDataSearch::__searchDescriptions ( )
private

Definition at line 219 of file class.ilShopMetaDataSearch.php.

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

Referenced by performSearch().

{
$types = array();
$values = array();
$this->setFields(array('description'));
$where = $this->__createDescriptionWhereCondition();
$locate = $this->__createLocateString();
$query = "SELECT object_reference.ref_id,rbac_id,il_meta_description.obj_id,obj_type ".$locate."
FROM payment_objects
INNER JOIN object_reference ON object_reference.ref_id = payment_objects.ref_id
INNER JOIN il_meta_description ON il_meta_description.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,il_meta_description.obj_id,rbac_id,obj_type,il_meta_description.description ";
$statement = $this->db->queryf(
$types,
$values
);
while($row = $statement->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->search_result->addEntry($row->ref_id,$row->obj_type,$this->__prepareFound($row),$row->obj_id);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopMetaDataSearch::__searchKeywords ( )
private

Definition at line 145 of file class.ilShopMetaDataSearch.php.

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

Referenced by performSearch().

{
$types = array();
$values = array();
$this->setFields(array('keyword'));
$where = $this->__createKeywordWhereCondition();
$locate = $this->__createLocateString();
$query = "SELECT object_reference.ref_id,rbac_id,il_meta_keyword.obj_id,obj_type ".$locate."
FROM payment_objects
INNER JOIN object_reference ON object_reference.ref_id = payment_objects.ref_id
INNER JOIN il_meta_keyword ON il_meta_keyword.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,il_meta_keyword.obj_id,rbac_id,obj_type,il_meta_keyword.keyword ";
$statement = $this->db->queryf(
$types,
$values
);
while($row = $statement->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->search_result->addEntry($row->ref_id,$row->obj_type,$this->__prepareFound($row),$row->obj_id);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopMetaDataSearch::__searchTitles ( )
private

Definition at line 182 of file class.ilShopMetaDataSearch.php.

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

Referenced by performSearch().

{
$types = array();
$values = array();
$this->setFields(array('title'));
$where = $this->__createTitleWhereCondition();
$locate = $this->__createLocateString();
$query = "SELECT object_reference.ref_id,rbac_id,il_meta_general.obj_id,obj_type ".$locate."
FROM payment_objects
INNER JOIN object_reference ON object_reference.ref_id = payment_objects.ref_id
INNER JOIN il_meta_general ON il_meta_general.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,il_meta_general.obj_id,rbac_id,obj_type,il_meta_general.title ";
$statement = $this->db->queryf(
$types,
$values
);
while($row = $statement->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->search_result->addEntry($row->ref_id,$row->obj_type,$this->__prepareFound($row),$row->obj_id);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopMetaDataSearch::getMode ( )

Definition at line 69 of file class.ilShopMetaDataSearch.php.

References $mode.

Referenced by performSearch().

{
return $this->mode;
}

+ Here is the caller graph for this function:

ilShopMetaDataSearch::performSearch ( )

Reimplemented from ilAbstractSearch.

Definition at line 74 of file class.ilShopMetaDataSearch.php.

References __searchContribute(), __searchDescriptions(), __searchKeywords(), __searchTitles(), and getMode().

{
switch($this->getMode())
{
case 'keyword':
return $this->__searchKeywords();
case 'contribute':
return $this->__searchContribute();
case 'title':
return $this->__searchTitles();
case 'description':
return $this->__searchDescriptions();
default:
echo __METHOD__.' no mode given';
return false;
}
}

+ Here is the call graph for this function:

ilShopMetaDataSearch::setCustomSearchResultObject (   $a_search_result_obect)

Definition at line 51 of file class.ilShopMetaDataSearch.php.

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

Definition at line 56 of file class.ilShopMetaDataSearch.php.

{
$this->filter_shop_topic_id = $a_topic_id;
}
ilShopMetaDataSearch::setMode (   $a_mode)

Definition at line 65 of file class.ilShopMetaDataSearch.php.

{
$this->mode = $a_mode;
}

Field Documentation

ilShopMetaDataSearch::$db = null

Definition at line 42 of file class.ilShopMetaDataSearch.php.

ilShopMetaDataSearch::$filter_shop_topic_id = 0
private

Definition at line 44 of file class.ilShopMetaDataSearch.php.

Referenced by getFilterShopTopicId().

ilShopMetaDataSearch::$mode = ''

Definition at line 35 of file class.ilShopMetaDataSearch.php.

Referenced by getMode().

ilShopMetaDataSearch::$query_parser = null

Definition at line 40 of file class.ilShopMetaDataSearch.php.


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