Ejemplo n.º 1
0
/**
 * Created by PhpStorm.
 * User: pliski
 * Date: 25/11/2015
 * Time: 17:42
 */
namespace Lendinvest\Model;

require_once 'app/Config/start.php';
//Instancing Loan and tranches
$dateStart = new \DateTime("2015-10-01");
$dateEnd = new \DateTime("2015-11-15");
$loan = new Loan($dateStart, $dateEnd);
$aParams = array('interest' => 3, 'maxAmount' => 1000);
$loan->addTranche("TrancheA", $aParams);
$aParams = array('interest' => 6, 'maxAmount' => 1000);
$loan->addTranche("TrancheB", $aParams);
//Investors
$aInvestors = array();
for ($i = 1; $i <= 4; $i++) {
    $aInvestors[$i] = new Investor(1000, $i);
}
//Stream option
$aInvestors[1]->addStream('Sms');
$aInvestors[2]->addStream('Sms');
$aInvestors[3]->addStream('eMail');
$aInvestors[4]->addStream('eMail');
//Investment
$loan->invest($aInvestors[1], new \DateTime("2015-10-03"), "TrancheA", 1000);
$loan->invest($aInvestors[2], new \DateTime("2015-10-04"), "TrancheA", 1);