Jake Vanderwerf
9 days ago 47e77f9fac1155c536b2b87fec552c7fcce66fa6
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\Organization\Organization;
use JVBase\managers\SEO\render\Thing\Person\Person;
use JVBase\managers\SEO\render\Traits\_Helpers\arrayHelper;
 
if (!defined('ABSPATH')) {
    exit;
}
trait agentTrait {
    use arrayHelper;
    /**
     * @var Organization|Person|array The direct performer or driver of the action (animate or inanimate). E.g. John wrote a book.
     */
    protected Organization|Person|array $agent;
 
    public function getAgent():Organization|Person|array|null
    {
        return $this->agent??null;
    }
    public function setAgent(Organization|Person|array $agent):void
    {
        if (is_array($agent)) {
            $agent = $this->mixedArray('agent', $agent, [
                'JVBase\managers\SEO\render\Thing\Organization\Organization',
                'JVBase\managers\SEO\render\Thing\Person\Person'
            ]);
        }
        $this->agent = $agent;
    }
}