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"); |
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
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"); |
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
class Test { | |
public function __construct() { | |
} | |
public function addAnExchangeable() { | |
$sellerProvidedConcept = new Concept(); | |
$buyerProvidedConcept = new Concept(); |
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
class EnitityModifyFormView extends \Sol\Mvc\View { | |
protected function doBeforeRender() { | |
?> | |
<form> | |
<legend>Test</legend> | |
<label>Concept</label><input name = "concept" /> | |
</form> | |
<?php | |
$this->addStrHtml(); |
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
<?php | |
abstract class Tile { | |
abstract function getWealthFactor(); | |
} | |
////////////////////////////////////////////////////////// | |
class Plains extends Tile { |
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
require("util"); | |
function Parent() {} | |
function Child() {} | |
util.inspect(Child); |
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
var util = require('util'); | |
function Parent() {} | |
function Child() {} | |
util.inspect(Child); |
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
function Parent() { | |
} | |
function Child() { | |
} | |
console.dir(Child);// Child.protype: Parent | |
Child.prototype=Parent.prototype; | |
console.dir(Child);// Child.protype: Parent |
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
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; |
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
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; | |
} |
OlderNewer