public function end()
    {
        if (mustard_loaded('auctions') && $this->auction) {
            $bid = $this->getBidHistory()->first();

            if ($bid) {
                $this->winningBid()->associate($bid);
            }
        }

        $now = time();

        if ($this->endDate > $now) {
            $this->endedEarly = true;

            $this->endDate = $now;
        }

        $this->save();
    }
public function end()
    {
        if (mustard_loaded('auctions') && $this->auction) {
            $bid = $this->getBidHistory()->first();

            if ($bid) {
                $this->winningBid()->associate($bid);
            }
        }

        $now = time();

        if ($this->endDate > $now) {
            $this->endedEarly = true;

            $this->endDate = $now;
        }

        $this->save();
    }
public function end ( ) { if ( mustard_loaded ( 'auctions' ) && $ this -> auction ) { $ bid = $ this -> getBidHistory ( ) -> first ( ) ; if ( $ bid ) { $ this -> winningBid ( ) -> associate ( $ bid ) ; } } $ now = time ( ) ; if ( $ this -> endDate > $ now ) { $ this -> endedEarly = true ; $ this -> endDate = $ now ; } $ this -> save ( ) ; }
End an item, marking a winning bid.

@return void
End an item marking a winning bid .