Jake Vanderwerf
3 days ago ba1e1ccf869b818f7a7a897264dfea05563a7796
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
namespace JVBase\managers\SEO\render\Traits\_Properties;
 
use JVBase\managers\SEO\render\Thing\Intangible\Service;
use JVBase\managers\SEO\render\Thing\Product\Product;
use JVBase\managers\SEO\render\Traits\_Helpers\arrayHelper;
 
if (!defined('ABSPATH')) {
    exit;
}
trait isSimilarToTrait {
    use arrayHelper;
    /**
     * @var Product|Service|array A pointer to another, somehow related product (or multiple products).
     */
    protected Product|Service|array $isSimilarTo;
 
    public function getIsSimilarTo():Product|Service|array|null
    {
        return $this->isSimilarTo??null;
    }
    public function setIsSimilarTo(Product|Service|array $isSimilarTo):void
    {
        if (is_array($isSimilarTo)) {
            $isSimilarTo = $this->mixedArray('isSimilarTo', $isSimilarTo, [
                'JVBase\managers\SEO\render\Thing\Intangible\Service',
                'JVBase\managers\SEO\render\Thing\Product\Product'
            ]);
        }
        $this->isSimilarTo = $isSimilarTo;
    }
}