function resolve($presence) {
        if($presence instanceof \CharlotteDunois\Yasmin\Models\Presence) {
            return $presence;
        }
        
        if($presence instanceof \CharlotteDunois\Yasmin\Models\User) {
            $presence = $presence->id;
        }
        
        if(\is_int($presence)) {
            $presence = (string) $presence;
        }
        
        if(\is_string($presence) && parent::has($presence)) {
            return parent::get($presence);
        }
        
        throw new \InvalidArgumentException('Unable to resolve unknown presence');
    }
function resolve($presence) {
        if($presence instanceof \CharlotteDunois\Yasmin\Models\Presence) {
            return $presence;
        }
        
        if($presence instanceof \CharlotteDunois\Yasmin\Models\User) {
            $presence = $presence->id;
        }
        
        if(\is_int($presence)) {
            $presence = (string) $presence;
        }
        
        if(\is_string($presence) && parent::has($presence)) {
            return parent::get($presence);
        }
        
        throw new \InvalidArgumentException('Unable to resolve unknown presence');
    }
function resolve ( $ presence ) { if ( $ presence instanceof \ CharlotteDunois \ Yasmin \ Models \ Presence ) { return $ presence ; } if ( $ presence instanceof \ CharlotteDunois \ Yasmin \ Models \ User ) { $ presence = $ presence -> id ; } if ( \ is_int ( $ presence ) ) { $ presence = ( string ) $ presence ; } if ( \ is_string ( $ presence ) && parent :: has ( $ presence ) ) { return parent :: get ( $ presence ) ; } throw new \ InvalidArgumentException ( 'Unable to resolve unknown presence' ) ; }
Resolves given data to a presence.
@param \CharlotteDunois\Yasmin\Models\Presence|\CharlotteDunois\Yasmin\Models\User|string|int  $presence  string/int = user ID
@return \CharlotteDunois\Yasmin\Models\Presence
@throws \InvalidArgumentException
Resolves given data to a presence .