Odyssey
2019112700_addBPCustomContent.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 addBPCustomContent extends AbstractMigration {
11  public function up() {
12 
13  $table = "cucmsdocs";
14  if ($this->hasTable($table)) {
15 
16  $name = "billpayTerms";
17  $esText = "Products";
18  $doctype = 1;
19  $link = "Y";
20  $pdfdefDesc = "CU provided terms for Bill Pay";
21  $title = "Bill Pay Terms";
22  $dispText = "Terms of Use";
23  $default = "Y";
24  $response = "T";
25 
26  $sort = 20;
27  $sql = "insert into $table (docsname, docsdesc, docstype, docsdisplaylink, docsdisplaytext, docsdefaultavail, docsresponsetype, docstitle, docsmaintsection, docsmaintsort)
28  values ('$name', '$pdfdefDesc', $doctype, '$link', '$dispText', '$default', '$response', '$title', '$esText', " . $sort . ")";
29  $this->query($sql);
30  }
31  }
32 }