1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-05-07 02:44:04 +00:00

[MINOR BC BREAK] Syncing: PivotWithRelation -> PivotWithCentralResource

The old names of the class and method were misleading. We don't
actually need any relation. And we don't even need a model instance
as we were returning previously -- the only use of that method was
in TriggerSyncingEvents which would immediately use ::class on the
returned value. Therefore, all we are asking for in this interface
is just the central resource class.
This commit is contained in:
Samuel Stancl 2025-11-25 04:29:28 +01:00
parent 072fcc6326
commit 04a20ca930
No known key found for this signature in database
GPG key ID: BA146259A1E16C57
6 changed files with 23 additions and 34 deletions

View file

@ -79,9 +79,9 @@ trait TriggerSyncingEvents
*/
protected function getResourceClass(): string
{
/** @var $this&(Pivot|MorphPivot|((Pivot|MorphPivot)&PivotWithRelation)) $this */
if ($this instanceof PivotWithRelation) {
return $this->getRelatedModel()::class;
/** @var $this&(Pivot|MorphPivot|((Pivot|MorphPivot)&PivotWithCentralResource)) $this */
if ($this instanceof PivotWithCentralResource) {
return $this->getCentralResourceClass();
}
if ($this instanceof MorphPivot) {