From 2836478c728e2c4b08b1c5faad4b101db53f3114 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Mon, 2 May 2022 18:23:36 +1200 Subject: [PATCH] API Add method to get foreign class key on polymorphic has_many --- src/ORM/PolymorphicHasManyList.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ORM/PolymorphicHasManyList.php b/src/ORM/PolymorphicHasManyList.php index 49a51cf97..20f9907c1 100644 --- a/src/ORM/PolymorphicHasManyList.php +++ b/src/ORM/PolymorphicHasManyList.php @@ -29,6 +29,14 @@ class PolymorphicHasManyList extends HasManyList return $this->dataQuery->getQueryParam('Foreign.Class'); } + /** + * Gets the field name which holds the related object class. + */ + public function getForeignClassKey(): string + { + return $this->classForeignKey; + } + /** * Create a new PolymorphicHasManyList relation list. *