Exemplo n.º 1
0
 /**
  * Get config filepath
  *
  * @param DbSync_Model_AbstractModel $model
  * @throws Exception
  * @return string
  */
 public function getFilePath(DbSync_Model_AbstractModel $model)
 {
     switch (true) {
         case $model instanceof DbSync_Model_Table_Schema:
             $path = 'schema/' . $model->getTableName();
             break;
         case $model instanceof DbSync_Model_Table_Data:
             $path = 'data/' . $model->getTableName();
             break;
         case $model instanceof DbSync_Model_Table_Trigger:
             $path = 'trigger/' . $model->getTriggerName();
             break;
         default:
             throw new Exception("Model '" . get_class($model) . "' is not supported");
     }
     return $this->_path . '/' . $path . '.' . self::FILE_EXTENSION;
 }