diff options
author | diosmosis <diosmosis@users.noreply.github.com> | 2019-11-18 10:08:16 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-18 10:08:16 +0300 |
commit | 60009312a44f1aa728a0f9f6f7e0a8a59068544d (patch) | |
tree | 2b037e8abdf08ed024946a6a841757162ea9443f /core/Plugin/Segment.php | |
parent | 12011166e3934f1d76f2d183a63cfe2ff9bde8e6 (diff) |
Add product name, product category, product sku, product price segments (#15144)
* Add product category segment.
* Fix productCategory action, add productName, productSku, productPrice segments.
* Hide productCategory1...5 segments in UI/API.
* fix tests
* Do not select conversion items that are deleted in segments + fix bug in ecommerce item insert (do not fail whole insert if one duplicate primary key is found).
* update expected files
* Fix unit test.
Diffstat (limited to 'core/Plugin/Segment.php')
-rw-r--r-- | core/Plugin/Segment.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/core/Plugin/Segment.php b/core/Plugin/Segment.php index 9319eb4fc9..cfaaa4ef1c 100644 --- a/core/Plugin/Segment.php +++ b/core/Plugin/Segment.php @@ -53,6 +53,7 @@ class Segment private $permission; private $suggestedValuesCallback; private $unionOfSegments; + private $isInternalSegment = false; /** * If true, this segment will only be visible to the user if the user has view access @@ -373,6 +374,28 @@ class Segment $this->requiresAtLeastViewAccess = $requiresAtLeastViewAccess; } + /** + * Sets whether the segment is for internal use only and should not be visible in the UI or in API metadata output. + * These types of segments are, for example, used in unions for other segments, but have no value to users. + * + * @param bool $value + */ + public function setIsInternal($value) + { + $this->isInternalSegment = $value; + } + + /** + * Gets whether the segment is for internal use only and should not be visible in the UI or in API metadata output. + * These types of segments are, for example, used in unions for other segments, but have no value to users. + * + * @return bool + */ + public function isInternal() + { + return $this->isInternalSegment; + } + private function check() { if ($this->sqlSegment && $this->unionOfSegments) { |