Commit 80201a10 authored by Benjamin Eberlei's avatar Benjamin Eberlei

Merge pull request #164 from tyler-sommer/getters

Getters for AbstractAsset$_quoted and ForeignKeyConstraint$_options
parents 11a2244d 360fbf43
......@@ -27,7 +27,7 @@ use Doctrine\DBAL\Platforms\AbstractPlatform;
* This encapsulation hack is necessary to keep a consistent state of the database schema. Say we have a list of tables
* array($tableName => Table($tableName)); if you want to rename the table, you have to make sure
*
*
*
* @link www.doctrine-project.org
* @since 2.0
* @author Benjamin Eberlei <kontakt@beberlei.de>
......@@ -58,7 +58,7 @@ abstract class AbstractAsset
*/
protected function _setName($name)
{
if ($this->isQuoted($name)) {
if ($this->isIdentifierQuoted($name)) {
$this->_quoted = true;
$name = $this->trimQuotes($name);
}
......@@ -129,13 +129,23 @@ abstract class AbstractAsset
return strtolower($name);
}
/**
* Check if this asset's name is quoted
*
* @return bool
*/
public function isQuoted()
{
return $this->_quoted;
}
/**
* Check if this identifier is quoted.
*
* @param string $identifier
* @return bool
*/
protected function isQuoted($identifier)
protected function isIdentifierQuoted($identifier)
{
return (isset($identifier[0]) && ($identifier[0] == '`' || $identifier[0] == '"'));
}
......
......@@ -127,6 +127,16 @@ class ForeignKeyConstraint extends AbstractAsset implements Constraint
return $this->_options[$name];
}
/**
* Gets the options associated with this constraint
*
* @return array
*/
public function getOptions()
{
return $this->_options;
}
/**
* Foreign Key onUpdate status
*
......
......@@ -47,7 +47,7 @@ use Doctrine\DBAL\Schema\Visitor\Visitor;
* execute them. Only the queries for the currently connected database are
* executed.
*
*
*
* @link www.doctrine-project.org
* @since 2.0
* @author Benjamin Eberlei <kontakt@beberlei.de>
......@@ -155,7 +155,7 @@ class Schema extends AbstractAsset
*/
private function getFullQualifiedAssetName($name)
{
if ($this->isQuoted($name)) {
if ($this->isIdentifierQuoted($name)) {
$name = $this->trimQuotes($name);
}
if (strpos($name, ".") === false) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment