Skip to content

Instantly share code, notes, and snippets.

@yogasukma
Last active October 6, 2016 16:21
Show Gist options
  • Save yogasukma/889988d58b62204f10a36649f506dfe1 to your computer and use it in GitHub Desktop.
Save yogasukma/889988d58b62204f10a36649f506dfe1 to your computer and use it in GitHub Desktop.
Sample Core.php
<?php
/**
* Core class.
* It loads several other class that necessary
* and provide some basic data from wordpress
*/
namespace Afrashop\Core;
use Afrashop\Dashboard\Dashboard;
use Afrashop\Helpers\UiCustomize;
use Afrashop\Konfirmasi\Konfirmasi;
use Afrashop\Order\Order;
use Afrashop\Order\Items;
use Afrashop\Product\Product;
use Afrashop\Shipment\Shipment;
use Afrashop\Barcode\Barcode;
use Afrashop\Offers\Offers;
use Afrashop\SearchTerms\SearchTerms;
use Afrashop\Customer\Customer;
class Core {
use UiCustomize;
protected $dashboard;
protected $navigation;
protected $konfirmasi;
protected $order;
protected $product;
protected $shipment;
protected $barcode;
protected $offers;
protected $searchTerms;
public function __construct() {
// load another class
$this->dashboard = new Dashboard();
$this->navigation = new Navigation();
$this->konfirmasi = new Konfirmasi();
$this->order = new Order();
$this->orderItems = new Items();
$this->product = new Product();
$this->shipment = new Shipment();
$this->barcode = new Barcode();
$this->offers = new Offers();
$this->searchTerms = new SearchTerms();
$this->customer = new Customer();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment