forked from OnlineBuddies/Modyllic
/
Foreign.php
35 lines (32 loc) · 991 Bytes
/
Foreign.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
/**
* Copyright © 2012 Online Buddies, Inc. - All Rights Reserved
*
* @package Modyllic
* @author bturner@online-buddies.com
*/
class Modyllic_Schema_Index_Foreign extends Modyllic_Schema_Index {
public $cname = "";
const WEAK_DEFAULT = false;
public $weak = self::WEAK_DEFAULT;
public $references = array();
/**
* @param string $name
*/
function __construct($name="") {
parent::__construct($name);
$this->references['table'] = "";
$this->references['columns'] = array();
$this->references['on_delete'] = "";
$this->references['on_update'] = "";
}
function get_name() {
return "~".$this->cname;
}
function equal_to($other) {
if ( ! parent::equal_to($other) ) { return false; }
if ( $this->references != $other->references ) { return false; }
if ( $this->weak != $other->weak ) { return false; }
return true;
}
}