Flarum\Core\Discussion::state PHP Method

state() public method

If no user is passed (i.e. in the case of eager loading the 'state' relation), then the static $stateUser property is used.
See also: Discussion::setStateUser()
public state ( User $user = null ) : Illuminate\Database\Eloquent\Relations\HasOne
$user User
return Illuminate\Database\Eloquent\Relations\HasOne
    public function state(User $user = null)
    {
        $user = $user ?: static::$stateUser;
        return $this->hasOne('Flarum\\Core\\DiscussionState')->where('user_id', $user ? $user->id : null);
    }