| | |
| | | namespace JVBase\managers\SEO\render\Traits\_Properties; |
| | | |
| | | use JVBase\managers\SEO\render\Thing\Thing; |
| | | use JVBase\managers\SEO\render\Traits\_Helpers\arrayHelper; |
| | | |
| | | if (!defined('ABSPATH')) { |
| | | exit; |
| | | } |
| | | trait mainEntityTrait { |
| | | use arrayHelper; |
| | | /** |
| | | * @var Thing Indicates the primary entity described in some page or other CreativeWork. |
| | | * @var Thing|array Indicates the primary entity described in some page or other CreativeWork. |
| | | * Inverse property: mainEntityOfPage |
| | | */ |
| | | protected Thing $mainEntity; |
| | | protected Thing|array $mainEntity; |
| | | |
| | | public function getMainEntity():?Thing |
| | | public function getMainEntity():Thing|array|null |
| | | { |
| | | return $this->mainEntity??null; |
| | | } |
| | | public function setMainEntity(Thing $mainEntity):void |
| | | public function setMainEntity(Thing|array $mainEntity):void |
| | | { |
| | | if (is_array($mainEntity)) { |
| | | $mainEntity = $this->classArray('mainEntity', $mainEntity, 'JVBase\managers\SEO\render\Thing\Thing'); |
| | | } |
| | | $this->mainEntity = $mainEntity; |
| | | } |
| | | } |