Source of file DropTable.php
Size: 2,008 Bytes - Last Modified: 2014-03-12T23:21:18+01:00
/home/theseer/Downloads/ZendFramework-2.3.0/library/Zend/Db/Sql/Ddl/DropTable.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 | <?php /** * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace Zend\Db\Sql\Ddl; use Zend\Db\Adapter\Platform\PlatformInterface; use Zend\Db\Adapter\Platform\Sql92 as AdapterSql92Platform; use Zend\Db\Sql\AbstractSql; class DropTable extends AbstractSql implements SqlInterface { const TABLE = 'table'; /** * @var array */ protected $specifications = array( self::TABLE => 'DROP TABLE %1$s' ); /** * @var string */ protected $table = ''; /** * @param string $table */ public function __construct($table = '') { $this->table = $table; } /** * @param null|PlatformInterface $adapterPlatform * @return string */ public function getSqlString(PlatformInterface $adapterPlatform = null) { // get platform, or create default $adapterPlatform = ($adapterPlatform) ?: new AdapterSql92Platform; $sqls = array(); $parameters = array(); foreach ($this->specifications as $name => $specification) { $parameters[$name] = $this->{'process' . $name}( $adapterPlatform, null, null, $sqls, $parameters ); if ($specification && is_array($parameters[$name])) { $sqls[$name] = $this->createSqlFromSpecificationAndParameters( $specification, $parameters[$name] ); } } $sql = implode(' ', $sqls); return $sql; } protected function processTable(PlatformInterface $adapterPlatform = null) { return array($adapterPlatform->quoteIdentifier($this->table)); } } |