Last active
October 17, 2017 08:52
-
-
Save mass6/9c0b48d0c5c422927873c1c92a5c788e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getModelRepresentation() | |
{ | |
switch ($this) { | |
case instance of Mention: | |
if ($this->mentionable instanceof Comment) { | |
return $this->mentionable->commentable; | |
} | |
return $this->mentionable; | |
break; | |
case instance of Comment: | |
return $this->commentable; | |
break; | |
case instance of Like: | |
return $this->likeable; | |
break; | |
default: | |
return $this; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment