mirror of
				https://github.com/kevinveenbirkenbach/infinito.git
				synced 2025-10-31 01:09:41 +00:00 
			
		
		
		
	Optimized findOneByIdOrSlug function
This commit is contained in:
		| @@ -29,10 +29,10 @@ final class SourceRepository extends EntityRepository | ||||
|      */ | ||||
|     public function findOneByIdOrSlug(RequestedSourceInterface $requestedSource): ?SourceInterface | ||||
|     { | ||||
|         try { | ||||
|         if ($requestedSource->hasId()) { | ||||
|             return $this->find($requestedSource->getId()); | ||||
|         } catch (\Error $error) { | ||||
|             return $this->findOneBySlug($requestedSource->getSlug()); | ||||
|         } | ||||
|  | ||||
|         return $this->findOneBySlug($requestedSource->getSlug()); | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user