Skip to content
Snippets Groups Projects

Ban and artifacts snapshots

Compare and Show latest version
9 files
+ 185
65
Compare changes
  • Side-by-side
  • Inline
Files
9
@@ -10,8 +10,8 @@ namespace Minds\Core\Channels\Delegates\Artifacts;
use Exception;
use Minds\Core\Channels\Snapshots\Repository;
use Minds\Core\Channels\Snapshots\Snapshot;
use Minds\Core\Data\Cassandra\Client as CassandraClient;
use Minds\Core\Data\Cassandra\Prepared\Custom;
use Minds\Core\Data\Cassandra\Scroll;
use Minds\Core\Di\Di;
use Minds\Core\Subscriptions\Manager as SubscriptionsManager;
use Minds\Entities\User;
@@ -21,8 +21,8 @@ class SubscribersDelegate implements ArtifactsDelegateInterface
/** @var Repository */
protected $repository;
/** @var CassandraClient */
protected $db;
/** @var Scroll */
protected $scroll;
/** @var SubscriptionsManager */
protected $subscriptionsManager;
@@ -30,17 +30,17 @@ class SubscribersDelegate implements ArtifactsDelegateInterface
/**
* SubscriptionsDelegate constructor.
* @param Repository $repository
* @param CassandraClient $db
* @param Scroll $scroll
* @param SubscriptionsManager $subscriptionsManager
*/
public function __construct(
$repository = null,
$db = null,
$scroll = null,
$subscriptionsManager = null
)
{
$this->repository = $repository ?: new Repository();
$this->db = $db ?: Di::_()->get('Database\Cassandra\Cql');
$this->scroll = $scroll ?: Di::_()->get('Database\Cassandra\Cql\Scroll');
$this->subscriptionsManager = $subscriptionsManager ?: new SubscriptionsManager();
}
@@ -59,7 +59,7 @@ class SubscribersDelegate implements ArtifactsDelegateInterface
$prepared->query($cql, $values);
try {
$rows = $this->db->iterate($prepared);
$rows = $this->scroll->request($prepared);
foreach ($rows as $row) {
$snapshot = new Snapshot();
@@ -126,7 +126,7 @@ class SubscribersDelegate implements ArtifactsDelegateInterface
$prepared = new Custom();
$prepared->query($cql, $values);
$rows = $this->db->iterate($prepared);
$rows = $this->scroll->request($prepared);
foreach ($rows as $row) {
$subscriber = new User();
Loading