Add WooCommerce purchases relation to statistics clicks entity
[PREMIUM-145]
This commit is contained in:
committed by
Veljko V
parent
cbc4820c6a
commit
aee2d82396
@@ -6,6 +6,7 @@ use MailPoet\Doctrine\EntityTraits\AutoincrementedIdTrait;
|
||||
use MailPoet\Doctrine\EntityTraits\CreatedAtTrait;
|
||||
use MailPoet\Doctrine\EntityTraits\SafeToOneAssociationLoadTrait;
|
||||
use MailPoet\Doctrine\EntityTraits\UpdatedAtTrait;
|
||||
use MailPoetVendor\Doctrine\Common\Collections\ArrayCollection;
|
||||
use MailPoetVendor\Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
@@ -45,6 +46,12 @@ class StatisticsClickEntity {
|
||||
*/
|
||||
private $link;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity="MailPoet\Entities\StatisticsWooCommercePurchaseEntity", mappedBy="click", fetch="EXTRA_LAZY")*
|
||||
* @var StatisticsWooCommercePurchaseEntity[]|ArrayCollection
|
||||
*/
|
||||
private $wooCommercePurchases;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
* @var int
|
||||
@@ -63,6 +70,7 @@ class StatisticsClickEntity {
|
||||
$this->subscriber = $subscriber;
|
||||
$this->link = $link;
|
||||
$this->count = $count;
|
||||
$this->wooCommercePurchases = new ArrayCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -123,4 +131,11 @@ class StatisticsClickEntity {
|
||||
public function setCount(int $count) {
|
||||
$this->count = $count;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return StatisticsWooCommercePurchaseEntity[]|ArrayCollection
|
||||
*/
|
||||
public function getWooCommercePurchases() {
|
||||
return $this->wooCommercePurchases;
|
||||
}
|
||||
}
|
||||
|
@@ -40,7 +40,7 @@ class StatisticsWooCommercePurchaseEntity {
|
||||
private $subscriber;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="MailPoet\Entities\StatisticsClickEntity")
|
||||
* @ORM\ManyToOne(targetEntity="MailPoet\Entities\StatisticsClickEntity", inversedBy="wooCommercePurchases")
|
||||
* @ORM\JoinColumn(name="click_id", referencedColumnName="id")
|
||||
* @var StatisticsClickEntity|null
|
||||
*/
|
||||
@@ -118,4 +118,18 @@ class StatisticsWooCommercePurchaseEntity {
|
||||
public function setSubscriber($subscriber) {
|
||||
$this->subscriber = $subscriber;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getOrderCurrency(): string {
|
||||
return $this->orderCurrency;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return float
|
||||
*/
|
||||
public function getOrderPriceTotal(): float {
|
||||
return $this->orderPriceTotal;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user