Odyssey
2018090600_LoanAppTrustedMaster.php
1 <?php
2 /**
3  * Notes:
4  * 1. Anything complicated needs to be done with SQL.
5  * 2. Always have a check to know if the migration needs to occur (up or down).
6  * 3. Use up() and down(), not change(), because of the SQL
7  */
8 use Phinx\Migration\AbstractMigration;
9 
10 class LoanAppTrustedMaster extends AbstractMigration {
11  public function up() {
12  // get the list of credit unions
13  $tableName = "cutrustedmaster";
14 
15  if ($this->hasTable($tableName)) {
16  // check for specific docsid 1: Start Disclosure
17  $findRec = $this->fetchRow("SELECT * FROM cutrustedmaster WHERE trustedid = 'hcuLoanApp'");
18  // ONLY trying to insert
19  if (!$findRec) {
20 
21  // IF the record is NOT found then insert into the table.
22  $this->query('INSERT INTO "cutrustedmaster" ("trustedid", "trustedvendor", "trustedtype", "hcuinterface", "trustedfields") VALUES (\'hcuLoanApp\', \'HomeCU\', \'O\', NULL, \'{"lnAppId":{"Type":"string","Default":"4mH4VNSnVEHa72q4WhU8G6z%2F2z8tGLNJhA2tfIOTuwg%3D"},"URL":{"Type":"string","Default":"https:\/\/www6.homecu.net\/hculive7\/lnapp\/AppMain?appinit=1&f=hbssouser"},"hcuLogging":{"Type":"string","Default":"","Message":""}}\');');
23 
24  }
25 
26  }
27  }
28 
29  public function down() {
30 
31  }
32 }