Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
InvoiceObjectCollection
// from lib/model/collection/InvoiceObjectCollection.php
class InvoiceObjectCollection extends PropelObjectCollection
{
/**
* Get the date range of invoices generated
*
* @param string $format
* @return type
*/
public function getDateRange($format = 'Y-m-d H:i:s')
{
return [
$this->getFirst()->getCreatedAt($format),
$this->getLast()->getCreatedAt($format)
];
}
/**
* Returns commission on ad spent in pennies
*
* @return int
*/
public function getCommissionOnSpend()
{
$amt = 0;
foreach($this as $invoice)
{
$amt += $invoice->getCommissionOnSpend();
}
return $amt;
}
}%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.