Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Db / Sql / Ddl / DropTable.php
blobff7eea34603853db46b1e16af003c659861c1724
1 <?php
2 /**
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
8 */
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';
20 /**
21 * @var array
23 protected $specifications = array(
24 self::TABLE => 'DROP TABLE %1$s'
27 /**
28 * @var string
30 protected $table = '';
32 /**
33 * @param string $table
35 public function __construct($table = '')
37 $this->table = $table;
40 /**
41 * @param null|PlatformInterface $adapterPlatform
42 * @return string
44 public function getSqlString(PlatformInterface $adapterPlatform = null)
46 // get platform, or create default
47 $adapterPlatform = ($adapterPlatform) ?: new AdapterSql92Platform;
49 $sqls = array();
50 $parameters = array();
52 foreach ($this->specifications as $name => $specification) {
53 $parameters[$name] = $this->{'process' . $name}(
54 $adapterPlatform,
55 null,
56 null,
57 $sqls,
58 $parameters
61 if ($specification && is_array($parameters[$name])) {
62 $sqls[$name] = $this->createSqlFromSpecificationAndParameters(
63 $specification,
64 $parameters[$name]
69 $sql = implode(' ', $sqls);
70 return $sql;
73 protected function processTable(PlatformInterface $adapterPlatform = null)
75 return array($adapterPlatform->quoteIdentifier($this->table));