phpMv
-UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
Loading...
Searching...
No Matches
SearchCategory.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Ajax\semantic\components\search
;
4
5
class
SearchCategory
implements
ISearch
{
6
private
$id
;
7
private
$name
;
8
private
$results
;
9
10
public
function
__construct
(
$id
,
$name
,
$results
=NULL) {
11
$this->results=
new
SearchResults
(
$results
);
12
$this->
id
=
$id
;
13
$this->name=
$name
;
14
}
15
16
public
function
addResult
($object) {
17
$this->results->addResult($object);
18
return
$this;
19
}
20
21
public
function
addResults
($objects) {
22
$this->results->addResults($objects);
23
return
$this;
24
}
25
26
public
function
__toString
() {
27
$result=
"\""
. $this->
id
.
"\": { \"name\": \""
. $this->name .
"\","
. $this->results .
"}"
;
28
return
$result;
29
}
30
31
public
function
getId
() {
32
return
$this->id
;
33
}
34
35
public
function
setId
(
$id
) {
36
$this->
id
=
$id
;
37
return
$this;
38
}
39
40
public
function
getName
() {
41
return
$this->name
;
42
}
43
44
public
function
setName
(
$name
) {
45
$this->name=
$name
;
46
return
$this;
47
}
48
49
public
function
getResults
() {
50
return
$this->results
;
51
}
52
53
public
function
setResults
(
$results
) {
54
$this->results=
$results
;
55
return
$this;
56
}
57
58
public
function
search
($query, $field=
"title"
) {
59
$result=$this->results->_search($query, $field);
60
if
($result !==
false
) {
61
return
new
SearchCategory
($this->
id
, $this->name, $result);
62
}
63
return
false
;
64
}
65
66
public
function
getResponse
() {
67
return
$this->
__toString
();
68
}
69
}
Ajax\semantic\components\search\SearchCategory
Definition
SearchCategory.php:5
Ajax\semantic\components\search\SearchCategory\__construct
__construct($id, $name, $results=NULL)
Definition
SearchCategory.php:10
Ajax\semantic\components\search\SearchCategory\addResult
addResult($object)
Definition
SearchCategory.php:16
Ajax\semantic\components\search\SearchCategory\getId
getId()
Definition
SearchCategory.php:31
Ajax\semantic\components\search\SearchCategory\$results
$results
Definition
SearchCategory.php:8
Ajax\semantic\components\search\SearchCategory\setName
setName($name)
Definition
SearchCategory.php:44
Ajax\semantic\components\search\SearchCategory\getResults
getResults()
Definition
SearchCategory.php:49
Ajax\semantic\components\search\SearchCategory\getName
getName()
Definition
SearchCategory.php:40
Ajax\semantic\components\search\SearchCategory\getResponse
getResponse()
Definition
SearchCategory.php:66
Ajax\semantic\components\search\SearchCategory\__toString
__toString()
Definition
SearchCategory.php:26
Ajax\semantic\components\search\SearchCategory\addResults
addResults($objects)
Definition
SearchCategory.php:21
Ajax\semantic\components\search\SearchCategory\setId
setId($id)
Definition
SearchCategory.php:35
Ajax\semantic\components\search\SearchCategory\$name
$name
Definition
SearchCategory.php:7
Ajax\semantic\components\search\SearchCategory\setResults
setResults($results)
Definition
SearchCategory.php:53
Ajax\semantic\components\search\SearchCategory\search
search($query, $field="title")
Definition
SearchCategory.php:58
Ajax\semantic\components\search\SearchCategory\$id
$id
Definition
SearchCategory.php:6
Ajax\semantic\components\search\SearchResults
Definition
SearchResults.php:7
Ajax\semantic\components\search\ISearch
Definition
ISearch.php:5
Ajax\semantic\components\search
Definition
AbstractSearchResult.php:3
Ajax
semantic
components
search
SearchCategory.php
Generated on Sun Dec 10 2023 16:16:00 for
phpMv-UI
by
doxygen
1.9.8