public function isWinner(User $user)
    {
        if (!$this->auction || !$this->isEnded()) {
            return false;
        }

        return (bool) ($this->winningBid && $this->winningBid->bidder == $user);
    }
public function isWinner(User $user)
    {
        if (!$this->auction || !$this->isEnded()) {
            return false;
        }

        return (bool) ($this->winningBid && $this->winningBid->bidder == $user);
    }
public function isWinner ( User $ user ) { if ( ! $ this -> auction || ! $ this -> isEnded ( ) ) { return false ; } return ( bool ) ( $ this -> winningBid && $ this -> winningBid -> bidder == $ user ) ; }
Return true if user has won the item.

@param \Hamjoint\Mustard\User $user

@return bool
Return true if user has won the item .