Tribe__Tickets__Ticket_Object::qty_completed( int|null $value = null )
Method to manage the protected qty_completed property of the Object Prevents setting qty_completed lower then zero
Contents
Parameters
- $value
-
(int|null) (Optional) This will overwrite the old value
Default value: null
Return
(int)
Source
File: src/Tribe/Ticket_Object.php
public function qty_completed( $value = null ) {
// If the Value was passed as numeric value, overwrite.
if ( is_numeric( $value ) ) {
$this->qty_completed = $value;
}
// Prevents qty_completed from going negative.
$this->qty_completed = max( (int) $this->qty_completed, 0 );
// Return the new quantity completed.
return $this->qty_completed;
}
Changelog
| Version | Description |
|---|---|
| 4.7.3 | Introduced. |