Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93086783
PhabricatorFulltextToken.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Nov 26, 02:56
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Nov 28, 02:56 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22569212
Attached To
rPH Phabricator
PhabricatorFulltextToken.php
View Options
<?php
final
class
PhabricatorFulltextToken
extends
Phobject
{
private
$token
;
private
$isShort
;
private
$isStopword
;
public
function
setToken
(
PhutilSearchQueryToken
$token
)
{
$this
->
token
=
$token
;
return
$this
;
}
public
function
getToken
()
{
return
$this
->
token
;
}
public
function
isQueryable
()
{
return
!
$this
->
getIsShort
()
&&
!
$this
->
getIsStopword
();
}
public
function
setIsShort
(
$is_short
)
{
$this
->
isShort
=
$is_short
;
return
$this
;
}
public
function
getIsShort
()
{
return
$this
->
isShort
;
}
public
function
setIsStopword
(
$is_stopword
)
{
$this
->
isStopword
=
$is_stopword
;
return
$this
;
}
public
function
getIsStopword
()
{
return
$this
->
isStopword
;
}
public
function
newTag
()
{
$token
=
$this
->
getToken
();
$tip
=
null
;
$icon
=
null
;
if
(
$this
->
getIsShort
())
{
$shade
=
PHUITagView
::
COLOR_GREY
;
$tip
=
pht
(
'Ignored Short Word'
);
}
else
if
(
$this
->
getIsStopword
())
{
$shade
=
PHUITagView
::
COLOR_GREY
;
$tip
=
pht
(
'Ignored Common Word'
);
}
else
{
$operator
=
$token
->
getOperator
();
switch
(
$operator
)
{
case
PhutilSearchQueryCompiler
::
OPERATOR_NOT
:
$shade
=
PHUITagView
::
COLOR_RED
;
$icon
=
'fa-minus'
;
break
;
default
:
$shade
=
PHUITagView
::
COLOR_BLUE
;
break
;
}
}
$tag
=
id
(
new
PHUITagView
())
->
setType
(
PHUITagView
::
TYPE_SHADE
)
->
setColor
(
$shade
)
->
setName
(
$token
->
getValue
());
if
(
$tip
!==
null
)
{
Javelin
::
initBehavior
(
'phabricator-tooltips'
);
$tag
->
addSigil
(
'has-tooltip'
)
->
setMetadata
(
array
(
'tip'
=>
$tip
,
));
}
if
(
$icon
!==
null
)
{
$tag
->
setIcon
(
$icon
);
}
return
$tag
;
}
}
Event Timeline
Log In to Comment