Created
March 18, 2015 05:52
-
-
Save trq/775e80969ec40be7e7da 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 getRelationById($relation, $id) | |
{ | |
return array_filter($this->{$relation}, function($entity) use ($id) { | |
return $entity->getId() === $id; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment