Skip to content

Commit

Permalink
Remove not required values from newsletter channel
Browse files Browse the repository at this point in the history
  • Loading branch information
magicsunday committed Apr 26, 2024
1 parent def1282 commit 1a76564
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 219 deletions.
4 changes: 0 additions & 4 deletions Classes/Command/ImportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,6 @@ private function hydrateNewsletterChannel(
$newsletterChannelDomainModel
->setNewsletterChannelId($newsletterChannel->id)
->setTitle($newsletterChannel->title)
->setIsPublic($newsletterChannel->isPublic)
->setIsVirtual($newsletterChannel->isVChannel)
->setOid($newsletterChannel->oid)
->setEstimatedCount($newsletterChannel->estimatedCount)
->setCrdate(new DateTime())
->setTstamp(new DateTime());

Expand Down
172 changes: 36 additions & 136 deletions Classes/Domain/Model/NewsletterChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,49 +24,29 @@
class NewsletterChannel extends AbstractEntity
{
/**
* @var string
*/
protected string $newsletterChannelId = '';

/**
* @var string
* @var DateTime
*/
protected string $title = '';
protected DateTime $crdate;

/**
* @var bool
* @var DateTime
*/
protected bool $isPublic = false;
protected DateTime $tstamp;

/**
* @var bool
*/
protected bool $isVirtual = false;
protected bool $deleted = false;

/**
* @var string
*/
protected string $oid = '';

/**
* @var int
*/
protected int $estimatedCount = 0;

/**
* @var DateTime
*/
protected DateTime $crdate;

/**
* @var DateTime
*/
protected DateTime $tstamp;
protected string $newsletterChannelId = '';

/**
* @var bool
* @var string
*/
protected bool $deleted = false;
protected string $title = '';

/**
* @var string
Expand All @@ -89,181 +69,101 @@ class NewsletterChannel extends AbstractEntity
protected string $embedImages = 'none';

/**
* @return string
*/
public function getNewsletterChannelId(): string
{
return $this->newsletterChannelId;
}

/**
* @param string $newsletterChannelId
*
* @return NewsletterChannel
*/
public function setNewsletterChannelId(string $newsletterChannelId): NewsletterChannel
{
$this->newsletterChannelId = $newsletterChannelId;

return $this;
}

/**
* @return string
* @return DateTime
*/
public function getTitle(): string
public function getCrdate(): DateTime
{
return $this->title;
return $this->crdate;
}

/**
* @param string $title
* @param DateTime $crdate
*
* @return NewsletterChannel
*/
public function setTitle(string $title): NewsletterChannel
public function setCrdate(DateTime $crdate): NewsletterChannel
{
$this->title = $title;
$this->crdate = $crdate;

return $this;
}

/**
* @return bool
* @return DateTime
*/
public function isPublic(): bool
public function getTstamp(): DateTime
{
return $this->isPublic;
return $this->tstamp;
}

/**
* @param bool $isPublic
* @param DateTime $tstamp
*
* @return NewsletterChannel
*/
public function setIsPublic(bool $isPublic): NewsletterChannel
public function setTstamp(DateTime $tstamp): NewsletterChannel
{
$this->isPublic = $isPublic;
$this->tstamp = $tstamp;

return $this;
}

/**
* @return bool
*/
public function isVirtual(): bool
public function isDeleted(): bool
{
return $this->isVirtual;
return $this->deleted;
}

/**
* @param bool $isVirtual
* @param bool $deleted
*
* @return NewsletterChannel
*/
public function setIsVirtual(bool $isVirtual): NewsletterChannel
public function setDeleted(bool $deleted): NewsletterChannel
{
$this->isVirtual = $isVirtual;
$this->deleted = $deleted;

return $this;
}

/**
* @return string
*/
public function getOid(): string
{
return $this->oid;
}

/**
* @param string $oid
*
* @return NewsletterChannel
*/
public function setOid(string $oid): NewsletterChannel
{
$this->oid = $oid;

return $this;
}

/**
* @return int
*/
public function getEstimatedCount(): int
{
return $this->estimatedCount;
}

/**
* @param int $estimatedCount
*
* @return NewsletterChannel
*/
public function setEstimatedCount(int $estimatedCount): NewsletterChannel
{
$this->estimatedCount = $estimatedCount;

return $this;
}

/**
* @return DateTime
*/
public function getCrdate(): DateTime
{
return $this->crdate;
}

/**
* @param DateTime $crdate
*
* @return NewsletterChannel
*/
public function setCrdate(DateTime $crdate): NewsletterChannel
{
$this->crdate = $crdate;

return $this;
}

/**
* @return DateTime
*/
public function getTstamp(): DateTime
public function getNewsletterChannelId(): string
{
return $this->tstamp;
return $this->newsletterChannelId;
}

/**
* @param DateTime $tstamp
* @param string $newsletterChannelId
*
* @return NewsletterChannel
*/
public function setTstamp(DateTime $tstamp): NewsletterChannel
public function setNewsletterChannelId(string $newsletterChannelId): NewsletterChannel
{
$this->tstamp = $tstamp;
$this->newsletterChannelId = $newsletterChannelId;

return $this;
}

/**
* @return bool
* @return string
*/
public function isDeleted(): bool
public function getTitle(): string
{
return $this->deleted;
return $this->title;
}

/**
* @param bool $deleted
* @param string $title
*
* @return NewsletterChannel
*/
public function setDeleted(bool $deleted): NewsletterChannel
public function setTitle(string $title): NewsletterChannel
{
$this->deleted = $deleted;
$this->title = $title;

return $this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
],
'types' => [
0 => [
'showitem' => 'newsletter_channel_id, title, is_public, is_virtual, oid, estimated_count, sender, reply_to, skip_used_id, embed_images',
'showitem' => 'newsletter_channel_id, title, sender, reply_to, skip_used_id, embed_images',
],
],
'columns' => [
Expand Down Expand Up @@ -106,49 +106,6 @@
'required' => true,
],
],
'is_public' => [
'exclude' => true,
'label' => 'LLL:EXT:nrc_universal_messenger/Resources/Private/Language/locallang.xlf:tx_nrcuniversalmessenger_domain_model_newsletterchannel.is_public',
'config' => [
'type' => 'check',
'renderType' => 'checkboxToggle',
'default' => 0,
'readOnly' => true,
],
],
'is_virtual' => [
'exclude' => true,
'label' => 'LLL:EXT:nrc_universal_messenger/Resources/Private/Language/locallang.xlf:tx_nrcuniversalmessenger_domain_model_newsletterchannel.is_virtual',
'config' => [
'type' => 'check',
'renderType' => 'checkboxToggle',
'default' => 0,
'readOnly' => true,
],
],
'oid' => [
'exclude' => true,
'label' => 'LLL:EXT:nrc_universal_messenger/Resources/Private/Language/locallang.xlf:tx_nrcuniversalmessenger_domain_model_newsletterchannel.oid',
'config' => [
'type' => 'input',
'size' => 255,
'eval' => 'trim',
'readOnly' => true,
'required' => true,
],
],
'estimated_count' => [
'exclude' => true,
'label' => 'LLL:EXT:nrc_universal_messenger/Resources/Private/Language/locallang.xlf:tx_nrcuniversalmessenger_domain_model_newsletterchannel.estimated_count',
'description' => 'LLL:EXT:nrc_universal_messenger/Resources/Private/Language/locallang.xlf:tx_nrcuniversalmessenger_domain_model_newsletterchannel.estimated_count.description',
'config' => [
'type' => 'input',
'size' => 10,
'eval' => 'trim',
'readOnly' => true,
'required' => true,
],
],
'sender' => [
'exclude' => true,
'label' => 'LLL:EXT:nrc_universal_messenger/Resources/Private/Language/locallang.xlf:tx_nrcuniversalmessenger_domain_model_newsletterchannel.sender',
Expand Down
15 changes: 0 additions & 15 deletions Resources/Private/Language/de.locallang.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,6 @@
<trans-unit id="tx_nrcuniversalmessenger_domain_model_newsletterchannel.title.description">
<target>Der Titel des Newsletter-Kanals.</target>
</trans-unit>
<trans-unit id="tx_nrcuniversalmessenger_domain_model_newsletterchannel.is_public">
<target>Ist öffentlich?</target>
</trans-unit>
<trans-unit id="tx_nrcuniversalmessenger_domain_model_newsletterchannel.is_virtual">
<target>Ist ein virtueller Kanal?</target>
</trans-unit>
<trans-unit id="tx_nrcuniversalmessenger_domain_model_newsletterchannel.oid">
<target>OID</target>
</trans-unit>
<trans-unit id="tx_nrcuniversalmessenger_domain_model_newsletterchannel.estimated_count">
<target>Geschätzte Anzahl</target>
</trans-unit>
<trans-unit id="tx_nrcuniversalmessenger_domain_model_newsletterchannel.estimated_count.description">
<target>Die geschätzte Anzahl der Einträge in einem Kanal oder Segment.</target>
</trans-unit>
<trans-unit id="tx_nrcuniversalmessenger_domain_model_newsletterchannel.sender">
<target>E-Mail-Adresse des Absenders</target>
</trans-unit>
Expand Down
15 changes: 0 additions & 15 deletions Resources/Private/Language/locallang.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,6 @@
<trans-unit id="tx_nrcuniversalmessenger_domain_model_newsletterchannel.title.description">
<source>The title the newsletter channel.</source>
</trans-unit>
<trans-unit id="tx_nrcuniversalmessenger_domain_model_newsletterchannel.is_public">
<source>Is public?</source>
</trans-unit>
<trans-unit id="tx_nrcuniversalmessenger_domain_model_newsletterchannel.is_virtual">
<source>Is virtual channel?</source>
</trans-unit>
<trans-unit id="tx_nrcuniversalmessenger_domain_model_newsletterchannel.oid">
<source>OID</source>
</trans-unit>
<trans-unit id="tx_nrcuniversalmessenger_domain_model_newsletterchannel.estimated_count">
<source>Estimated count</source>
</trans-unit>
<trans-unit id="tx_nrcuniversalmessenger_domain_model_newsletterchannel.estimated_count.description">
<source>The estimated number of entries in a channel or segment.</source>
</trans-unit>
<trans-unit id="tx_nrcuniversalmessenger_domain_model_newsletterchannel.sender">
<source>Sender email address</source>
</trans-unit>
Expand Down
5 changes: 0 additions & 5 deletions ext_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ CREATE TABLE tx_nrcuniversalmessenger_domain_model_newsletterchannel

newsletter_channel_id varchar(255) DEFAULT '' NOT NULL,
title varchar(255) DEFAULT '' NOT NULL,
is_public smallint(5) unsigned DEFAULT '0' NOT NULL,
is_virtual smallint(5) unsigned DEFAULT '0' NOT NULL,
oid varchar(255) DEFAULT '' NOT NULL,
estimated_count int(11) unsigned DEFAULT '0' NOT NULL,

sender varchar(255) DEFAULT '' NOT NULL,
reply_to varchar(255) DEFAULT '' NOT NULL,
skip_used_id smallint(5) unsigned DEFAULT '0' NOT NULL,
Expand Down

0 comments on commit 1a76564

Please sign in to comment.