This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Mozartify\Subscription; | |
class SubscriptionDomain | |
{ | |
public function subscribe($tenantName, $packageType) {} | |
public static function getHeartbeatsByPackageType(string $type) {} | |
public function buyPackage(int $subscriptionId, string $newPackageType) {} | |
public function buyHeartbeats(int $subscriptionId, int $heartbeats) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Mozartify\Subscription; | |
class SubscriptionDomain | |
{ | |
public function subscribe($tenantName, $packageType) {} | |
public static function getHeartbeatsByPackageType(string $type) {} | |
public function buyPackage(int $subscriptionId, string $newPackageType) {} | |
public function buyHeartbeats(int $subscriptionId, int $heartbeats) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "project", | |
"name": "mozartify/web", | |
"require": { | |
"php": "^7.1.3", | |
"mozartify/subscription": "1.2.0", | |
"mozartify/player": "1.0.3" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Mozartify\Subscription; | |
interface ReadOpStorage | |
{ | |
public function select(string $model, int $id); | |
public function selectAll($model); | |
public function getActivePackage(int $subscriptionId); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Mozartify\Subscription; | |
interface Storage | |
{ | |
// ... | |
public function createNewTenant(string $tenantName); | |
public function addPackage(int $subscriptionId, string $packageType); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Mozartify\Subscription\Drivers; | |
use Mozartify\Subscription\WriteOpStorage; | |
use Mozartify\Subscription\ReadOpStorage; | |
class RamStorage implements WriteOpStorage, ReadOpStorage | |
{ | |
// ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Mozartify\Subscription; | |
class PostgreSqlStorage implements Storage | |
{ | |
// ... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Mozartify\Subscription; | |
class PostgreSqlStorage | |
{ | |
public function __construct($dsn) {} | |
public function select(string $model, int $id) {} | |
public function selectAll($model) {} | |
public function createNewTenant(string $tenantName) {} |