2022-01-19 17:30:34 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types = 1);
|
|
|
|
|
/**
|
2024-05-23 03:26:56 -04:00
|
|
|
* This file is part of the Symfony package.
|
2022-01-19 17:30:34 -05:00
|
|
|
*
|
2024-05-23 03:26:56 -04:00
|
|
|
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-FileCopyrightText: 2022 Fabien Potencier <fabien@symfony.com>
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later AND MIT
|
2022-01-19 17:30:34 -05:00
|
|
|
*/
|
|
|
|
|
namespace OC\DB;
|
|
|
|
|
|
|
|
|
|
final class ObjectParameter {
|
|
|
|
|
private $stringable;
|
|
|
|
|
private $class;
|
|
|
|
|
|
2025-11-17 09:32:54 -05:00
|
|
|
public function __construct(
|
2025-11-18 11:36:29 -05:00
|
|
|
private object $object,
|
2025-11-17 09:32:54 -05:00
|
|
|
private ?\Throwable $error,
|
|
|
|
|
) {
|
|
|
|
|
$this->stringable = \is_callable([$this->object, '__toString']);
|
|
|
|
|
$this->class = \get_class($this->object);
|
2022-01-19 17:30:34 -05:00
|
|
|
}
|
|
|
|
|
|
2025-11-18 11:36:29 -05:00
|
|
|
public function getObject(): object {
|
2022-01-19 17:30:34 -05:00
|
|
|
return $this->object;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getError(): ?\Throwable {
|
|
|
|
|
return $this->error;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function isStringable(): bool {
|
|
|
|
|
return $this->stringable;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getClass(): string {
|
|
|
|
|
return $this->class;
|
|
|
|
|
}
|
|
|
|
|
}
|