table = $table; } public function where($key, $value) { $this->where[$key] = $value; return $this; } public function get() { return array_values(array_filter($GLOBALS['db'][$this->table] ?? [], function ($row) { foreach ($this->where as $key => $value) if ($row->$key != $value) return false; return true; })); } public function first() { return $this->get()[0] ?? null; } } } namespace { class BackupTestClient { public $id; public $permitted; public function __construct($id, $permitted = true) { $this->id = $id; $this->permitted = $permitted; } public function hasPermission($permission) { return $permission === 'products' && $this->permitted; } } function logActivity($message) { $GLOBALS['safeLogs'][] = $message; } }