src/Controller/UserController.php
/**
     * Determines if a value exists for an attribute
     *
     * @param string $attr attribute
     * @param string $value value
     * @return int
     */
Determines if a value exists for an attribute
@param string $attr attribute
@param string $value value
@return int
Determines if a value exists for an attribute @param string $attr attribute @param string $value value @return int
private function findIdBy(string $attr, string $value): int
    {
        $user = $this->entityManager->getRepository(User::class)->findOneBy([ $attr => $value ]);
        return $user ? $user->getId() : 0;
    }
private function findIdBy ( string $ attr , string $ value ) : int { $ user = $ this -> entityManager -> getRepository ( User :: class ) -> findOneBy ( [ $ attr => $ value ] ) ; return $ user ? $ user -> getId ( ) : 0 ; }
Determines if a value exists for an attribute
 @param string $attr attribute
 @param string $value value
 @return int
Determines if a value exists for an attribute @param string $attr attribute @param string $value value @return int