|
14 | 14 | * @author Rotimi Adegbamigbe
|
15 | 15 | * @copyright (c) 2023, Rotexsoft
|
16 | 16 | */
|
17 |
| -abstract class Model { |
| 17 | +abstract class Model implements \Stringable { |
18 | 18 |
|
19 | 19 | /**
|
20 | 20 | * Name of the primary key column in the db table associated with this model
|
@@ -687,13 +687,13 @@ public function __construct(
|
687 | 687 |
|
688 | 688 | if (strlen($this->primary_col) <= 0) {
|
689 | 689 |
|
690 |
| - $msg = 'Primary Key Column name not set for ' . get_class($this); |
| 690 | + $msg = 'Primary Key Column name not set for ' . static::class; |
691 | 691 | throw new ModelPrimaryColNameNotSetDuringConstructionException($msg);
|
692 | 692 | }
|
693 | 693 |
|
694 | 694 | if (strlen($this->table_name) <= 0) {
|
695 | 695 |
|
696 |
| - $msg = 'Table name not set for ' . get_class($this); |
| 696 | + $msg = 'Table name not set for ' . static::class; |
697 | 697 | throw new ModelTableNameNotSetDuringConstructionException($msg);
|
698 | 698 | }
|
699 | 699 | }
|
@@ -730,7 +730,7 @@ public function toArray(): array {
|
730 | 730 | */
|
731 | 731 | public function createNewCollection(\GDAO\Model\RecordInterface ...$list_of_records): \GDAO\Model\CollectionInterface {
|
732 | 732 |
|
733 |
| - $msg = 'Must Implement ' . get_class($this) . '::' . __FUNCTION__ . '(...)'; |
| 733 | + $msg = 'Must Implement ' . static::class . '::' . __FUNCTION__ . '(...)'; |
734 | 734 | throw new ModelMustImplementMethodException($msg);
|
735 | 735 | }
|
736 | 736 |
|
@@ -883,7 +883,7 @@ public abstract function deleteSpecifiedRecord(\GDAO\Model\RecordInterface $reco
|
883 | 883 | */
|
884 | 884 | public function fetchRecordsIntoCollection(?object $query = null, array $relations_to_include = []): \GDAO\Model\CollectionInterface {
|
885 | 885 |
|
886 |
| - $msg = 'Must Implement ' . get_class($this) . '::' . __FUNCTION__ . '(...)'; |
| 886 | + $msg = 'Must Implement ' . static::class . '::' . __FUNCTION__ . '(...)'; |
887 | 887 | throw new ModelMustImplementMethodException($msg);
|
888 | 888 | }
|
889 | 889 |
|
|
0 commit comments