Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F24683295
Repository.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
799 B
Referenced Files
None
Subscribers
None
Repository.php
View Options
<?php
namespace
Waystone\Workspaces\Engines\Framework
;
use
Keruald\Database\DatabaseEngine
;
use
Keruald\OmniTools\Collections\HashMap
;
use
Keruald\OmniTools\DataTypes\Option\Option
;
abstract
class
Repository
{
///
/// Properties
///
protected
DatabaseEngine
$db
;
/**
* @var HashMap A map of objects already loaded from the database
*/
protected
HashMap
$table
;
///
/// Constructor
///
public
function
__construct
(
DatabaseEngine
$db
)
{
$this
->
db
=
$db
;
$this
->
table
=
new
HashMap
();
}
///
/// Table
///
protected
function
lookupInTable
(
string
$property
,
string
$value
)
:
Option
{
return
$this
->
table
->
filter
(
fn
(
$item
)
=>
$item
->
$property
==
$value
)
->
first
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Mar 7, 02:44 (1 d, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3500430
Default Alt Text
Repository.php (799 B)
Attached To
Mode
rOBSIDIAN Obsidian Workspaces
Attached
Detach File
Event Timeline
Log In to Comment