Created
April 6, 2016 16:20
-
-
Save donkarlo/0dd804524b0c2d380b92412a606b75b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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