Skip to content

Instantly share code, notes, and snippets.

@ciszu
Last active November 11, 2019 08:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ciszu/7a72d7b1df5886964e5d2adb3ff460fb to your computer and use it in GitHub Desktop.
Save ciszu/7a72d7b1df5886964e5d2adb3ff460fb to your computer and use it in GitHub Desktop.
<?php
namespace Mozartify\Subscription;
interface ReadOpStorage
{
public function select(string $model, int $id);
public function selectAll($model);
public function getActivePackage(int $subscriptionId);
}
interface WriteOpStorage
{
public function createNewTenant(string $tenantName);
public function createNewSubscription(int $tenantId);
public function addPackage(int $subscriptionId, string $packageType, int $heartbeats);
public function addExtraHeartbeats(int $subscriptionId, int $heartbeats);
}
class PostgreSqlStorage implements WriteOpStorage, ReadOpStorage
{
// ...
}
class ElasticSearchStorage implements ReadOpStorage
{
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment