[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.12.148.140: ~ $
<?php

namespace MailPoet\Entities;

if (!defined('ABSPATH')) exit;


use MailPoet\Doctrine\EntityTraits\AutoincrementedIdTrait;
use MailPoet\Doctrine\EntityTraits\CreatedAtTrait;
use MailPoet\Doctrine\EntityTraits\DeletedAtTrait;
use MailPoet\Doctrine\EntityTraits\UpdatedAtTrait;
use MailPoetVendor\Doctrine\Common\Collections\ArrayCollection;
use MailPoetVendor\Doctrine\ORM\Mapping as ORM;
use MailPoetVendor\Symfony\Component\Validator\Constraints as Assert;

/**
 * @ORM\Entity()
 * @ORM\Table(name="segments")
 */
class SegmentEntity {
  use AutoincrementedIdTrait;
  use CreatedAtTrait;
  use UpdatedAtTrait;
  use DeletedAtTrait;

  const TYPE_WP_USERS = 'wp_users';
  const TYPE_WC_USERS = 'woocommerce_users';
  const TYPE_DEFAULT = 'default';
  const TYPE_DYNAMIC = 'dynamic';
  const TYPE_WITHOUT_LIST = 'without-list';

  const SEGMENT_ENABLED = 'active';
  const SEGMENT_DISABLED = 'disabled';

  /**
   * @ORM\Column(type="string")
   * @Assert\NotBlank()
   * @var string
   */
  private $name;

  /**
   * @ORM\Column(type="string")
   * @var string
   */
  private $type;

  /**
   * @ORM\Column(type="string")
   * @var string
   */
  private $description;

  /**
   * @ORM\OneToMany(targetEntity="MailPoet\Entities\DynamicSegmentFilterEntity", mappedBy="segment")
   * @var ArrayCollection<int, DynamicSegmentFilterEntity>
   */
  private $dynamicFilters;

  /**
   * @ORM\Column(type="float", nullable=true)
   * @var float|null
   */
  private $averageEngagementScore;

  /**
   * @ORM\Column(type="datetimetz", nullable=true)
   * @var \DateTimeInterface|null
   */
  private $averageEngagementScoreUpdatedAt;

  public function __construct(
    string $name,
    string $type,
    string $description
  ) {
    $this->name = $name;
    $this->type = $type;
    $this->description = $description;
    $this->dynamicFilters = new ArrayCollection();
  }

  public function __clone() {
    // reset ID
    $this->id = null;
  }

  /**
   * @return string
   */
  public function getName() {
    return $this->name;
  }

  /**
   * @param string $name
   */
  public function setName($name) {
    $this->name = $name;
  }

  /**
   * @return string
   */
  public function getType() {
    return $this->type;
  }

  /**
   * @param string $type
   */
  public function setType($type) {
    $this->type = $type;
  }

  /**
   * @return string
   */
  public function getDescription() {
    return $this->description;
  }

  /**
   * @param string $description
   */
  public function setDescription($description) {
    $this->description = $description;
  }

  /**
   * @return ArrayCollection<int, DynamicSegmentFilterEntity>
   */
  public function getDynamicFilters() {
    return $this->dynamicFilters;
  }

  public function addDynamicFilter(DynamicSegmentFilterEntity $dynamicSegmentFilterEntity) {
    $this->dynamicFilters->add($dynamicSegmentFilterEntity);
  }

  public function isStatic(): bool {
    return in_array($this->getType(), [self::TYPE_DEFAULT, self::TYPE_WP_USERS, self::TYPE_WC_USERS], true);
  }

  public function getAverageEngagementScore(): ?float {
    return $this->averageEngagementScore;
  }

  public function setAverageEngagementScore(?float $averageEngagementScore): void {
    $this->averageEngagementScore = $averageEngagementScore;
  }

  public function getAverageEngagementScoreUpdatedAt(): ?\DateTimeInterface {
    return $this->averageEngagementScoreUpdatedAt;
  }

  public function setAverageEngagementScoreUpdatedAt(?\DateTimeInterface $averageEngagementScoreUpdatedAt): void {
    $this->averageEngagementScoreUpdatedAt = $averageEngagementScoreUpdatedAt;
  }

  /**
   * Returns connect operand from the first filter, when doesn't exist, then returns a default value.
   * @return string
   */
  public function getFiltersConnectOperator(): string {
    $firstFilter = $this->getDynamicFilters()->first();
    $filterData = $firstFilter ? $firstFilter->getFilterData() : null;
    if (!$firstFilter || !$filterData) {
      return DynamicSegmentFilterData::CONNECT_TYPE_AND;
    }
    return $filterData->getParam('connect') ?: DynamicSegmentFilterData::CONNECT_TYPE_AND;
  }
}

Filemanager

Name Type Size Permission Actions
CustomFieldEntity.php File 1.64 KB 0644
DynamicSegmentFilterData.php File 1.28 KB 0644
DynamicSegmentFilterEntity.php File 1.51 KB 0644
FeatureFlagEntity.php File 1.25 KB 0644
FormEntity.php File 4.65 KB 0644
LogEntity.php File 1.32 KB 0644
NewsletterEntity.php File 10.66 KB 0644
NewsletterLinkEntity.php File 2.34 KB 0644
NewsletterOptionEntity.php File 1.7 KB 0644
NewsletterOptionFieldEntity.php File 1.89 KB 0644
NewsletterPostEntity.php File 1.17 KB 0644
NewsletterSegmentEntity.php File 1.33 KB 0644
NewsletterTemplateEntity.php File 2.53 KB 0644
ScheduledTaskEntity.php File 2.97 KB 0644
ScheduledTaskSubscriberEntity.php File 2.34 KB 0644
SegmentEntity.php File 4.05 KB 0644
SendingQueueEntity.php File 4.82 KB 0644
SettingEntity.php File 1.26 KB 0644
StatisticsBounceEntity.php File 1.34 KB 0644
StatisticsClickEntity.php File 4.15 KB 0644
StatisticsFormEntity.php File 1.26 KB 0644
StatisticsNewsletterEntity.php File 2.1 KB 0644
StatisticsOpenEntity.php File 2.64 KB 0644
StatisticsUnsubscribeEntity.php File 2.43 KB 0644
StatisticsWooCommercePurchaseEntity.php File 3.2 KB 0644
StatsNotificationEntity.php File 1.3 KB 0644
SubscriberCustomFieldEntity.php File 3.19 KB 0644
SubscriberEntity.php File 9.79 KB 0644
SubscriberIPEntity.php File 979 B 0644
SubscriberSegmentEntity.php File 1.67 KB 0644
UserAgentEntity.php File 1.32 KB 0644
UserFlagEntity.php File 1.22 KB 0644
index.php File 0 B 0644