@@ -30,11 +30,6 @@ class Sql extends Persistence
30
30
/** @const string */
31
31
public const HOOK_BEFORE_DELETE_QUERY = self ::class . '@beforeDeleteQuery ' ;
32
32
33
- /** @const string */
34
- protected const ID_LOAD_ONE = self ::class . '@idLoadOne ' ;
35
- /** @const string */
36
- protected const ID_LOAD_ANY = self ::class . '@idLoadAny ' ;
37
-
38
33
/**
39
34
* Connection object.
40
35
*
@@ -667,11 +662,6 @@ public function action(Model $model, string $type, array $args = [])
667
662
return $ query ;
668
663
}
669
664
670
- /**
671
- * Tries to load data record, but will not fail if record can't be loaded.
672
- *
673
- * @param mixed $id
674
- */
675
665
public function tryLoad (Model $ model , $ id ): ?array
676
666
{
677
667
$ noId = $ id === self ::ID_LOAD_ONE || $ id === self ::ID_LOAD_ANY ;
@@ -718,43 +708,6 @@ public function tryLoad(Model $model, $id): ?array
718
708
return $ data ;
719
709
}
720
710
721
- /**
722
- * Loads a record from model and returns a associative array.
723
- *
724
- * @param mixed $id
725
- */
726
- public function load (Model $ model , $ id ): array
727
- {
728
- $ data = $ this ->tryLoad ($ model , $ id );
729
-
730
- if (!$ data ) {
731
- $ noId = $ id === self ::ID_LOAD_ONE || $ id === self ::ID_LOAD_ANY ;
732
-
733
- throw (new Exception ('No record was found ' , 404 ))
734
- ->addMoreInfo ('model ' , $ model )
735
- ->addMoreInfo ('id ' , $ noId ? null : $ id )
736
- ->addMoreInfo ('scope ' , $ model ->scope ()->toWords ());
737
- }
738
-
739
- return $ data ;
740
- }
741
-
742
- /**
743
- * Tries to load any one record.
744
- */
745
- public function tryLoadAny (Model $ model ): ?array
746
- {
747
- return $ this ->tryLoad ($ model , self ::ID_LOAD_ANY );
748
- }
749
-
750
- /**
751
- * Loads any one record.
752
- */
753
- public function loadAny (Model $ model ): array
754
- {
755
- return $ this ->load ($ model , self ::ID_LOAD_ANY );
756
- }
757
-
758
711
/**
759
712
* Inserts record in database and returns new record ID.
760
713
*/
0 commit comments