Skip to content

Instantly share code, notes, and snippets.

@donkarlo
Created April 6, 2016 16:20
Show Gist options
  • Save donkarlo/0dd804524b0c2d380b92412a606b75b3 to your computer and use it in GitHub Desktop.
Save donkarlo/0dd804524b0c2d380b92412a606b75b3 to your computer and use it in GitHub Desktop.
public function performAnExchange() {
//1.5kg of apple with 1000 rials. Seller recieves the money via his banking account and buyer get's it from postal system
$metricedQuantityOfSellerConcept = new Sol\Measuring\MetricedQuantity(new Sol\Measuring\Metrics\Metric("KG"), 1.5);
$sellerProvidingConceptToExchange = QuantitiedConceptDecorator(new Concept("APPLE"), $metricedQuantityOfSellerConcept);
$sellerProvidingConceptToExchange->setDeliverer("IRANIAN_POSTAL_SYSTEM");
$metricedQuantityOfBuyerConcept = new Sol\Measuring\MetricedQuantity(new Sol\Measuring\Metrics\Metric("RIAL"), 1000);
$buyerProvidingConceptToExchange = QuantitiedConceptDecorator(new Concept("MONEY"), $metricedQuantityOfBuyerConcept);
$buyerProvidingConceptToExchange->setDeliverer("MELLAT_BANK");
$exchanger = new \Md\Abg\Exchanges\Exchange($sellerProvidingConceptToExchange, $buyerProvidingConceptToExchange);
$exchanger->exchnge();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment