]> git.mxchange.org Git - friendica.git/commitdiff
Deprecate BaseRepository::_selectOne()
authorArt4 <art4@wlabs.de>
Tue, 25 Feb 2025 08:39:31 +0000 (08:39 +0000)
committerArt4 <art4@wlabs.de>
Tue, 25 Feb 2025 08:39:31 +0000 (08:39 +0000)
src/BaseRepository.php

index afbb688bd90ab73c1a4148c05ea6dc4624259dc8..ead4bf73bfdcf7cb7ae9aa1a7db05cf80e990432 100644 (file)
@@ -148,18 +148,13 @@ abstract class BaseRepository
        }
 
        /**
-        * @param array $condition
-        * @param array $params
-        * @return BaseEntity
+        * @deprecated 2025.05 Use `\Friendica\BaseRepository::_selectFirstRowAsArray()` instead
+        *
         * @throws NotFoundException
         */
        protected function _selectOne(array $condition, array $params = []): BaseEntity
        {
-               $fields = $this->db->selectFirst(static::$table_name, [], $condition, $params);
-
-               if (!$this->db->isResult($fields)) {
-                       throw new NotFoundException();
-               }
+               $fields = $this->_selectFirstRowAsArray( $condition, $params);
 
                return $this->factory->createFromTableRow($fields);
        }