public function getAtom(User $user, $key, bool $detachFromEntityManager = true)
    {
        if ($atom = $this->getRepository()->findOneBy(['user_id' => $user->getId(), 'key' => $key])) {
            if ($detachFromEntityManager) {
                $this->getEntityManager()->detach($atom);
            }

            return $atom;
        }

        return null;
    }
public function getAtom(User $user, $key, bool $detachFromEntityManager = true)
    {
        if ($atom = $this->getRepository()->findOneBy(['user_id' => $user->getId(), 'key' => $key])) {
            if ($detachFromEntityManager) {
                $this->getEntityManager()->detach($atom);
            }

            return $atom;
        }

        return null;
    }
public function getAtom ( User $ user , $ key , bool $ detachFromEntityManager = true ) { if ( $ atom = $ this -> getRepository ( ) -> findOneBy ( [ 'user_id' => $ user -> getId ( ) , 'key' => $ key ] ) ) { if ( $ detachFromEntityManager ) { $ this -> getEntityManager ( ) -> detach ( $ atom ) ; } return $ atom ; } return null ; }
Get an atomic piece of user data

@param User $user
@param      $key
@param bool $detachFromEntityManager

@return UserAtom|null
Get an atomic piece of user data