<?php

declare(strict_types=1);

/*
 * Chill is a software for social workers
 *
 * For the full copyright and license information, please view
 * the LICENSE file that was distributed with this source code.
 */

namespace Chill\TicketBundle\Event;

use Chill\PersonBundle\Entity\Person;
use Chill\TicketBundle\Entity\Ticket;

class PersonsUpdateEvent extends TicketUpdateEvent
{
    public function __construct(Ticket $ticket)
    {
        parent::__construct(TicketUpdateKindEnum::UPDATE_PERSONS, $ticket);
    }

    /**
     * @var list<Person>
     */
    public $personsAdded = [];

    /**
     * @var list<Person>
     */
    public $personsRemoved = [];

    public function hasChanges(): bool
    {
        return count($this->personsAdded) > 0 || count($this->personsRemoved) > 0;
    }
}
