Example #1
0
 /**
  * Set the migration files.
  *
  * Also creates an input file objects.
  *
  * @see \Bolt\Database\Migration\AbstractMigration::setMigrationFiles()
  */
 public function setMigrationFiles($files)
 {
     parent::setMigrationFiles($files);
     if ($this->getError()) {
         return $this;
     }
     foreach ($this->files as &$file) {
         if ($file['type'] === 'yaml') {
             $file['handler'] = new Input\YamlFile($this, $file['file']);
         } elseif ($file['type'] === 'json') {
             $file['handler'] = new Input\JsonFile($this, $file['file']);
         }
     }
     return $this;
 }
Example #2
0
 /**
  * Set the migration files.
  *
  * Also creates an output file object.
  *
  * @see \Bolt\Database\Migration\AbstractMigration::setMigrationFiles()
  *
  * @return \Bolt\Database\Migration\Export
  */
 public function setMigrationFiles($files)
 {
     parent::setMigrationFiles($files);
     if ($this->getError()) {
         return $this;
     }
     $this->hash = md5($files);
     $file =& $this->files[$this->hash];
     if ($file['type'] === 'yaml') {
         $file['handler'] = new Output\YamlFile($this, $file['file']);
     } elseif ($file['type'] === 'json') {
         $file['handler'] = new Output\JsonFile($this, $file['file']);
     }
     return $this;
 }