public static function alreadyConnected(Users $userData, $socialNetwork)
    {
        $source = Sources::findFirst(['title = :title:', 'bind' => ['title' => $socialNetwork]]);

        $bind = [
            'source_id' => $source->source_id,
            'users_id' => $userData->users_id,
        ];

        if ($userSocialLinked = self::findFirst(['source_id = :source_id: and users_id = :users_id:', 'bind' => $bind])) {
            return true;
        }

        return false;
    }
public static function alreadyConnected(Users $userData, $socialNetwork)
    {
        $source = Sources::findFirst(['title = :title:', 'bind' => ['title' => $socialNetwork]]);

        $bind = [
            'source_id' => $source->source_id,
            'users_id' => $userData->users_id,
        ];

        if ($userSocialLinked = self::findFirst(['source_id = :source_id: and users_id = :users_id:', 'bind' => $bind])) {
            return true;
        }

        return false;
    }
public static function alreadyConnected ( Users $ userData , $ socialNetwork ) { $ source = Sources :: findFirst ( [ 'title = :title:' , 'bind' => [ 'title' => $ socialNetwork ] ] ) ; $ bind = [ 'source_id' => $ source -> source_id , 'users_id' => $ userData -> users_id , ] ; if ( $ userSocialLinked = self :: findFirst ( [ 'source_id = :source_id: and users_id = :users_id:' , 'bind' => $ bind ] ) ) { return true ; } return false ; }
is the user already connecte to the social media site?

@param  $userData Users
@param  $socialNetwork string
is the user already connecte to the social media site?