Skip to content

Instantly share code, notes, and snippets.

View donkarlo's full-sized avatar

Mohammad Rahmani donkarlo

View GitHub Profile
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");
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");
class Test {
public function __construct() {
}
public function addAnExchangeable() {
$sellerProvidedConcept = new Concept();
$buyerProvidedConcept = new Concept();
class EnitityModifyFormView extends \Sol\Mvc\View {
protected function doBeforeRender() {
?>
<form>
<legend>Test</legend>
<label>Concept</label><input name = "concept" />
</form>
<?php
$this->addStrHtml();
<?php
abstract class Tile {
abstract function getWealthFactor();
}
//////////////////////////////////////////////////////////
class Plains extends Tile {
require("util");
function Parent() {}
function Child() {}
util.inspect(Child);
var util = require('util');
function Parent() {}
function Child() {}
util.inspect(Child);
function Parent() {
}
function Child() {
}
console.dir(Child);// Child.protype: Parent
Child.prototype=Parent.prototype;
console.dir(Child);// Child.protype: Parent
function createObject(object) {
console.log(object);
var createdObject = clone(object);
/*
* removes the first element from an array and returns that element.
*/
arguments.shift();
if (createdObject.construct != undefined)
createdObject.construct.apply(createdObject, arguments);
return createdObject;
function createObject(object) {
var createdObject = clone(object);
/*
* removes the first element from an array and returns that element.
*/
arguments.shift();
if (createdObject.construct != undefined)
createdObject.construct.apply(createdObject, arguments);
return createdObject;
}