Commit 0679d3b6 authored by jsor's avatar jsor

Move sql related methods

parent 265faf48
...@@ -46,6 +46,11 @@ class SchemaCreateTableEventArgs extends SchemaEventArgs ...@@ -46,6 +46,11 @@ class SchemaCreateTableEventArgs extends SchemaEventArgs
*/ */
private $_platform = null; private $_platform = null;
/**
* @var array
*/
private $_sql = array();
public function __construct(Table $table, AbstractPlatform $platform) public function __construct(Table $table, AbstractPlatform $platform)
{ {
$this->_table = $table; $this->_table = $table;
...@@ -67,4 +72,27 @@ class SchemaCreateTableEventArgs extends SchemaEventArgs ...@@ -67,4 +72,27 @@ class SchemaCreateTableEventArgs extends SchemaEventArgs
{ {
return $this->_platform; return $this->_platform;
} }
/**
* @param string|array $sql
* @return SchemaEventArgs
*/
public function addSql($sql)
{
if (is_array($sql)) {
$this->_sql = array_merge($this->_sql, $sql);
} else {
$this->_sql[] = $sql;
}
return $this;
}
/**
* @return array
*/
public function getSql()
{
return $this->_sql;
}
} }
...@@ -39,11 +39,6 @@ class SchemaEventArgs extends EventArgs ...@@ -39,11 +39,6 @@ class SchemaEventArgs extends EventArgs
*/ */
private $_preventDefault = false; private $_preventDefault = false;
/**
* @var array
*/
private $_sql = array();
public function __construct(Table $table) public function __construct(Table $table)
{ {
$this->_table = $table; $this->_table = $table;
...@@ -66,27 +61,4 @@ class SchemaEventArgs extends EventArgs ...@@ -66,27 +61,4 @@ class SchemaEventArgs extends EventArgs
{ {
return $this->_preventDefault; return $this->_preventDefault;
} }
/**
* @param string|array $sql
* @return SchemaEventArgs
*/
public function addSql($sql)
{
if (is_array($sql)) {
$this->_sql = array_merge($this->_sql, $sql);
} else {
$this->_sql[] = $sql;
}
return $this;
}
/**
* @return array
*/
public function getSql()
{
return $this->_sql;
}
} }
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