Permalink
Browse files

Modyllic_View -> Modyllic_Schema_View

  • Loading branch information...
1 parent 9092f2b commit 0e54a9639afc6e6a56f4a845ee322dc8a0854041 @iarna committed Apr 24, 2012
Showing with 29 additions and 21 deletions.
  1. +3 −3 Modyllic/Diff.php
  2. +1 −1 Modyllic/Parser.php
  3. +3 −17 Modyllic/Schema.php
  4. +22 −0 Modyllic/Schema/View.php
View
6 Modyllic/Diff.php
@@ -416,21 +416,21 @@ function update_table( $table ) {
}
/**
- * @param Modyllic_View $view
+ * @param Modyllic_Schema_View $view
*/
function add_view( $view ) {
$this->add['views'][$view->name] = $view;
}
/**
- * @param Modyllic_View_Changeset $view
+ * @param Modyllic_Schema_View_Changeset $view
*/
function update_view( $view ) {
$this->update['views'][$view->name] = $view;
}
/**
- * @param Modyllic_View $view
+ * @param Modyllic_Schema_View $view
*/
function remove_view( $view ) {
$this->remove['views'][$view->name] = $view;
View
2 Modyllic/Parser.php
@@ -560,7 +560,7 @@ function cmd_CREATE_VIEW() {
if ( isset($this->schema->tables[$name]) ) {
throw $this->error("Can't create VIEW $name when a table of that name already exists");
}
- $view = $this->schema->add_view( new Modyllic_View( $name ) );
+ $view = $this->schema->add_view( new Modyllic_Schema_View( $name ) );
## Minimal support for views currently
$view->def = $this->rest();
}
View
20 Modyllic/Schema.php
@@ -10,9 +10,10 @@
require_once "Modyllic/Types.php";
// Components
+require_once "Modyllic/Schema/View.php";
+require_once "Modyllic/Schema/Column.php";
require_once "Modyllic/Schema/Index.php";
require_once "Modyllic/Schema/Index/Foreign.php";
-require_once "Modyllic/Schema/Column.php";
/**
* A base class for various schema objects. Handles generic things like
@@ -126,7 +127,7 @@ function add_trigger( $trigger ) {
}
/**
- * @param Modyllic_View $view
+ * @param Modyllic_Schema_View $view
*/
function add_view( $view ) {
$this->views[$view->name] = $view;
@@ -220,21 +221,6 @@ function equal_to( $other ) {
}
}
-class Modyllic_View extends Modyllic_Diffable {
- public $name;
- public $def;
- /**
- * @param string $name
- */
- function __construct($name) {
- $this->name = $name;
- }
- function equal_to( $other ) {
- if ( $this->def != $other->def ) { return false; }
- return true;
- }
-}
-
/**
* A collection of columns, indexes and other information comprising a table
*/
View
22 Modyllic/Schema/View.php
@@ -0,0 +1,22 @@
+<?php
+/**
+ * Copyright © 2012 Online Buddies, Inc. - All Rights Reserved
+ *
+ * @package Modyllic
+ * @author bturner@online-buddies.com
+ */
+
+class Modyllic_Schema_View extends Modyllic_Diffable {
+ public $name;
+ public $def;
+ /**
+ * @param string $name
+ */
+ function __construct($name) {
+ $this->name = $name;
+ }
+ function equal_to( $other ) {
+ if ( $this->def != $other->def ) { return false; }
+ return true;
+ }
+}

0 comments on commit 0e54a96

Please sign in to comment.