Tribe__Tickets__Ticket_Object::qty_refunded( int|null $value = null )
Method to manage the protected qty_refunded property of the Object Prevents setting qty_refunded 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_refunded( $value = null ) {
// If the Value was passed as numeric value overwrite
if ( is_numeric( $value ) ) {
$this->qty_refunded = $value;
}
// Prevents qty_refunded from going negative
$this->qty_refunded = max( (int) $this->qty_refunded, 0 );
// return the new Qty Refunded
return $this->qty_refunded;
}
Changelog
| Version | Description |
|---|---|
| 4.7.3 | Introduced. |