@@ 66-80 (lines=15) @@ | ||
63 | return self::saveCache($sql, $statement->fetchAll()); |
|
64 | } |
|
65 | ||
66 | public function getForeignKey($childTable, $childColumn) |
|
67 | { |
|
68 | $sql = sprintf('SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE COLUMN_NAME = %s AND TABLE_NAME = %s AND TABLE_SCHEMA = %s', |
|
69 | $this->getConnection()->quote($childColumn), |
|
70 | $this->getConnection()->quote($childTable), |
|
71 | $this->getConnection()->quote($this->_dbname) |
|
72 | ); |
|
73 | $cache = self::getCache($sql); |
|
74 | if (isset($cache)) { |
|
75 | return $cache; |
|
76 | } |
|
77 | $statement = $this->getConnection()->query($sql); |
|
78 | ||
79 | return self::saveCache($sql, $statement->fetch()); |
|
80 | } |
|
81 | ||
82 | public function getParents($childTable) |
|
83 | { |
|
@@ 82-95 (lines=14) @@ | ||
79 | return self::saveCache($sql, $statement->fetch()); |
|
80 | } |
|
81 | ||
82 | public function getParents($childTable) |
|
83 | { |
|
84 | $sql = sprintf('SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE TABLE_NAME = %s AND TABLE_SCHEMA = %s', |
|
85 | $this->getConnection()->quote($childTable), |
|
86 | $this->getConnection()->quote($this->_dbname) |
|
87 | ); |
|
88 | $cache = self::getCache($sql); |
|
89 | if (isset($cache)) { |
|
90 | return $cache; |
|
91 | } |
|
92 | $statement = $this->getConnection()->query($sql); |
|
93 | ||
94 | return self::saveCache($sql, $statement->fetchAll()); |
|
95 | } |
|
96 | ||
97 | public static function getFieldType($type) |
|
98 | { |