Permalink
Browse files

update docblocks

  • Loading branch information...
pmjones committed Oct 26, 2013
1 parent ef17ebb commit 7d47554cf0b9cc344498835d4eeba23b20c06347
Showing with 79 additions and 0 deletions.
  1. +47 −0 src/AbstractSchema.php
  2. +14 −0 src/MysqlSchema.php
  3. +18 −0 src/SqlsrvSchema.php
View
@@ -21,8 +21,22 @@
*/
abstract class AbstractSchema implements SchemaInterface
{
+ /**
+ *
+ * The quote prefix for identifier names.
+ *
+ * @var string
+ *
+ */
protected $quote_name_prefix = '`';
+ /**
+ *
+ * The quote suffix for identifier names.
+ *
+ * @var string
+ *
+ */
protected $quote_name_suffix = '`';
/**
@@ -197,20 +211,53 @@ public function quoteName($name)
return $this->quote_name_prefix . $name . $this->quote_name_suffix;
}
+ /**
+ *
+ * Fetch all result rows.
+ *
+ * @param string $statement The SQL statement.
+ *
+ * @param array $values Values to bind to the SQL statement.
+ *
+ * @return array
+ *
+ */
protected function pdoFetchAll($statement, array $values = array())
{
$sth = $this->pdo->prepare($statement);
$sth->execute($values);
return $sth->fetchAll(PDO::FETCH_ASSOC);
}
+ /**
+ *
+ * Fetch the first column of all result rows.
+ *
+ * @param string $statement The SQL statement.
+ *
+ * @param array $values Values to bind to the SQL statement.
+ *
+ * @return array
+ *
+ */
protected function pdoFetchCol($statement, array $values = array())
{
$sth = $this->pdo->prepare($statement);
$sth->execute($values);
return $sth->fetchAll(PDO::FETCH_COLUMN, 0);
}
+ /**
+ *
+ * Fetch the first column of the first row.
+ *
+ * @param string $statement The SQL statement.
+ *
+ * @param array $values Values to bind to the SQL statement.
+ *
+ * @return mixed
+ *
+ */
protected function pdoFetchValue($statement, array $values = array())
{
$sth = $this->pdo->prepare($statement);
View
@@ -19,8 +19,22 @@
*/
class MysqlSchema extends AbstractSchema
{
+ /**
+ *
+ * The quote prefix for identifier names.
+ *
+ * @var string
+ *
+ */
protected $quote_name_prefix = '`';
+ /**
+ *
+ * The quote suffix for identifier names.
+ *
+ * @var string
+ *
+ */
protected $quote_name_suffix = '`';
/**
View
@@ -19,6 +19,24 @@
*/
class SqlsrvSchema extends AbstractSchema
{
+ /**
+ *
+ * The quote prefix for identifier names.
+ *
+ * @var string
+ *
+ */
+ protected $quote_name_prefix = '[';
+
+ /**
+ *
+ * The quote suffix for identifier names.
+ *
+ * @var string
+ *
+ */
+ protected $quote_name_suffix = ']';
+
/**
*
* Returns a list of all tables in the database.

0 comments on commit 7d47554

Please sign in to comment.