Changeset View
Changeset View
Standalone View
Standalone View
src/app/Entitlement.php
Show First 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | class Entitlement extends Model | ||||
} | } | ||||
/** | /** | ||||
* Create a transaction record for this entitlement. | * Create a transaction record for this entitlement. | ||||
* | * | ||||
* @param string $type The type of transaction ('created', 'billed', 'deleted'), but use the | * @param string $type The type of transaction ('created', 'billed', 'deleted'), but use the | ||||
* \App\Transaction constants. | * \App\Transaction constants. | ||||
* @param int $amount The amount involved in cents | * @param int $amount The amount involved in cents | ||||
* | * | ||||
machniak: Missing documentation for the added arguments. | |||||
* @return string The transaction ID | * @return string The transaction ID | ||||
*/ | */ | ||||
public function createTransaction($type, $amount = null) | public function createTransaction($type, $amount = null, $period_start = null, $period_end = null) | ||||
Done Inline ActionsMissing space. machniak: Missing space. | |||||
{ | { | ||||
$transaction = \App\Transaction::create( | $transaction = \App\Transaction::create( | ||||
[ | [ | ||||
'object_id' => $this->id, | 'object_id' => $this->id, | ||||
'object_type' => \App\Entitlement::class, | 'object_type' => \App\Entitlement::class, | ||||
'type' => $type, | 'type' => $type, | ||||
'amount' => $amount | 'amount' => $amount, | ||||
'period_start' => $period_start, | |||||
'period_end' => $period_end | |||||
] | ] | ||||
); | ); | ||||
return $transaction->id; | return $transaction->id; | ||||
} | } | ||||
/** | /** | ||||
* Principally entitleable objects such as 'Domain' or 'User'. | * Principally entitleable objects such as 'Domain' or 'User'. | ||||
▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines |
Missing documentation for the added arguments.