public function saveCalendarEntity(array $calendar = [], array $options = []): array
    {
        $response = [
            'errors' => [],
            'status' => false,
            'entity' => null,
        ];

        $query = $this->find()
            ->where($options['conditions']);

        $query->execute();

        if (!$query->count()) {
            $entity = $this->newEntity();
            $entity = $this->patchEntity($entity, $calendar);
        } else {
            /** @var \Cake\Datasource\EntityInterface $calEntity */
            $calEntity = $query->firstOrFail();
            $entity = $this->patchEntity($calEntity, $calendar);
        }

        $saved = $this->save($entity);

        if ($saved) {
            $response['status'] = true;
            $response['entity'] = $saved;
        } else {
            $response['errors'] = $entity->getErrors();
        }

        return $response;
    }