Tribe__Tickets__Ticket_Object::qty_cancelled( int|null $value = null )

Method to manage the protected qty_cancelled property of the Object Prevents setting qty_cancelled lower then zero


Parameters

$value

(int|null) (Optional) This will overwrite the old value

Default value: null


Top ↑

Return

(int)


Top ↑

Source

File: src/Tribe/Ticket_Object.php

		public function qty_cancelled(  $value = null ) {
			// If the Value was passed as numeric value overwrite
			if ( is_numeric( $value ) ) {
				$this->qty_cancelled = $value;
			}

			// Prevents qty_cancelled from going negative
			$this->qty_cancelled = max( (int) $this->qty_cancelled, 0 );

			// return the new Qty Cancelled
			return $this->qty_cancelled;
		}