Loading Controllers/api/v2/analytics/views.php +1 −0 Original line number Diff line number Diff line Loading @@ -105,6 +105,7 @@ class views implements Interfaces\Api $viewsManager->record( (new Core\Analytics\Views\View()) ->setEntityUrn($activity->getUrn()) ->setOwnerGuid((string) $activity->getOwnerGuid()) ->setClientMeta($_POST['client_meta'] ?? []) ); } catch (\Exception $e) { Loading Core/Analytics/Views/ElasticRepository.php +1 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,7 @@ class ElasticRepository 'uuid' => $view->getUuid(), '@timestamp' => $view->getTimestamp() * 1000, 'entity_urn' => $view->getEntityUrn(), 'owner_guid' => $view->getOwnerGuid(), 'page_token' => $view->getPageToken(), 'campaign' => $view->getCampaign(), 'delta' => (int) $view->getDelta(), Loading Core/Analytics/Views/Repository.php +3 −1 Original line number Diff line number Diff line Loading @@ -104,6 +104,7 @@ class Repository ->setDay((int) $row['day'] ?: null) ->setUuid($row['uuid']->uuid() ?: null) ->setEntityUrn($row['entity_urn']) ->setOwnerGuid($row['owner_guid']) ->setPageToken($row['page_token']) ->setPosition((int) $row['position']) ->setSource($row['platform']) Loading Loading @@ -135,13 +136,14 @@ class Repository $timestamp = $view->getTimestamp() ?: time(); $date = new DateTime("@{$timestamp}", new DateTimeZone('utc')); $cql = "INSERT INTO views (year, month, day, uuid, entity_urn, page_token, position, platform, source, medium, campaign, delta) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; $cql = "INSERT INTO views (year, month, day, uuid, entity_urn, owner_guid, page_token, position, platform, source, medium, campaign, delta) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; $values = [ (int) ($view->getYear() ?? $date->format('Y')), new Tinyint((int) ($view->getMonth() ?? $date->format('m'))), new Tinyint((int) ($view->getDay() ?? $date->format('d'))), new Timeuuid($view->getUuid() ?? $timestamp * 1000), $view->getEntityUrn() ?: '', (string) ($view->getOwnerGuid() ?? ''), $view->getPageToken() ?: '', (int) ($view->getPosition() ?? -1), $view->getPlatform() ?: '', Loading Core/Analytics/Views/View.php +5 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,8 @@ use Minds\Traits\MagicAttributes; * @method string getUuid() * @method View setEntityUrn(string $entityUrn) * @method string getEntityUrn() * @method View setOwnerGuid(string $ownerGuid) * @method string getOwnerGuid() * @method View setPageToken(string $pageToken) * @method string getPageToken() * @method View setPosition(int $position) Loading Loading @@ -57,6 +59,9 @@ class View /** @var string */ protected $entityUrn; /** @var string */ protected $ownerGuid; /** @var string */ protected $pageToken; Loading Core/Provisioner/Provisioners/cassandra-provision.cql +2 −0 Original line number Diff line number Diff line Loading @@ -1445,3 +1445,5 @@ CREATE TABLE minds.email_campaign_logs ( email_campaign_id text, PRIMARY KEY (receiver_guid, time_sent) ) WITH CLUSTERING ORDER BY (time_sent desc); ALTER TABLE minds.views ADD owner_guid text; No newline at end of file Loading
Controllers/api/v2/analytics/views.php +1 −0 Original line number Diff line number Diff line Loading @@ -105,6 +105,7 @@ class views implements Interfaces\Api $viewsManager->record( (new Core\Analytics\Views\View()) ->setEntityUrn($activity->getUrn()) ->setOwnerGuid((string) $activity->getOwnerGuid()) ->setClientMeta($_POST['client_meta'] ?? []) ); } catch (\Exception $e) { Loading
Core/Analytics/Views/ElasticRepository.php +1 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,7 @@ class ElasticRepository 'uuid' => $view->getUuid(), '@timestamp' => $view->getTimestamp() * 1000, 'entity_urn' => $view->getEntityUrn(), 'owner_guid' => $view->getOwnerGuid(), 'page_token' => $view->getPageToken(), 'campaign' => $view->getCampaign(), 'delta' => (int) $view->getDelta(), Loading
Core/Analytics/Views/Repository.php +3 −1 Original line number Diff line number Diff line Loading @@ -104,6 +104,7 @@ class Repository ->setDay((int) $row['day'] ?: null) ->setUuid($row['uuid']->uuid() ?: null) ->setEntityUrn($row['entity_urn']) ->setOwnerGuid($row['owner_guid']) ->setPageToken($row['page_token']) ->setPosition((int) $row['position']) ->setSource($row['platform']) Loading Loading @@ -135,13 +136,14 @@ class Repository $timestamp = $view->getTimestamp() ?: time(); $date = new DateTime("@{$timestamp}", new DateTimeZone('utc')); $cql = "INSERT INTO views (year, month, day, uuid, entity_urn, page_token, position, platform, source, medium, campaign, delta) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; $cql = "INSERT INTO views (year, month, day, uuid, entity_urn, owner_guid, page_token, position, platform, source, medium, campaign, delta) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; $values = [ (int) ($view->getYear() ?? $date->format('Y')), new Tinyint((int) ($view->getMonth() ?? $date->format('m'))), new Tinyint((int) ($view->getDay() ?? $date->format('d'))), new Timeuuid($view->getUuid() ?? $timestamp * 1000), $view->getEntityUrn() ?: '', (string) ($view->getOwnerGuid() ?? ''), $view->getPageToken() ?: '', (int) ($view->getPosition() ?? -1), $view->getPlatform() ?: '', Loading
Core/Analytics/Views/View.php +5 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,8 @@ use Minds\Traits\MagicAttributes; * @method string getUuid() * @method View setEntityUrn(string $entityUrn) * @method string getEntityUrn() * @method View setOwnerGuid(string $ownerGuid) * @method string getOwnerGuid() * @method View setPageToken(string $pageToken) * @method string getPageToken() * @method View setPosition(int $position) Loading Loading @@ -57,6 +59,9 @@ class View /** @var string */ protected $entityUrn; /** @var string */ protected $ownerGuid; /** @var string */ protected $pageToken; Loading
Core/Provisioner/Provisioners/cassandra-provision.cql +2 −0 Original line number Diff line number Diff line Loading @@ -1445,3 +1445,5 @@ CREATE TABLE minds.email_campaign_logs ( email_campaign_id text, PRIMARY KEY (receiver_guid, time_sent) ) WITH CLUSTERING ORDER BY (time_sent desc); ALTER TABLE minds.views ADD owner_guid text; No newline at end of file