<?php

declare(strict_types = 1);

namespace PSX\Model\SchemaOrg;

use PSX\Schema\Attribute\Description;

#[Description('The act of adding at a specific location in an ordered collection.')]
class InsertAction extends AddAction implements \JsonSerializable
{
    protected ?Place $toLocation = null;
    public function setToLocation(?Place $toLocation) : void
    {
        $this->toLocation = $toLocation;
    }
    public function getToLocation() : ?Place
    {
        return $this->toLocation;
    }
    public function jsonSerialize() : object
    {
        return (object) array_merge((array) parent::jsonSerialize(), array_filter(array('toLocation' => $this->toLocation), static function ($value) : bool {
            return $value !== null;
        }));
    }
}

