Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F680071
PhabricatorTypeaheadDatasource.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorTypeaheadDatasource.php
View Options
<?php
abstract
class
PhabricatorTypeaheadDatasource
extends
Phobject
{
private
$viewer
;
private
$query
;
private
$rawQuery
;
private
$limit
;
private
$parameters
=
array
();
public
function
setLimit
(
$limit
)
{
$this
->
limit
=
$limit
;
return
$this
;
}
public
function
getLimit
()
{
return
$this
->
limit
;
}
public
function
setViewer
(
PhabricatorUser
$viewer
)
{
$this
->
viewer
=
$viewer
;
return
$this
;
}
public
function
getViewer
()
{
return
$this
->
viewer
;
}
public
function
setRawQuery
(
$raw_query
)
{
$this
->
rawQuery
=
$raw_query
;
return
$this
;
}
public
function
getRawQuery
()
{
return
$this
->
rawQuery
;
}
public
function
setQuery
(
$query
)
{
$this
->
query
=
$query
;
return
$this
;
}
public
function
getQuery
()
{
return
$this
->
query
;
}
public
function
setParameters
(
array
$params
)
{
$this
->
parameters
=
$params
;
return
$this
;
}
public
function
getParameters
()
{
return
$this
->
parameters
;
}
public
function
getParameter
(
$name
,
$default
=
null
)
{
return
idx
(
$this
->
parameters
,
$name
,
$default
);
}
public
function
getDatasourceURI
()
{
$uri
=
new
PhutilURI
(
'/typeahead/class/'
.
get_class
(
$this
).
'/'
);
$uri
->
setQueryParams
(
$this
->
parameters
);
return
(
string
)
$uri
;
}
abstract
public
function
getPlaceholderText
();
abstract
public
function
getDatasourceApplicationClass
();
abstract
public
function
loadResults
();
public
static
function
tokenizeString
(
$string
)
{
$string
=
phutil_utf8_strtolower
(
$string
);
$string
=
trim
(
$string
);
if
(!
strlen
(
$string
))
{
return
array
();
}
$tokens
=
preg_split
(
'/
\s
+|[-
\[\]
]/'
,
$string
);
return
array_unique
(
$tokens
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, May 27, 8:59 AM (1 d, 18 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
170527
Default Alt Text
PhabricatorTypeaheadDatasource.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment