Esempio n. 1
0
 /**
  * Construct adds New Transaction to memory
  *
  * @param string $id is a long specifying a new transaction
  * @param string $amount is a double specifying the amount{@from body}
  * @param string $type is a string specifying a type of the transaction.{@from body}
  * @param string $parent_id is an optional long that may specify the parent transaction of this transaction.{@from body}
  *
  */
 function __construct($id = null, $amount = null, $type = null, $parent_id = null)
 {
     $this->id = $id;
     $this->amount = $amount;
     $this->type = $type;
     $this->parent_id = $parent_id;
     $this->memory = new Memory('Transactions');
     if ($this->id != null) {
         $this->memory->save($id, $this);
     }
 }