Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F73287186
queryfx.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
Sat, Jul 20, 07:38
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Jul 22, 07:38 (2 d)
Engine
blob
Format
Raw Data
Handle
19139035
Attached To
rPHU libphutil
queryfx.php
View Options
<?php
/**
* @group storage
*/
function
queryfx
(
AphrontDatabaseConnection
$conn
,
$sql
/* , ... */
)
{
$argv
=
func_get_args
();
$query
=
call_user_func_array
(
'qsprintf'
,
$argv
);
$conn
->
executeRawQuery
(
$query
);
}
/**
* @group storage
*/
function
vqueryfx
(
AphrontDatabaseConnection
$conn
,
$sql
,
array
$argv
)
{
array_unshift
(
$argv
,
$conn
,
$sql
);
call_user_func_array
(
'queryfx'
,
$argv
);
}
/**
* @group storage
*/
function
queryfx_all
(
AphrontDatabaseConnection
$conn
,
$sql
/* , ... */
)
{
$argv
=
func_get_args
();
call_user_func_array
(
'queryfx'
,
$argv
);
return
$conn
->
selectAllResults
();
}
/**
* @group storage
*/
function
queryfx_one
(
AphrontDatabaseConnection
$conn
,
$sql
/* , ... */
)
{
$argv
=
func_get_args
();
$ret
=
call_user_func_array
(
'queryfx_all'
,
$argv
);
if
(
count
(
$ret
)
>
1
)
{
throw
new
AphrontQueryCountException
(
'Query returned more than one row.'
);
}
else
if
(
count
(
$ret
))
{
return
reset
(
$ret
);
}
return
null
;
}
/**
* @group storage
*/
function
vqueryfx_all
(
AphrontDatabaseConnection
$conn
,
$sql
,
array
$argv
)
{
array_unshift
(
$argv
,
$conn
,
$sql
);
call_user_func_array
(
'queryfx'
,
$argv
);
return
$conn
->
selectAllResults
();
}
Event Timeline
Log In to Comment