code/pages/RegistrableEvent.php
public function getRemainingCapacity($excludeId = null) {
		if (!$this->Capacity){
			return true;
		}
		$bookings = $this->Registrations()->filter("Status:not", "Canceled");
		if ($excludeId) {
			$bookings = $bookings->filter("ID:not", $excludeId);
		}
		$taken = $bookings->sum("Quantity");
		if($this->Capacity >= $taken){
			return $this->Capacity - $taken;
		}

		return false;
	}
public function getRemainingCapacity($excludeId = null) {
		if (!$this->Capacity){
			return true;
		}
		$bookings = $this->Registrations()->filter("Status:not", "Canceled");
		if ($excludeId) {
			$bookings = $bookings->filter("ID:not", $excludeId);
		}
		$taken = $bookings->sum("Quantity");
		if($this->Capacity >= $taken){
			return $this->Capacity - $taken;
		}

		return false;
	}
public function getRemainingCapacity ( $ excludeId = null ) { if ( ! $ this -> Capacity ) { return true ; } $ bookings = $ this -> Registrations ( ) -> filter ( "Status:not" , "Canceled" ) ; if ( $ excludeId ) { $ bookings = $ bookings -> filter ( "ID:not" , $ excludeId ) ; } $ taken = $ bookings -> sum ( "Quantity" ) ; if ( $ this -> Capacity >= $ taken ) { return $ this -> Capacity - $ taken ; } return false ; }
Returns the overall number of places remaining at this event, TRUE if
there are unlimited places or FALSE if they are all taken.

@param  int $excludeId A registration ID to exclude from calculations.
@return int|bool
Returns the overall number of places remaining at this event TRUE if there are unlimited places or FALSE if they are all taken .