function index() { $customer_id = \Yoda\Request::getInt('customer_id'); $b = new Didww\API2\Balance(); $b->setCustomerId($customer_id); $dids = $b->getBilledServices(); $this->getView()->setProperties(['dids' => $dids, 'customer_id' => $customer_id])->display(); }
/** * @param $customer_id * @return array */ static function getPBXwwDIDsByCustomerID($customer_id) { $balance = new Didww\API2\Balance(); $balance->setCustomerId($customer_id); $orders = $balance->getBilledServices(); $did_numbers = []; /** @var $order Didww\API2\Order */ foreach ($orders as $order) { if ($order->hasPBXwwMapping() && $order->getNumber()->isActive()) { $did_numbers[] = $order->getNumber()->getDidNumber(); } } return $did_numbers; }