Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F8321923
MockDatabaseResult.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
722 B
Referenced Files
None
Subscribers
None
MockDatabaseResult.php
View Options
<?php
namespace
Keruald\Database\Result
;
use
ArrayIterator
;
use
Traversable
;
class
MockDatabaseResult
extends
DatabaseResult
{
///
/// Constructor
///
public
function
__construct
(
private
readonly
array
$results
)
{
}
///
/// IteratorAggregate
///
public
function
getIterator
()
:
Traversable
{
return
new
ArrayIterator
(
$this
->
results
);
}
///
/// DatabaseResult
///
public
function
numRows
()
:
int
{
return
count
(
$this
->
results
);
}
public
function
fetchRow
()
:
?
array
{
static
$position
=
0
;
if
(
$position
<
$this
->
numRows
())
{
return
$this
->
results
[
$position
];
}
return
null
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, May 13, 16:55 (21 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2564047
Default Alt Text
MockDatabaseResult.php (722 B)
Attached To
Mode
rKERUALD Keruald libraries development repository
Attached
Detach File
Event Timeline
Log In to Comment