3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
10 namespace Zend\Db\Sql\Ddl
;
12 use Zend\Db\Adapter\Platform\PlatformInterface
;
13 use Zend\Db\Adapter\Platform\Sql92
as AdapterSql92Platform
;
14 use Zend\Db\Sql\AbstractSql
;
16 class DropTable
extends AbstractSql
implements SqlInterface
18 const TABLE
= 'table';
23 protected $specifications = array(
24 self
::TABLE
=> 'DROP TABLE %1$s'
30 protected $table = '';
33 * @param string $table
35 public function __construct($table = '')
37 $this->table
= $table;
41 * @param null|PlatformInterface $adapterPlatform
44 public function getSqlString(PlatformInterface
$adapterPlatform = null)
46 // get platform, or create default
47 $adapterPlatform = ($adapterPlatform) ?
: new AdapterSql92Platform
;
50 $parameters = array();
52 foreach ($this->specifications
as $name => $specification) {
53 $parameters[$name] = $this->{'process' . $name}(
61 if ($specification && is_array($parameters[$name])) {
62 $sqls[$name] = $this->createSqlFromSpecificationAndParameters(
69 $sql = implode(' ', $sqls);
73 protected function processTable(PlatformInterface
$adapterPlatform = null)
75 return array($adapterPlatform->quoteIdentifier($this->table
));