Skip to content

Commit

Permalink
Some cleanups, docblocks, and a small needed refactoring of ClassMeta…
Browse files Browse the repository at this point in the history
…dataFactory.
  • Loading branch information
romanb committed Feb 5, 2009
1 parent efb733d commit deb095f
Show file tree
Hide file tree
Showing 25 changed files with 241 additions and 947 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This software consists of voluntary contributions made by many individuals
and is licensed under the LGPL. For more information, see <http://www.phpdoctrine.org>.
and is licensed under the LGPL. For more information, see <http://www.doctrine-project.org>.
84 changes: 67 additions & 17 deletions lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,20 @@ abstract class AbstractPlatform
* Constructor.
*/
public function __construct() {}


/**
* Sets whether to quote identifiers.
*/
public function setQuoteIdentifiers($bool)
{
$this->_quoteIdentifiers = (bool)$bool;
}


/**
* Gets whether to quote identifiers.
*
* @return boolean
*/
public function getQuoteIdentifiers()
{
return $this->_quoteIdentifiers;
Expand Down Expand Up @@ -1752,7 +1760,7 @@ public function writeLimitClause($query, $limit = false, $offset = false)
* @return string
* @todo Remove the ORM dependency
*/
public function writeLimitClauseInSubquery(Doctrine_ClassMetadata $rootClass,
public function writeLimitClauseInSubquery(\Doctrine\ORM\Mapping\ClassMetadata $rootClass,
$query, $limit = false, $offset = false)
{
return $this->modifyLimitQuery($query, $limit, $offset);
Expand All @@ -1778,7 +1786,6 @@ public function getProperty($name)
* Default conversion defined here converts to integers.
*
* @param array $item
* @return void
*/
public function convertBooleans($item)
{
Expand All @@ -1797,9 +1804,9 @@ public function convertBooleans($item)
}

/**
* Enter description here...
* Gets the SQL statement specific for the platform to set the charset.
*
* @param unknown_type $charset
* @param string $charset
* @return string
*/
public function getSetCharsetSql($charset)
Expand All @@ -1810,7 +1817,7 @@ public function getSetCharsetSql($charset)
/**
* Enter description here...
*
* @param unknown_type $level
* @param integer $level
*/
protected function _getTransactionIsolationLevelSql($level)
{
Expand All @@ -1831,7 +1838,7 @@ protected function _getTransactionIsolationLevelSql($level)
/**
* Enter description here...
*
* @param unknown_type $level
* @param integer $level
*/
public function getSetTransactionIsolationSql($level)
{
Expand All @@ -1842,7 +1849,7 @@ public function getSetTransactionIsolationSql($level)
* Gets the default transaction isolation level of the platform.
*
* @return integer The default isolation level.
* @see Doctrine::DBAL::Connection::TRANSACTION_* constants.
* @see Doctrine\DBAL\Connection\TRANSACTION_* constants.
*/
public function getDefaultTransactionIsolationLevel()
{
Expand All @@ -1851,42 +1858,85 @@ public function getDefaultTransactionIsolationLevel()


/* supports*() metods */


/**
* Whether the platform supports sequences.
*
* @return boolean
*/
public function supportsSequences()
{
return false;
}


/**
* Whether the platform supports identity columns.
* Identity columns are columns that recieve an auto-generated value from the
* database on insert of a row.
*
* @return boolean
*/
public function supportsIdentityColumns()
{
return false;
}


/**
* Whether the platform supports indexes.
*
* @return boolean
*/
public function supportsIndexes()
{
return true;
}


/**
* Whether the platform supports transactions.
*
* @return boolean
*/
public function supportsTransactions()
{
return true;
}


/**
* Whether the platform supports savepoints.
*
* @return boolean
*/
public function supportsSavepoints()
{
return true;
}


/**
* Whether the platform supports primary key constraints.
*
* @return boolean
*/
public function supportsPrimaryConstraints()
{
return true;
}


/**
* Whether the platform supports foreign key constraints.
*
* @return boolean
*/
public function supportsForeignKeyConstraints()
{
return true;
}


/**
* Whether the platform supports getting the affected rows or a recent
* update/delete type query.
*
* @return boolean
*/
public function supportsGettingAffectedRows()
{
return true;
Expand Down
24 changes: 22 additions & 2 deletions lib/Doctrine/DBAL/Platforms/SqlitePlatform.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\DBAL\Platforms;

/**
* Enter description here...
* The SqlitePlatform class describes the specifics and dialects of the SQLite
* database platform.
*
* @since 2.0
*/
Expand Down Expand Up @@ -537,7 +557,7 @@ public function getVarcharDeclarationSql(array $field)
* This really limits their usefulness and requires SQLite specific handling, so
* we simply say that SQLite does NOT support foreign keys for now...
*
* @return boolean
* @return boolean FALSE
* @override
*/
public function supportsForeignKeyConstraints()
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\DBAL\Schema;

/**
* Base class for schema managers. Schema managers are used to inspect and/or
* modify the database schema.
* modify the database schema/structure.
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @author Konsta Vesterinen <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\DBAL\Schema;
Expand Down
35 changes: 0 additions & 35 deletions lib/Doctrine/ORM/Entity.php

This file was deleted.

6 changes: 2 additions & 4 deletions lib/Doctrine/ORM/Export/ClassExporter.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* $Id: Export.php 4805 2008-08-25 19:11:58Z subzero2000 $
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Expand All @@ -16,7 +16,7 @@
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\ORM\Export;
Expand All @@ -27,8 +27,6 @@
* The ClassExporter can generate database schemas/structures from ClassMetadata
* class descriptors.
*
* @package Doctrine
* @subpackage Export
* @author Konsta Vesterinen <[email protected]>
* @author Lukas Smith <[email protected]> (PEAR MDB2 library)
* @author Roman Borschel <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Id/Assigned.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Assigned extends AbstractIdGenerator
/**
* Returns the identifier assigned to the given entity.
*
* @param Doctrine\ORM\Entity $entity
* @param object $entity
* @return mixed
* @override
*/
Expand Down
Loading

0 comments on commit deb095f

Please sign in to comment.