PHP code example of germania-kg / orders

1. Go to this page and download the library: Download germania-kg/orders library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

germania-kg / orders example snippets


public function getOrderNumber()

extends OrderNumberProviderInterface
public function setOrderNumber( $order_number )

public $order_number;
public function getOrderNumber()

use OrderNumberProviderTrait;
public function setOrderNumber( $order_number )


use Germania\Orders\OrderNumberProviderInterface;
use Germania\Orders\OrderNumberProviderTrait;

class MyOrder implements OrderNumberProviderInterface
{
	use OrderNumberProviderTrait;
	
	public function __construct( order_number )
	{
		$this->order_number = order_number;
	}
}

$order = new MyOrder( 99 );
echo $order->getOrderNumber(); // 99


use Germania\Orders\OrderNumberAwareInterface;
use Germania\Orders\OrderNumberAwareTrait;

class MyOrder implements OrderNumberAwareInterface
{
	use OrderNumberAwareTrait;
}

$order  = new MyOrder;
$order->setOrderNumber( 34 );
echo $order->getOrderNumber(); // 34