for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Dynamic\Foxy\Orders\Page;
use SilverStripe\Security\Security;
class OrderHistory extends \Page
{
/**
* @var string
*/
private static $singular_name = 'Order History';
$singular_name
private static $plural_name = 'Order Histories';
$plural_name
private static $description = 'Show a customers past orders. Requires authentication';
$description
* @var array
private static $db = [
$db
'PerPage' => 'Int',
];
private static $defaults = [
$defaults
'PerPage' => 10,
private static $table_name = 'FoxyOrderHistory';
$table_name
* return all current Member's Orders.
*
* @return bool
public function getOrderList()
if ($Member = Security::getCurrentUser()) {
$list = $Member->Orders()->sort('TransactionDate', 'DESC');
return $list;
}
return false;