for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Moip\Resource;
use Moip\Helper\Filters;
use Moip\Helper\Pagination;
use stdClass;
class OrdersList extends MoipResource
{
/**
* @const string
*/
const PATH = 'orders';
const CREATED_AT = 'createdAt';
const PAYMENT_METHOD = 'paymentMethod';
const VALUE = 'value';
const STATUS = 'status';
public function initialize()
$this->data = new stdClass();
$this->data->orders = [];
}
* Get orders.
*
* @return array
public function getOrders()
return $this->getIfSet('orders');
* Get an order list in MoIP.
* @param Pagination $pagination
* @param Filters $filters
* @param string $qParam Query a specific value.
* @return stdClass
public function get(Pagination $pagination = null, Filters $filters = null, $qParam = '')
return $this->getByPath($this->generateListPath($pagination, $filters, $qParam));
protected function populate(stdClass $response)
$ordersList = clone $this;
$ordersList->data = new stdClass();
$ordersList->data->orders = $response->orders;
$ordersList->data->summary = $response->summary;
$ordersList->_links = $response->_links;
_links
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
return $ordersList;
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: