diff --git a/Classes/Domain/Model/NewsInstagram.php b/Classes/Domain/Model/NewsInstagram.php index 8de961b..cd28bd5 100644 --- a/Classes/Domain/Model/NewsInstagram.php +++ b/Classes/Domain/Model/NewsInstagram.php @@ -16,6 +16,8 @@ class NewsInstagram extends News protected string $mediaType = ''; + protected string $permalink = ''; + public function getInstagramId(): string { return $this->instagramId; @@ -51,4 +53,14 @@ public function setMediaType(string $mediaType): self return $this; } + + public function getPermalink(): string + { + return $this->permalink; + } + + public function setPermalink(string $permalink): void + { + $this->permalink = $permalink; + } } diff --git a/Classes/Service/PostUpserter.php b/Classes/Service/PostUpserter.php index 222f392..d2d58a5 100644 --- a/Classes/Service/PostUpserter.php +++ b/Classes/Service/PostUpserter.php @@ -73,7 +73,8 @@ public function upsertPost(PostDTO $dto, int $storagePid, ApiClientInterface $ap $newsItem ->setInstagramId($dto->getId()) ->setPostedBy($apiClient->getFeed()->getUsername()) - ->setMediaType($dto->getMediaType()); + ->setMediaType($dto->getMediaType()) + ->setPermalink($dto->getPermalink()); /** @var \DateTimeImmutable $postedAt */ $postedAt = $dto->getTimestamp(); diff --git a/Configuration/TCA/Overrides/tx_news_domain_model_news.php b/Configuration/TCA/Overrides/tx_news_domain_model_news.php index e496062..bbb56b6 100644 --- a/Configuration/TCA/Overrides/tx_news_domain_model_news.php +++ b/Configuration/TCA/Overrides/tx_news_domain_model_news.php @@ -32,12 +32,20 @@ 'size' => 30, ], ], + 'permalink' => [ + 'exclude' => 1, + 'label' => 'Permalink', + 'config' => [ + 'type' => 'input', + 'size' => 30, + ], + ], ]; \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToPalette( 'tx_news_domain_model_news', 'tx_instagram2news_fields', - 'instagram_id, posted_by, media_type' + 'instagram_id, posted_by, media_type, permalink' ); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tx_news_domain_model_news', $fields); diff --git a/composer.json b/composer.json index eb17cac..d605279 100755 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "phpstan/extension-installer": "^1.2", "phpstan/phpstan": "^1.4", "typo3/coding-standards": "^0.6.1", - "typo3/testing-framework": "^6.16" + "typo3/testing-framework": "^8" }, "autoload": { "psr-4": { diff --git a/ext_localconf.php b/ext_localconf.php index 0d05277..79cf354 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -8,7 +8,6 @@ 'className' => \DSKZPT\Instagram2News\Domain\Model\NewsInstagram::class, ]; - //\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\Container\Container::class) // ->registerImplementation( // \GeorgRinger\News\Domain\Model\News::class, diff --git a/ext_tables.sql b/ext_tables.sql index a2be76b..21ddabb 100755 --- a/ext_tables.sql +++ b/ext_tables.sql @@ -6,4 +6,5 @@ CREATE TABLE tx_news_domain_model_news instagram_id varchar(255) DEFAULT '' NOT NULL, posted_by varchar(255) DEFAULT '' NOT NULL, media_type varchar(255) DEFAULT '' NOT NULL, + permalink varchar(255) DEFAULT '' NOT NULL, );