From e1eb6fff839fcfbb2f6cf74d5e2dc22cec7d1af4 Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 13 Mar 2025 09:18:53 +0000 Subject: [PATCH] Deprecate BaseRepository::_selectOne() set BaseRepository::_selectFirstRowAsArray() as final --- src/BaseRepository.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/BaseRepository.php b/src/BaseRepository.php index ead4bf73bf..bf495a6a5d 100644 --- a/src/BaseRepository.php +++ b/src/BaseRepository.php @@ -136,7 +136,7 @@ abstract class BaseRepository * * @return array The resulted fields as array */ - protected function _selectFirstRowAsArray(array $condition, array $params = []): array + final protected function _selectFirstRowAsArray(array $condition, array $params = []): array { $fields = $this->db->selectFirst(static::$table_name, [], $condition, $params); @@ -154,6 +154,8 @@ abstract class BaseRepository */ protected function _selectOne(array $condition, array $params = []): BaseEntity { + @trigger_error('`' . __METHOD__ . '()` is deprecated since 2025.05 and will be removed after 5 months, use `\Friendica\BaseRepository::_selectFirstRowAsArray()` instead.', E_USER_DEPRECATED); + $fields = $this->_selectFirstRowAsArray( $condition, $params); return $this->factory->createFromTableRow($fields);