Page MenuHomeDevCentral

Repository.php
No OneTemporary

Repository.php

<?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

Mime Type
text/x-php
Expires
Sat, Mar 7, 02:44 (16 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3500430
Default Alt Text
Repository.php (799 B)

Event Timeline