From 4e22f1fbafb039a57afecd7973f4df3d6f05c89a Mon Sep 17 00:00:00 2001 From: lsmith Date: Fri, 29 Dec 2006 14:40:47 +0000 Subject: [PATCH] - second round of PEAR CS fixes --- lib/Doctrine.php | 49 ++-- lib/Doctrine/Access.php | 30 ++- lib/Doctrine/Adapter.php | 3 +- lib/Doctrine/Adapter/Statement.php | 27 ++- lib/Doctrine/Cache/Query/Sqlite.php | 24 +- lib/Doctrine/Collection.php | 102 +++++--- lib/Doctrine/Collection/Batch.php | 21 +- lib/Doctrine/Collection/Exception.php | 3 +- lib/Doctrine/Collection/Immediate.php | 6 +- lib/Doctrine/Collection/Iterator.php | 18 +- .../Collection/Iterator/Expandable.php | 6 +- lib/Doctrine/Collection/Iterator/Normal.php | 6 +- lib/Doctrine/Collection/Iterator/Offset.php | 6 +- lib/Doctrine/Collection/Lazy.php | 6 +- lib/Doctrine/Collection/Offset.php | 12 +- lib/Doctrine/Compiler.php | 11 +- lib/Doctrine/Compiler/Exception.php | 3 +- lib/Doctrine/Configurable.php | 30 ++- lib/Doctrine/Connection.php | 146 ++++++----- lib/Doctrine/Connection/Common.php | 6 +- lib/Doctrine/Connection/Db2.php | 6 +- lib/Doctrine/Connection/Exception.php | 14 +- lib/Doctrine/Connection/Firebird.php | 15 +- .../Connection/Firebird/Exception.php | 6 +- lib/Doctrine/Connection/Informix.php | 6 +- .../Connection/Informix/Exception.php | 3 +- lib/Doctrine/Connection/Mock.php | 6 +- lib/Doctrine/Connection/Module.php | 12 +- lib/Doctrine/Connection/Mssql.php | 18 +- lib/Doctrine/Connection/Mssql/Exception.php | 6 +- lib/Doctrine/Connection/Mysql.php | 18 +- lib/Doctrine/Connection/Mysql/Exception.php | 6 +- lib/Doctrine/Connection/Oracle.php | 15 +- lib/Doctrine/Connection/Oracle/Exception.php | 6 +- lib/Doctrine/Connection/Pgsql.php | 21 +- lib/Doctrine/Connection/Pgsql/Exception.php | 8 +- lib/Doctrine/Connection/Sqlite.php | 12 +- lib/Doctrine/Connection/Sqlite/Exception.php | 6 +- lib/Doctrine/Connection/UnitOfWork.php | 30 ++- lib/Doctrine/DataDict.php | 10 +- lib/Doctrine/DataDict/Exception.php | 3 +- lib/Doctrine/DataDict/Firebird.php | 15 +- lib/Doctrine/DataDict/Informix.php | 8 +- lib/Doctrine/DataDict/Informix/Exception.php | 3 +- lib/Doctrine/DataDict/Mssql.php | 13 +- lib/Doctrine/DataDict/Mssql/Exception.php | 3 +- lib/Doctrine/DataDict/Mysql.php | 19 +- lib/Doctrine/DataDict/Mysql/Exception.php | 3 +- lib/Doctrine/DataDict/Oracle.php | 9 +- lib/Doctrine/DataDict/Oracle/Exception.php | 3 +- lib/Doctrine/DataDict/Pgsql.php | 20 +- lib/Doctrine/DataDict/Pgsql/Exception.php | 19 +- lib/Doctrine/DataDict/Sqlite.php | 14 +- lib/Doctrine/DataDict/Sqlite/Exception.php | 19 +- lib/Doctrine/Db.php | 84 ++++--- lib/Doctrine/Db/Event.php | 27 ++- lib/Doctrine/Db/EventListener.php | 61 +++-- lib/Doctrine/Db/EventListener/Chain.php | 54 +++-- lib/Doctrine/Db/Exception.php | 3 +- lib/Doctrine/Db/Mock.php | 3 +- lib/Doctrine/Db/Profiler.php | 9 +- lib/Doctrine/Db/Profiler/Exception.php | 19 +- lib/Doctrine/Db/Profiler/Query.php | 27 ++- lib/Doctrine/Db/Statement.php | 21 +- lib/Doctrine/EventListener.php | 90 ++++--- .../EventListener/AccessorInvoker.php | 25 +- lib/Doctrine/EventListener/Chain.php | 99 +++++--- lib/Doctrine/EventListener/Debugger.php | 99 +++++--- lib/Doctrine/EventListener/Empty.php | 3 +- lib/Doctrine/Exception.php | 3 +- lib/Doctrine/Export.php | 57 +++-- lib/Doctrine/Export/Exception.php | 3 +- lib/Doctrine/Export/Firebird.php | 36 ++- lib/Doctrine/Export/Firebird/Exception.php | 3 +- lib/Doctrine/Export/Mssql.php | 18 +- lib/Doctrine/Export/Mysql.php | 24 +- lib/Doctrine/Export/Mysql/Exception.php | 3 +- lib/Doctrine/Export/Oracle.php | 23 +- lib/Doctrine/Export/Pgsql.php | 12 +- lib/Doctrine/Export/Sqlite.php | 6 +- lib/Doctrine/Expression.php | 111 ++++++--- lib/Doctrine/Expression/Exception.php | 5 +- lib/Doctrine/Expression/Firebird.php | 9 +- lib/Doctrine/Expression/Informix.php | 19 +- lib/Doctrine/Expression/Mssql.php | 12 +- lib/Doctrine/Expression/Mysql.php | 9 +- lib/Doctrine/Expression/Oracle.php | 15 +- lib/Doctrine/Expression/Pgsql.php | 21 +- lib/Doctrine/Expression/Sqlite.php | 42 ++-- lib/Doctrine/Hook.php | 27 ++- lib/Doctrine/Hook/Equal.php | 6 +- lib/Doctrine/Hook/Integer.php | 6 +- lib/Doctrine/Hook/Parser.php | 9 +- lib/Doctrine/Hook/Parser/Complex.php | 9 +- lib/Doctrine/Hook/WordLike.php | 6 +- lib/Doctrine/Hydrate.php | 80 +++--- lib/Doctrine/Hydrate/Alias.php | 21 +- lib/Doctrine/Identifier.php | 3 +- lib/Doctrine/Import.php | 26 +- lib/Doctrine/Import/Builder.php | 24 +- lib/Doctrine/Import/Builder/BaseClass.php | 83 +++---- lib/Doctrine/Import/Builder/Exception.php | 79 +++--- lib/Doctrine/Import/Builder/Record.tpl | 9 +- lib/Doctrine/Import/Exception.php | 19 +- lib/Doctrine/Import/Firebird.php | 24 +- lib/Doctrine/Import/Informix.php | 3 +- lib/Doctrine/Import/Mssql.php | 47 ++-- lib/Doctrine/Import/Mysql.php | 41 ++-- lib/Doctrine/Import/Oracle.php | 32 +-- lib/Doctrine/Import/Pgsql.php | 62 ++--- lib/Doctrine/Import/Reader/Db.php | 3 +- lib/Doctrine/Import/Reader/Propel.php | 6 +- lib/Doctrine/Import/Sqlite.php | 53 ++-- lib/Doctrine/Lib.php | 24 +- lib/Doctrine/Locking/Exception.php | 3 +- lib/Doctrine/Locking/Manager/Pessimistic.php | 21 +- lib/Doctrine/Manager.php | 70 ++++-- lib/Doctrine/Manager/Exception.php | 3 +- lib/Doctrine/Null.php | 3 +- lib/Doctrine/Query/Condition.php | 6 +- lib/Doctrine/Query/Exception.php | 3 +- lib/Doctrine/Query/From.php | 9 +- lib/Doctrine/Query/Groupby.php | 9 +- lib/Doctrine/Query/Having.php | 12 +- lib/Doctrine/Query/Orderby.php | 9 +- lib/Doctrine/Query/Part.php | 21 +- lib/Doctrine/Query/Set.php | 6 +- lib/Doctrine/Query/Where.php | 18 +- lib/Doctrine/RawSql.php | 21 +- lib/Doctrine/RawSql/Exception.php | 3 +- lib/Doctrine/Record.php | 228 ++++++++++++------ lib/Doctrine/Record/Exception.php | 3 +- lib/Doctrine/Record/Iterator.php | 12 +- lib/Doctrine/Record/State/Exception.php | 3 +- lib/Doctrine/Relation.php | 39 ++- lib/Doctrine/Relation/Association.php | 18 +- lib/Doctrine/Relation/Association/Self.php | 9 +- lib/Doctrine/Relation/ForeignKey.php | 9 +- lib/Doctrine/Relation/LocalKey.php | 9 +- lib/Doctrine/Schema.php | 12 +- lib/Doctrine/Schema/Column.php | 21 +- lib/Doctrine/Schema/Database.php | 18 +- lib/Doctrine/Schema/Exception.php | 79 +++--- lib/Doctrine/Schema/Object.php | 21 +- lib/Doctrine/Schema/Relation.php | 12 +- lib/Doctrine/Schema/Table.php | 15 +- lib/Doctrine/Table.php | 186 +++++++++----- lib/Doctrine/Table/Exception.php | 3 +- lib/Doctrine/Table/Repository.php | 33 ++- lib/Doctrine/Table/Repository/Exception.php | 3 +- lib/Doctrine/Transaction.php | 48 ++-- lib/Doctrine/Transaction/Exception.php | 3 +- lib/Doctrine/Transaction/Firebird.php | 12 +- lib/Doctrine/Transaction/Informix.php | 3 +- lib/Doctrine/Transaction/Mssql.php | 3 +- lib/Doctrine/Transaction/Mysql.php | 18 +- lib/Doctrine/Transaction/Oracle.php | 15 +- lib/Doctrine/Transaction/Pgsql.php | 15 +- lib/Doctrine/Transaction/Sqlite.php | 6 +- lib/Doctrine/Validator.php | 27 ++- lib/Doctrine/Validator/Country.php | 9 +- lib/Doctrine/Validator/Creditcard.php | 6 +- lib/Doctrine/Validator/Date.php | 6 +- lib/Doctrine/Validator/Email.php | 7 +- lib/Doctrine/Validator/Enum.php | 6 +- lib/Doctrine/Validator/ErrorStack.php | 27 ++- lib/Doctrine/Validator/Exception.php | 18 +- lib/Doctrine/Validator/Htmlcolor.php | 6 +- lib/Doctrine/Validator/Ip.php | 6 +- lib/Doctrine/Validator/Nospace.php | 6 +- lib/Doctrine/Validator/Notblank.php | 6 +- lib/Doctrine/Validator/Notnull.php | 6 +- lib/Doctrine/Validator/Range.php | 6 +- lib/Doctrine/Validator/Regexp.php | 6 +- lib/Doctrine/Validator/Unique.php | 6 +- lib/Doctrine/Validator/Usstate.php | 9 +- lib/Doctrine/ValueHolder.php | 21 +- lib/Doctrine/View.php | 27 ++- lib/Doctrine/View/Exception.php | 3 +- 179 files changed, 2525 insertions(+), 1409 deletions(-) diff --git a/lib/Doctrine.php b/lib/Doctrine.php index 89bb6a64a..7d6a0e560 100644 --- a/lib/Doctrine.php +++ b/lib/Doctrine.php @@ -32,8 +32,9 @@ * @since 1.0 * @version $Revision$ */ -final class Doctrine { - /** +final class Doctrine +{ + /** * ERROR CONSTANTS */ const ERR = -1; @@ -137,7 +138,7 @@ final class Doctrine { const ATTR_DEF_TABLESPACE = 32; const ATTR_EMULATE_DATABASE = 33; const ATTR_DB_NAME_FORMAT = 34; - + /** TODO: REMOVE THE FOLLOWING CONSTANTS AND UPDATE THE DOCS ! */ /** @@ -176,8 +177,8 @@ final class Doctrine { * accessor invoking prefix set */ const ATTR_ACCESSOR_PREFIX_SET = 23; - - + + /** * LIMIT CONSTANTS @@ -234,14 +235,14 @@ final class Doctrine { /** * FETCH RECORD * - * Specifies that the fetch method shall return Doctrine_Record + * Specifies that the fetch method shall return Doctrine_Record * objects as the elements of the result set. * * This is the default fetchmode. */ const FETCH_RECORD = 2; /** - * FETCH ARRAY + * FETCH ARRAY */ const FETCH_ARRAY = 3; @@ -250,7 +251,7 @@ final class Doctrine { /** * ACCESSOR CONSTANTS */ - + /** * constant for no accessors */ @@ -267,7 +268,7 @@ final class Doctrine { * constant for both accessors get and set */ const ACCESSOR_BOTH = 3; - + /** * PORTABILITY CONSTANTS */ @@ -330,7 +331,8 @@ final class Doctrine { /** * constructor */ - public function __construct() { + public function __construct() + { throw new Doctrine_Exception('Doctrine is static class. No instances can be created.'); } /** @@ -343,7 +345,8 @@ final class Doctrine { * * @return string */ - public static function getPath() { + public static function getPath() + { if (! self::$path) { self::$path = dirname(__FILE__); } @@ -355,7 +358,8 @@ final class Doctrine { * * @return void */ - public static function loadAll() { + public static function loadAll() + { $classes = Doctrine_Compiler::getRuntimeClasses(); foreach ($classes as $class) { @@ -368,7 +372,8 @@ final class Doctrine { * * @param string $directory */ - public static function import($directory) { + public static function import($directory) + { Doctrine_Import::import(); } /** @@ -377,7 +382,8 @@ final class Doctrine { * * @param string $directory */ - public static function export($directory) { + public static function export($directory) + { Doctrine_Export::export(); } /** @@ -389,7 +395,8 @@ final class Doctrine { * @throws Doctrine_Exception * @return void */ - public static function compile() { + public static function compile() + { Doctrine_Compiler::compile(); } /** @@ -399,7 +406,8 @@ final class Doctrine { * @param string $classname * @return boolean */ - public static function autoload($classname) { + public static function autoload($classname) + { if (class_exists($classname)) { return false; } @@ -422,7 +430,8 @@ final class Doctrine { * @param string $classname * @return string */ - public static function tableize($classname) { + public static function tableize($classname) + { return strtolower(preg_replace('~(?<=\\w)([A-Z])~', '_$1', $classname)); } /** @@ -431,7 +440,8 @@ final class Doctrine { * @param string $tablename * @return string */ - public static function classify($tablename) { + public static function classify($tablename) + { return preg_replace('~(_?)(_)([\w])~e', '"$1".strtoupper("$3")', ucfirst($tablename)); } /** @@ -440,7 +450,8 @@ final class Doctrine { * @param string $classname * @return boolean */ - public static function isValidClassname($classname) { + public static function isValidClassname($classname) + { if (preg_match('~(^[a-z])|(_[a-z])|([\W])|(_{2})~', $classname)) return false; diff --git a/lib/Doctrine/Access.php b/lib/Doctrine/Access.php index 575a925e2..e290107d1 100644 --- a/lib/Doctrine/Access.php +++ b/lib/Doctrine/Access.php @@ -32,7 +32,8 @@ * @version $Revision$ * @author Konsta Vesterinen */ -abstract class Doctrine_Access implements ArrayAccess { +abstract class Doctrine_Access implements ArrayAccess +{ /** * setArray * @@ -40,7 +41,8 @@ abstract class Doctrine_Access implements ArrayAccess { * @since 1.0 * @return Doctrine_Access */ - public function setArray(array $array) { + public function setArray(array $array) + { foreach ($array as $k=>$v) { $this->set($k,$v); }; @@ -56,7 +58,8 @@ abstract class Doctrine_Access implements ArrayAccess { * @since 1.0 * @return void */ - public function __set($name,$value) { + public function __set($name,$value) + { $this->set($name,$value); } /** @@ -67,7 +70,8 @@ abstract class Doctrine_Access implements ArrayAccess { * @since 1.0 * @return mixed */ - public function __get($name) { + public function __get($name) + { return $this->get($name); } /** @@ -77,7 +81,8 @@ abstract class Doctrine_Access implements ArrayAccess { * @since 1.0 * @return boolean whether or not this object contains $name */ - public function __isset($name) { + public function __isset($name) + { return $this->contains($name); } /** @@ -87,14 +92,16 @@ abstract class Doctrine_Access implements ArrayAccess { * @since 1.0 * @return void */ - public function __unset($name) { + public function __unset($name) + { return $this->remove($name); } /** * @param mixed $offset * @return boolean whether or not this object contains $offset */ - public function offsetExists($offset) { + public function offsetExists($offset) + { return $this->contains($offset); } /** @@ -103,7 +110,8 @@ abstract class Doctrine_Access implements ArrayAccess { * @param mixed $offset * @return mixed */ - public function offsetGet($offset) { + public function offsetGet($offset) + { return $this->get($offset); } /** @@ -113,7 +121,8 @@ abstract class Doctrine_Access implements ArrayAccess { * @param mixed $value * @return void */ - public function offsetSet($offset, $value) { + public function offsetSet($offset, $value) + { if ( ! isset($offset)) { $this->add($value); } else { @@ -125,7 +134,8 @@ abstract class Doctrine_Access implements ArrayAccess { * @see set, offsetSet, __set * @param mixed $offset */ - public function offsetUnset($offset) { + public function offsetUnset($offset) + { return $this->remove($offset); } } diff --git a/lib/Doctrine/Adapter.php b/lib/Doctrine/Adapter.php index 964989804..edf1fb875 100644 --- a/lib/Doctrine/Adapter.php +++ b/lib/Doctrine/Adapter.php @@ -30,7 +30,8 @@ * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Adapter { +class Doctrine_Adapter +{ const ATTR_AUTOCOMMIT = 0; const ATTR_CASE = 8; const ATTR_CLIENT_VERSION = 5; diff --git a/lib/Doctrine/Adapter/Statement.php b/lib/Doctrine/Adapter/Statement.php index 684634006..cbd039b56 100644 --- a/lib/Doctrine/Adapter/Statement.php +++ b/lib/Doctrine/Adapter/Statement.php @@ -29,22 +29,31 @@ * @since 1.0 * @version $Revision$ */ -abstract class Doctrine_Adapter_Statement { - public function bindValue($no, $value) { +abstract class Doctrine_Adapter_Statement +{ + public function bindValue($no, $value) + { } - public function fetch() { + public function fetch() + { } - public function nextRowset() { + public function nextRowset() + { } - public function execute() { + public function execute() + { } - public function errorCode() { + public function errorCode() + { } - public function errorInfo() { + public function errorInfo() + { } - public function rowCount() { + public function rowCount() + { } - public function setFetchMode($mode) { + public function setFetchMode($mode) + { } public function columnCount(){ } diff --git a/lib/Doctrine/Cache/Query/Sqlite.php b/lib/Doctrine/Cache/Query/Sqlite.php index 371653f32..10733a4cb 100644 --- a/lib/Doctrine/Cache/Query/Sqlite.php +++ b/lib/Doctrine/Cache/Query/Sqlite.php @@ -30,7 +30,8 @@ * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Cache_Query_Sqlite implements Countable { +class Doctrine_Cache_Query_Sqlite implements Countable +{ /** * doctrine cache */ @@ -48,7 +49,8 @@ class Doctrine_Cache_Query_Sqlite implements Countable { * * @param Doctrine_Connection|null $connection */ - public function __construct($connection = null) { + public function __construct($connection = null) + { if ( ! ($connection instanceof Doctrine_Connection)) { $connection = Doctrine_Manager::getInstance()->getCurrentConnection(); } @@ -81,7 +83,8 @@ class Doctrine_Cache_Query_Sqlite implements Countable { * @param integer $lifespan * @return void */ - public function store($query, array $result, $lifespan) { + public function store($query, array $result, $lifespan) + { $sql = "INSERT INTO ".self::CACHE_TABLE." (query_md5, query_result, expires) VALUES (?,?,?)"; $stmt = $this->dbh->prepare($sql); $params = array(md5($query), serialize($result), (time() + $lifespan)); @@ -93,7 +96,8 @@ class Doctrine_Cache_Query_Sqlite implements Countable { * @param string $md5 * @return array */ - public function fetch($md5) { + public function fetch($md5) + { $sql = "SELECT query_result, expires FROM ".self::CACHE_TABLE." WHERE query_md5 = ?"; $stmt = $this->dbh->prepare($sql); $params = array($md5); @@ -107,7 +111,8 @@ class Doctrine_Cache_Query_Sqlite implements Countable { * * @return integer */ - public function deleteAll() { + public function deleteAll() + { $sql = "DELETE FROM ".self::CACHE_TABLE; $stmt = $this->dbh->query($sql); return $stmt->rowCount(); @@ -118,7 +123,8 @@ class Doctrine_Cache_Query_Sqlite implements Countable { * * @return integer */ - public function deleteExpired() { + public function deleteExpired() + { $sql = "DELETE FROM ".self::CACHE_TABLE." WHERE expired < ?"; $stmt = $this->dbh->prepare($sql); $stmt->execute(array(time())); @@ -131,7 +137,8 @@ class Doctrine_Cache_Query_Sqlite implements Countable { * @param string $md5 * @return boolean */ - public function delete($md5) { + public function delete($md5) + { $sql = "DELETE FROM ".self::CACHE_TABLE." WHERE query_md5 = ?"; $stmt = $this->dbh->prepare($sql); $params = array($md5); @@ -143,7 +150,8 @@ class Doctrine_Cache_Query_Sqlite implements Countable { * * @return integer */ - public function count() { + public function count() + { $stmt = $this->dbh->query("SELECT COUNT(*) FROM ".self::CACHE_TABLE); $data = $stmt->fetch(PDO::FETCH_NUM); diff --git a/lib/Doctrine/Collection.php b/lib/Doctrine/Collection.php index f09fbc1df..3c899fe6e 100644 --- a/lib/Doctrine/Collection.php +++ b/lib/Doctrine/Collection.php @@ -31,7 +31,8 @@ Doctrine::autoload("Doctrine_Access"); * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Collection extends Doctrine_Access implements Countable, IteratorAggregate, Serializable { +class Doctrine_Collection extends Doctrine_Access implements Countable, IteratorAggregate, Serializable +{ /** * @var array $data an array containing the data access objects of this collection */ @@ -76,7 +77,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * * @param Doctrine_Table|string $table */ - public function __construct($table) { + public function __construct($table) + { if ( ! ($table instanceof Doctrine_Table)) { $table = Doctrine_Manager::getInstance() ->getCurrentConnection() @@ -95,7 +97,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * * @return void */ - public static function initNullObject(Doctrine_Null $null) { + public static function initNullObject(Doctrine_Null $null) + { self::$null = $null; } /** @@ -104,7 +107,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * * @return Doctrine_Table */ - public function getTable() { + public function getTable() + { return $this->table; } /** @@ -114,7 +118,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * @param string $value * @return void */ - public function setAggregateValue($name, $value) { + public function setAggregateValue($name, $value) + { $this->aggregateValues[$name] = $value; } /** @@ -123,7 +128,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * @param string $name * @return mixed */ - public function getAggregateValue($name) { + public function getAggregateValue($name) + { return $this->aggregateValues[$name]; } /** @@ -131,7 +137,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * * @return array */ - public function serialize() { + public function serialize() + { $vars = get_object_vars($this); unset($vars['reference']); @@ -151,7 +158,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * * @return void */ - public function unserialize($serialized) { + public function unserialize($serialized) + { $manager = Doctrine_Manager::getInstance(); $connection = $manager->getCurrentConnection(); @@ -177,7 +185,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * whether or not an offset batch has been expanded * @return boolean */ - public function isExpanded($offset) { + public function isExpanded($offset) + { return isset($this->expanded[$offset]); } /** @@ -186,7 +195,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * whether or not this collection is expandable * @return boolean */ - public function isExpandable() { + public function isExpandable() + { return $this->expandable; } /** @@ -195,7 +205,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * @param string $column * @return void */ - public function setKeyColumn($column) { + public function setKeyColumn($column) + { $this->keyColumn = $column; } /** @@ -204,7 +215,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * * @return string */ - public function getKeyColumn() { + public function getKeyColumn() + { return $this->column; } /** @@ -212,13 +224,15 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * * @return array */ - public function getData() { + public function getData() + { return $this->data; } /** * @param array $data */ - public function addData(array $data) { + public function addData(array $data) + { $this->data[] = $data; } /** @@ -227,7 +241,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * * @return mixed */ - public function getFirst() { + public function getFirst() + { return reset($this->data); } /** @@ -236,7 +251,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * * @return mixed */ - public function getLast() { + public function getLast() + { return end($this->data); } /** @@ -245,7 +261,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * * @return void */ - public function setReference(Doctrine_Record $record,Doctrine_Relation $relation) { + public function setReference(Doctrine_Record $record,Doctrine_Relation $relation) + { $this->reference = $record; $this->relation = $relation; @@ -273,7 +290,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * * @return mixed */ - public function getReference() { + public function getReference() + { return $this->reference; } /** @@ -282,7 +300,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * * @return boolean */ - public function expand($key) { + public function expand($key) + { $where = array(); $params = array(); $limit = null; @@ -402,7 +421,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * @param mixed $key * @return boolean */ - public function remove($key) { + public function remove($key) + { if ( ! isset($this->data[$key])) { $this->expand($key); throw new InvalidKeyException(); @@ -420,14 +440,16 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * @param mixed $key * @return boolean */ - public function contains($key) { + public function contains($key) + { return isset($this->data[$key]); } /** * @param mixed $key * @return object Doctrine_Record return a specified record */ - public function get($key) { + public function get($key) + { if ( ! isset($this->data[$key])) { $this->expand($key); @@ -452,7 +474,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator /** * @return array an array containing all primary keys */ - public function getPrimaryKeys() { + public function getPrimaryKeys() + { $list = array(); $name = $this->table->getIdentifier(); @@ -469,7 +492,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * returns all keys * @return array */ - public function getKeys() { + public function getKeys() + { return array_keys($this->data); } /** @@ -479,7 +503,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * * @return integer */ - public function count() { + public function count() + { return count($this->data); } /** @@ -488,7 +513,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * @param Doctrine_Record $record * @return void */ - public function set($key, Doctrine_Record $record) { + public function set($key, Doctrine_Record $record) + { if (isset($this->reference_field)) { $record->set($this->reference_field, $this->reference, false); } @@ -500,7 +526,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * @param string $key optional key for the record * @return boolean */ - public function add(Doctrine_Record $record,$key = null) { + public function add(Doctrine_Record $record,$key = null) + { if (isset($this->reference_field)) { $record->set($this->reference_field, $this->reference, false); } @@ -540,7 +567,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * @param mixed $name * @return boolean */ - public function loadRelated($name = null) { + public function loadRelated($name = null) + { $query = new Doctrine_Query($this->table->getConnection()); if ( ! isset($name)) { @@ -588,7 +616,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * @param Doctrine_Collection $coll * @return void */ - public function populateRelated($name, Doctrine_Collection $coll) { + public function populateRelated($name, Doctrine_Collection $coll) + { $rel = $this->table->getRelation($name); $table = $rel->getTable(); $foreign = $rel->getForeign(); @@ -648,7 +677,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * * @return Doctrine_Iterator_Normal */ - public function getNormalIterator() { + public function getNormalIterator() + { return new Doctrine_Collection_Iterator_Normal($this); } /** @@ -657,7 +687,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * * @return void */ - public function save(Doctrine_Connection $conn = null) { + public function save(Doctrine_Connection $conn = null) + { if ($conn == null) { $conn = $this->table->getConnection(); } @@ -676,7 +707,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * * @return boolean */ - public function delete(Doctrine_Connection $conn = null) { + public function delete(Doctrine_Connection $conn = null) + { if ($conn == null) { $conn = $this->table->getConnection(); } @@ -695,14 +727,16 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * getIterator * @return object ArrayIterator */ - public function getIterator() { + public function getIterator() + { $data = $this->data; return new ArrayIterator($data); } /** * returns a string representation of this object */ - public function __toString() { + public function __toString() + { return Doctrine_Lib::getCollectionAsString($this); } } diff --git a/lib/Doctrine/Collection/Batch.php b/lib/Doctrine/Collection/Batch.php index 6b7cd1ca7..81d993162 100644 --- a/lib/Doctrine/Collection/Batch.php +++ b/lib/Doctrine/Collection/Batch.php @@ -32,7 +32,8 @@ Doctrine::autoload('Doctrine_Collection'); * @link www.phpdoctrine.com * @since 1.0 */ -class Doctrine_Collection_Batch extends Doctrine_Collection { +class Doctrine_Collection_Batch extends Doctrine_Collection +{ /** * @var integer $batchSize batch size */ @@ -42,7 +43,8 @@ class Doctrine_Collection_Batch extends Doctrine_Collection { */ private $loaded = array(); - public function __construct(Doctrine_Table $table) { + public function __construct(Doctrine_Table $table) + { parent::__construct($table); $this->batchSize = $this->getTable()->getAttribute(Doctrine::ATTR_BATCH_SIZE); } @@ -51,7 +53,8 @@ class Doctrine_Collection_Batch extends Doctrine_Collection { * @param integer $batchSize batch size * @return boolean */ - public function setBatchSize($batchSize) { + public function setBatchSize($batchSize) + { $batchSize = (int) $batchSize; if ($batchSize <= 0) { return false; @@ -64,7 +67,8 @@ class Doctrine_Collection_Batch extends Doctrine_Collection { * * @return integer */ - public function getBatchSize() { + public function getBatchSize() + { return $this->batchSize; } /** @@ -74,7 +78,8 @@ class Doctrine_Collection_Batch extends Doctrine_Collection { * @param Doctrine_Record $record record to be loaded * @return boolean whether or not the load operation was successful */ - public function load(Doctrine_Record $record) { + public function load(Doctrine_Record $record) + { if (empty($this->data)) { return false; } @@ -146,7 +151,8 @@ class Doctrine_Collection_Batch extends Doctrine_Collection { * @param mixed $key the key of the record * @return object Doctrine_Record record */ - public function get($key) { + public function get($key) + { if (isset($this->data[$key])) { switch (gettype($this->data[$key])) { case "array": @@ -173,7 +179,8 @@ class Doctrine_Collection_Batch extends Doctrine_Collection { /** * @return Doctrine_Iterator */ - public function getIterator() { + public function getIterator() + { return new Doctrine_Collection_Iterator_Expandable($this); } } diff --git a/lib/Doctrine/Collection/Exception.php b/lib/Doctrine/Collection/Exception.php index 7ef151ef4..7d3481edb 100644 --- a/lib/Doctrine/Collection/Exception.php +++ b/lib/Doctrine/Collection/Exception.php @@ -29,4 +29,5 @@ * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Collection_Exception extends Doctrine_Exception { } +class Doctrine_Collection_Exception extends Doctrine_Exception +{ } diff --git a/lib/Doctrine/Collection/Immediate.php b/lib/Doctrine/Collection/Immediate.php index 4007759b2..4af78f19c 100644 --- a/lib/Doctrine/Collection/Immediate.php +++ b/lib/Doctrine/Collection/Immediate.php @@ -9,12 +9,14 @@ Doctrine::autoload('Doctrine_Collection'); * @link www.phpdoctrine.com * @since 1.0 */ -class Doctrine_Collection_Immediate extends Doctrine_Collection { +class Doctrine_Collection_Immediate extends Doctrine_Collection +{ /** * @param Doctrine_DQL_Parser $graph * @param integer $key */ - public function __construct(Doctrine_Table $table) { + public function __construct(Doctrine_Table $table) + { parent::__construct($table); } } diff --git a/lib/Doctrine/Collection/Iterator.php b/lib/Doctrine/Collection/Iterator.php index cff66ed6c..d33777646 100644 --- a/lib/Doctrine/Collection/Iterator.php +++ b/lib/Doctrine/Collection/Iterator.php @@ -30,7 +30,8 @@ * @version $Revision$ * @author Konsta Vesterinen */ -abstract class Doctrine_Collection_Iterator implements Iterator { +abstract class Doctrine_Collection_Iterator implements Iterator +{ /** * @var Doctrine_Collection $collection */ @@ -56,7 +57,8 @@ abstract class Doctrine_Collection_Iterator implements Iterator { * constructor * @var Doctrine_Collection $collection */ - public function __construct(Doctrine_Collection $collection) { + public function __construct(Doctrine_Collection $collection) + { $this->collection = $collection; $this->keys = $this->collection->getKeys(); $this->count = $this->collection->count(); @@ -66,7 +68,8 @@ abstract class Doctrine_Collection_Iterator implements Iterator { * * @return void */ - public function rewind() { + public function rewind() + { $this->index = 0; $i = $this->index; if (isset($this->keys[$i])) { @@ -79,7 +82,8 @@ abstract class Doctrine_Collection_Iterator implements Iterator { * * @return integer */ - public function key() { + public function key() + { return $this->key; } /** @@ -87,7 +91,8 @@ abstract class Doctrine_Collection_Iterator implements Iterator { * * @return Doctrine_Record */ - public function current() { + public function current() + { return $this->collection->get($this->key); } /** @@ -95,7 +100,8 @@ abstract class Doctrine_Collection_Iterator implements Iterator { * * @return void */ - public function next() { + public function next() + { $this->index++; $i = $this->index; if (isset($this->keys[$i])) { diff --git a/lib/Doctrine/Collection/Iterator/Expandable.php b/lib/Doctrine/Collection/Iterator/Expandable.php index 2a848ba5c..f83573539 100644 --- a/lib/Doctrine/Collection/Iterator/Expandable.php +++ b/lib/Doctrine/Collection/Iterator/Expandable.php @@ -30,8 +30,10 @@ Doctrine::autoload('Doctrine_Collection_Iterator'); * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Collection_Iterator_Expandable extends Doctrine_Collection_Iterator { - public function valid() { +class Doctrine_Collection_Iterator_Expandable extends Doctrine_Collection_Iterator +{ + public function valid() + { if ($this->index < $this->count) { return true; } elseif ($this->index == $this->count) { diff --git a/lib/Doctrine/Collection/Iterator/Normal.php b/lib/Doctrine/Collection/Iterator/Normal.php index 7a7819620..11230e504 100644 --- a/lib/Doctrine/Collection/Iterator/Normal.php +++ b/lib/Doctrine/Collection/Iterator/Normal.php @@ -30,11 +30,13 @@ Doctrine::autoload('Doctrine_Collection_Iterator'); * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Collection_Iterator_Normal extends Doctrine_Collection_Iterator { +class Doctrine_Collection_Iterator_Normal extends Doctrine_Collection_Iterator +{ /** * @return boolean whether or not the iteration will continue */ - public function valid() { + public function valid() + { return ($this->index < $this->count); } } diff --git a/lib/Doctrine/Collection/Iterator/Offset.php b/lib/Doctrine/Collection/Iterator/Offset.php index a58dada46..f5e4d2d92 100644 --- a/lib/Doctrine/Collection/Iterator/Offset.php +++ b/lib/Doctrine/Collection/Iterator/Offset.php @@ -30,6 +30,8 @@ Doctrine::autoload('Doctrine_Collection_Iterator'); * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Collection_Iterator_Offset extends Doctrine_Collection_Iterator { - public function valid() { } +class Doctrine_Collection_Iterator_Offset extends Doctrine_Collection_Iterator +{ + public function valid() + { } } diff --git a/lib/Doctrine/Collection/Lazy.php b/lib/Doctrine/Collection/Lazy.php index bcd74db05..6e7c2f9e7 100644 --- a/lib/Doctrine/Collection/Lazy.php +++ b/lib/Doctrine/Collection/Lazy.php @@ -11,13 +11,15 @@ require_once("Batch.php"); * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Collection_Lazy extends Doctrine_Collection_Batch { +class Doctrine_Collection_Lazy extends Doctrine_Collection_Batch +{ /** * constructor * @param Doctrine_DQL_Parser $graph * @param string $key */ - public function __construct(Doctrine_Table $table) { + public function __construct(Doctrine_Table $table) + { parent::__construct($table); parent::setBatchSize(1); } diff --git a/lib/Doctrine/Collection/Offset.php b/lib/Doctrine/Collection/Offset.php index d7348860b..3775dc3c0 100644 --- a/lib/Doctrine/Collection/Offset.php +++ b/lib/Doctrine/Collection/Offset.php @@ -31,7 +31,8 @@ Doctrine::autoload('Doctrine_Collection_Offset'); * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Collection_Offset extends Doctrine_Collection { +class Doctrine_Collection_Offset extends Doctrine_Collection +{ /** * @var integer $limit */ @@ -39,20 +40,23 @@ class Doctrine_Collection_Offset extends Doctrine_Collection { /** * @param Doctrine_Table $table */ - public function __construct(Doctrine_Table $table) { + public function __construct(Doctrine_Table $table) + { parent::__construct($table); $this->limit = $table->getAttribute(Doctrine::ATTR_COLL_LIMIT); } /** * @return integer */ - public function getLimit() { + public function getLimit() + { return $this->limit; } /** * @return Doctrine_Collection_Iterator_Expandable */ - public function getIterator() { + public function getIterator() + { return new Doctrine_Collection_Iterator_Expandable($this); } } diff --git a/lib/Doctrine/Compiler.php b/lib/Doctrine/Compiler.php index deebec974..bed67c42b 100644 --- a/lib/Doctrine/Compiler.php +++ b/lib/Doctrine/Compiler.php @@ -30,7 +30,8 @@ * @since 1.0 * @version $Revision$ */ -class Doctrine_Compiler { +class Doctrine_Compiler +{ /** * @var array $classes an array containing all runtime classes of Doctrine framework */ @@ -109,7 +110,8 @@ class Doctrine_Compiler { * * @return array */ - public static function getRuntimeClasses() { + public static function getRuntimeClasses() + { return self::$classes; } /** @@ -120,7 +122,8 @@ class Doctrine_Compiler { * @throws Doctrine_Compiler_Exception if something went wrong during the compile operation * @return void */ - public static function compile($target = null) { + public static function compile($target = null) + { $path = Doctrine::getPath(); $classes = self::$classes; @@ -159,7 +162,7 @@ class Doctrine_Compiler { // first write the 'compiled' data to a text file, so // that we can use php_strip_whitespace (which only works on files) $fp = @fopen($target, 'w'); - + if ($fp === false) { throw new Doctrine_Compiler_Exception("Couldn't write compiled data. Failed to open $target"); } diff --git a/lib/Doctrine/Compiler/Exception.php b/lib/Doctrine/Compiler/Exception.php index 054006522..e89d25222 100644 --- a/lib/Doctrine/Compiler/Exception.php +++ b/lib/Doctrine/Compiler/Exception.php @@ -29,4 +29,5 @@ * @since 1.0 * @version $Revision$ */ -class Doctrine_Compiler_Exception extends Doctrine_Exception { } +class Doctrine_Compiler_Exception extends Doctrine_Exception +{ } diff --git a/lib/Doctrine/Configurable.php b/lib/Doctrine/Configurable.php index 08422a37f..c4f784636 100644 --- a/lib/Doctrine/Configurable.php +++ b/lib/Doctrine/Configurable.php @@ -31,7 +31,8 @@ * @version $Revision$ * @author Konsta Vesterinen */ -abstract class Doctrine_Configurable { +abstract class Doctrine_Configurable +{ /** * @var array $attributes an array of containing all attributes @@ -60,7 +61,8 @@ abstract class Doctrine_Configurable { * @throws Doctrine_Exception if the value is invalid * @return void */ - public function setAttribute($attribute,$value) { + public function setAttribute($attribute,$value) + { switch ($attribute) { case Doctrine::ATTR_BATCH_SIZE: if ($value < 0) { @@ -153,7 +155,8 @@ abstract class Doctrine_Configurable { * @param Doctrine_EventListener $listener * @return void */ - public function setEventListener($listener) { + public function setEventListener($listener) + { return $this->setListener($listener); } /** @@ -162,7 +165,8 @@ abstract class Doctrine_Configurable { * @param Doctrine_Db_EventListener_Interface|Doctrine_Overloadable $listener * @return Doctrine_Db */ - public function addListener($listener, $name = null) { + public function addListener($listener, $name = null) + { if ( ! ($this->attributes[Doctrine::ATTR_LISTENER] instanceof Doctrine_EventListener_Chain)) { $this->attributes[Doctrine::ATTR_LISTENER] = new Doctrine_EventListener_Chain(); } @@ -175,7 +179,8 @@ abstract class Doctrine_Configurable { * * @return Doctrine_Db_EventListener_Interface|Doctrine_Overloadable */ - public function getListener() { + public function getListener() + { if ( ! isset($this->attributes[Doctrine::ATTR_LISTENER])) { if (isset($this->parent)) { return $this->parent->getListener(); @@ -190,7 +195,8 @@ abstract class Doctrine_Configurable { * @param Doctrine_Db_EventListener_Interface|Doctrine_Overloadable $listener * @return Doctrine_Db */ - public function setListener($listener) { + public function setListener($listener) + { if ( ! ($listener instanceof Doctrine_EventListener_Interface) && ! ($listener instanceof Doctrine_Overloadable) ) { @@ -206,7 +212,8 @@ abstract class Doctrine_Configurable { * @param integer $attribute * @return mixed */ - public function getAttribute($attribute) { + public function getAttribute($attribute) + { $attribute = (int) $attribute; if ($attribute < 1 || $attribute > 23) @@ -226,7 +233,8 @@ abstract class Doctrine_Configurable { * * @return array */ - public function getAttributes() { + public function getAttributes() + { return $this->attributes; } /** @@ -236,7 +244,8 @@ abstract class Doctrine_Configurable { * @param Doctrine_Configurable $component * @return void */ - public function setParent(Doctrine_Configurable $component) { + public function setParent(Doctrine_Configurable $component) + { $this->parent = $component; } /** @@ -245,7 +254,8 @@ abstract class Doctrine_Configurable { * * @return Doctrine_Configurable */ - public function getParent() { + public function getParent() + { return $this->parent; } } diff --git a/lib/Doctrine/Connection.php b/lib/Doctrine/Connection.php index faeb4a0b6..a2d77f7df 100644 --- a/lib/Doctrine/Connection.php +++ b/lib/Doctrine/Connection.php @@ -1,5 +1,5 @@ * @author Lukas Smith (MDB2 library) */ -abstract class Doctrine_Connection extends Doctrine_Configurable implements Countable, IteratorAggregate { +abstract class Doctrine_Connection extends Doctrine_Configurable implements Countable, IteratorAggregate +{ /** * @var $dbh the database handler */ @@ -45,8 +46,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun */ protected $driverName; /** - * @var array $supported an array containing all features this driver supports, - * keys representing feature names and values as + * @var array $supported an array containing all features this driver supports, + * keys representing feature names and values as * one of the following (true, false, 'emulated') */ protected $supported = array(); @@ -73,14 +74,14 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun 'export' => false, 'unitOfWork' => false, ); - /** + /** * @var array $properties an array of connection properties */ protected $properties = array('sql_comments' => array(array('start' => '--', 'end' => "\n", 'escape' => false), array('start' => '/*', 'end' => '*/', 'escape' => false) ), - 'identifier_quoting' => array('start' => '"', - 'end' => '"', + 'identifier_quoting' => array('start' => '"', + 'end' => '"', 'escape' => '"' ), 'string_quoting' => array('start' => "'", @@ -109,7 +110,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * @param Doctrine_Manager $manager the manager object * @param PDO|Doctrine_Adapter_Interface $adapter database driver */ - public function __construct(Doctrine_Manager $manager, $adapter) { + public function __construct(Doctrine_Manager $manager, $adapter) + { if ( ! ($adapter instanceof PDO) && ! in_array('Doctrine_Adapter_Interface', class_implements($adapter))) { throw new Doctrine_Connection_Exception("First argument should be an instance of PDO or implement Doctrine_Adapter_Interface"); } @@ -121,7 +123,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun $this->setParent($manager); $this->dbh->setAttribute(PDO::ATTR_CASE, PDO::CASE_NATURAL); - $this->dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + $this->dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $this->getAttribute(Doctrine::ATTR_LISTENER)->onOpen($this); } @@ -131,7 +133,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * * @return string the name of this driver */ - public function getName() { + public function getName() + { return $this->driverName; } /** @@ -144,10 +147,11 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * @see Doctrine_Transaction * @see Doctrine_Connection::$modules all availible modules * @param string $name the name of the module to get - * @throws Doctrine_Connection_Exception if trying to get an unknown module + * @throws Doctrine_Connection_Exception if trying to get an unknown module * @return Doctrine_Connection_Module connection module */ - public function __get($name) { + public function __get($name) + { if (isset($this->properties[$name])) return $this->properties[$name]; @@ -179,7 +183,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * * @return string quoted string */ - public function escapePattern($text) { + public function escapePattern($text) + { if ($this->string_quoting['escape_pattern']) { $text = str_replace($this->string_quoting['escape_pattern'], $this->string_quoting['escape_pattern'] . $this->string_quoting['escape_pattern'], $text); foreach ($this->wildcards as $wildcard) { @@ -220,7 +225,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * * @return string quoted identifier string */ - public function quoteIdentifier($str, $checkOption = true) { + public function quoteIdentifier($str, $checkOption = true) + { if ($checkOption && ! $this->getAttribute(Doctrine::ATTR_QUOTE_IDENTIFIER)) { return $str; } @@ -236,7 +242,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * * @return Doctrine_Manager */ - public function getManager() { + public function getManager() + { return $this->getParent(); } /** @@ -244,7 +251,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * * @return PDO the database handler */ - public function getDbh() { + public function getDbh() + { return $this->dbh; } /** @@ -252,7 +260,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * * @param */ - public function driverName($name) { + public function driverName($name) + { } /** * supports @@ -260,7 +269,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * @param string $feature the name of the feature * @return boolean whether or not this drivers supports given feature */ - public function supports($feature) { + public function supports($feature) + { return (isset($this->supported[$feature]) && ($this->supported[$feature] === 'emulated' || $this->supported[$feature] @@ -270,12 +280,13 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun /** * quote * quotes given input parameter - * + * * @param mixed $input parameter to be quoted * @param string $type * @return mixed */ - public function quote($input, $type = null) { + public function quote($input, $type = null) + { if ($type == null) { $type = gettype($input); } @@ -303,7 +314,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * @param string $sqn string that containts name of a potential sequence * @return string name of the sequence with possible formatting removed */ - public function fixSequenceName($sqn) { + public function fixSequenceName($sqn) + { $seqPattern = '/^'.preg_replace('/%s/', '([a-z0-9_]+)', $this->getAttribute(Doctrine::ATTR_SEQNAME_FORMAT)).'$/i'; $seqName = preg_replace($seqPattern, '\\1', $sqn); @@ -318,7 +330,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * @param string $idx string that containts name of anl index * @return string name of the index with possible formatting removed */ - public function fixIndexName($idx) { + public function fixIndexName($idx) + { $indexPattern = '/^'.preg_replace('/%s/', '([a-z0-9_]+)', $this->getAttribute(Doctrine::ATTR_IDXNAME_FORMAT)).'$/i'; $indexName = preg_replace($indexPattern, '\\1', $idx); if ($indexName && ! strcasecmp($idx, $this->getIndexName($indexName))) { @@ -332,7 +345,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * @param string name of the sequence * @return string formatted sequence name */ - public function getSequenceName($sqn) { + public function getSequenceName($sqn) + { return sprintf($this->getAttribute(Doctrine::ATTR_SEQNAME_FORMAT), preg_replace('/[^a-z0-9_\$.]/i', '_', $sqn)); } @@ -342,7 +356,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * @param string name of the index * @return string formatted index name */ - public function getIndexName($idx) { + public function getIndexName($idx) + { return sprintf($this->getAttribute(Doctrine::ATTR_IDXNAME_FORMAT), preg_replace('/[^a-z0-9_\$]/i', '_', $idx)); } @@ -381,7 +396,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * @throws PDOException if something fails at PDO level * @return integer number of rows affected */ - public function replace($table, array $fields, array $keys) { + public function replace($table, array $fields, array $keys) + { //if ( ! $this->supports('replace')) // throw new Doctrine_Connection_Exception('replace query is not supported'); @@ -444,7 +460,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * @throws PDOException if something went wrong at database level * @return integer */ - public function nextId($sequence) { + public function nextId($sequence) + { throw new Doctrine_Connection_Exception('NextId() for sequences not supported by this driver.'); } /** @@ -454,7 +471,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * * @return void */ - public function setCharset($charset) { + public function setCharset($charset) + { } /** * fetchAll @@ -528,7 +546,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * @param array $params prepared statement params * @return array */ - public function fetchBoth($statement, array $params = array()) { + public function fetchBoth($statement, array $params = array()) { return $this->query($statement, $params)->fetchAll(PDO::FETCH_BOTH); } /** @@ -554,13 +572,13 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun } /** * query - * queries the database using Doctrine Query Language and returns + * queries the database using Doctrine Query Language and returns * the first record found * * * $user = $conn->queryOne('SELECT u.* FROM User u WHERE u.id = ?', array(1)); * - * $user = $conn->queryOne('SELECT u.* FROM User u WHERE u.name LIKE ? AND u.password = ?', + * $user = $conn->queryOne('SELECT u.* FROM User u WHERE u.name LIKE ? AND u.password = ?', * array('someone', 'password') * ); * @@ -589,7 +607,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * @param integer $offset * @return PDOStatement */ - public function select($query,$limit = 0,$offset = 0) { + public function select($query,$limit = 0,$offset = 0) + { if ($limit > 0 || $offset > 0) { $query = $this->modifyLimitQuery($query, $limit, $offset); } @@ -613,7 +632,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun } } catch(Doctrine_Adapter_Exception $e) { } catch(PDOException $e) { } - + $this->rethrowException($e); } /** @@ -642,7 +661,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * * @throws Doctrine_Connection_Exception */ - private function rethrowException(Exception $e) { + private function rethrowException(Exception $e) + { $name = 'Doctrine_Connection_' . $this->driverName . '_Exception'; $exc = new $name($e->getMessage(), (int) $e->getCode()); @@ -660,7 +680,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * @param mixed $name * @return boolean */ - public function hasTable($name) { + public function hasTable($name) + { return isset($this->tables[$name]); } /** @@ -669,7 +690,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * @param string $name component name * @return object Doctrine_Table */ - public function getTable($name) { + public function getTable($name) + { if (isset($this->tables[$name])) { return $this->tables[$name]; } @@ -686,11 +708,12 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * * @return array */ - public function getTables() { + public function getTables() + { return $this->tables; } /** - * returns an iterator that iterators through all + * returns an iterator that iterators through all * initialized table objects * * @@ -701,7 +724,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * * @return ArrayIterator SPL ArrayIterator object */ - public function getIterator() { + public function getIterator() + { return new ArrayIterator($this->tables); } /** @@ -709,7 +733,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * * @return integer */ - public function count() { + public function count() + { return count($this->tables); } /** @@ -719,7 +744,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * @param $objTable a Doctrine_Table object to be added into registry * @return boolean */ - public function addTable(Doctrine_Table $objTable) { + public function addTable(Doctrine_Table $objTable) + { $name = $objTable->getComponentName(); if (isset($this->tables[$name])) { @@ -736,18 +762,20 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * @param string $name component name * @return Doctrine_Record Doctrine_Record object */ - public function create($name) { + public function create($name) + { return $this->getTable($name)->create(); } /** - * flush + * flush * saves all the records from all tables * this operation is isolated using a transaction * * @throws PDOException if something went wrong at database level * @return void */ - public function flush() { + public function flush() + { $this->beginTransaction(); $this->unitOfWork->saveAll(); $this->commit(); @@ -758,7 +786,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * * @return void */ - public function clear() { + public function clear() + { foreach ($this->tables as $k => $table) { $table->getRepository()->evictAll(); $table->clear(); @@ -770,7 +799,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * * @return void */ - public function evictTables() { + public function evictTables() + { $this->tables = array(); } /** @@ -779,7 +809,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * * @return void */ - public function close() { + public function close() + { $this->getAttribute(Doctrine::ATTR_LISTENER)->onPreClose($this); $this->clear(); @@ -791,7 +822,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * * @return integer */ - public function getTransactionLevel() { + public function getTransactionLevel() + { return $this->transaction->getTransactionLevel(); } /** @@ -803,7 +835,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * * @return void */ - public function beginTransaction() { + public function beginTransaction() + { $this->transaction->beginTransaction(); } /** @@ -813,7 +846,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * * @return void */ - public function commit() { + public function commit() + { $this->transaction->commit(); } /** @@ -825,7 +859,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * * @return void */ - public function rollback() { + public function rollback() + { $this->transaction->rollback(); } /** @@ -834,7 +869,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * @param Doctrine_Record $record * @return void */ - public function save(Doctrine_Record $record) { + public function save(Doctrine_Record $record) + { $record->getTable()->getAttribute(Doctrine::ATTR_LISTENER)->onPreSave($record); switch ($record->getState()) { @@ -856,12 +892,13 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun /** * deletes this data access object and all the related composites * this operation is isolated by a transaction - * + * * this event can be listened by the onPreDelete and onDelete listeners * * @return boolean true on success, false on failure */ - public function delete(Doctrine_Record $record) { + public function delete(Doctrine_Record $record) + { if ( ! $record->exists()) { return false; } @@ -883,7 +920,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun * returns a string representation of this object * @return string */ - public function __toString() { + public function __toString() + { return Doctrine_Lib::getConnectionAsString($this); } } diff --git a/lib/Doctrine/Connection/Common.php b/lib/Doctrine/Connection/Common.php index 50bb54994..b6e90ebf4 100644 --- a/lib/Doctrine/Connection/Common.php +++ b/lib/Doctrine/Connection/Common.php @@ -10,7 +10,8 @@ Doctrine::autoload('Doctrine_Connection'); * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Connection_Common extends Doctrine_Connection { +class Doctrine_Connection_Common extends Doctrine_Connection +{ /** * Adds an driver-specific LIMIT clause to the query * @@ -18,7 +19,8 @@ class Doctrine_Connection_Common extends Doctrine_Connection { * @param mixed $limit * @param mixed $offset */ - public function modifyLimitQuery($query,$limit = false,$offset = false,$isManip=false) { + public function modifyLimitQuery($query,$limit = false,$offset = false,$isManip=false) + { if ($limit && $offset) { $query .= " LIMIT ".$limit." OFFSET ".$offset; } elseif ($limit && ! $offset) { diff --git a/lib/Doctrine/Connection/Db2.php b/lib/Doctrine/Connection/Db2.php index 0cf0c57b1..45e7b9178 100644 --- a/lib/Doctrine/Connection/Db2.php +++ b/lib/Doctrine/Connection/Db2.php @@ -30,7 +30,8 @@ Doctrine::autoload('Doctrine_Connection'); * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Connection_Db2 extends Doctrine_Connection { +class Doctrine_Connection_Db2 extends Doctrine_Connection +{ /** * Adds an driver-specific LIMIT clause to the query * @@ -39,7 +40,8 @@ class Doctrine_Connection_Db2 extends Doctrine_Connection { * @param integer $offset start reading from given offset * @return string the modified query */ - public function modifyLimitQuery($query, $limit, $offset) { + public function modifyLimitQuery($query, $limit, $offset) + { if ($limit <= 0) return $sql; diff --git a/lib/Doctrine/Connection/Exception.php b/lib/Doctrine/Connection/Exception.php index 867629735..5ba22f42d 100644 --- a/lib/Doctrine/Connection/Exception.php +++ b/lib/Doctrine/Connection/Exception.php @@ -30,7 +30,8 @@ Doctrine::autoload('Doctrine_Exception'); * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Connection_Exception extends Doctrine_Exception { +class Doctrine_Connection_Exception extends Doctrine_Exception +{ /** * @var array $errorMessages an array containing messages for portable error codes */ @@ -67,7 +68,7 @@ class Doctrine_Connection_Exception extends Doctrine_Exception { Doctrine::ERR_LOADMODULE => 'error while including on demand module', Doctrine::ERR_TRUNCATED => 'truncated', Doctrine::ERR_DEADLOCK => 'deadlock detected', - ); + ); /** * @see Doctrine::ERR_* constants * @since 1.0 @@ -80,7 +81,8 @@ class Doctrine_Connection_Exception extends Doctrine_Exception { * * @return integer portable error code */ - public function getPortableCode() { + public function getPortableCode() + { return $this->portableCode; } /** @@ -89,7 +91,8 @@ class Doctrine_Connection_Exception extends Doctrine_Exception { * * @return string portable error message */ - public function getPortableMessage() { + public function getPortableMessage() + { return self::errorMessage($this->portableCode); } /** @@ -102,7 +105,8 @@ class Doctrine_Connection_Exception extends Doctrine_Exception { * @return string error message, or false if the error code was * not recognized */ - public static function errorMessage($value = null) { + public static function errorMessage($value = null) + { return isset(self::$errorMessages[$value]) ? self::$errorMessages[$value] : self::$errorMessages[Doctrine::ERR]; } diff --git a/lib/Doctrine/Connection/Firebird.php b/lib/Doctrine/Connection/Firebird.php index 4473cb8f0..d2bdd6fd6 100644 --- a/lib/Doctrine/Connection/Firebird.php +++ b/lib/Doctrine/Connection/Firebird.php @@ -32,7 +32,8 @@ Doctrine::autoload('Doctrine_Connection'); * @link www.phpdoctrine.com * @since 1.0 */ -class Doctrine_Connection_Firebird extends Doctrine_Connection { +class Doctrine_Connection_Firebird extends Doctrine_Connection +{ /** * @var string $driverName the name of this connection driver */ @@ -43,7 +44,8 @@ class Doctrine_Connection_Firebird extends Doctrine_Connection { * @param Doctrine_Manager $manager * @param PDO $pdo database handle */ - public function __construct(Doctrine_Manager $manager, $adapter) { + public function __construct(Doctrine_Manager $manager, $adapter) + { $this->supported = array( 'sequences' => true, @@ -82,7 +84,8 @@ class Doctrine_Connection_Firebird extends Doctrine_Connection { * * @return void */ - public function setCharset($charset) { + public function setCharset($charset) + { $query = 'SET NAMES '.$this->dbh->quote($charset); $this->dbh->query($query); } @@ -94,7 +97,8 @@ class Doctrine_Connection_Firebird extends Doctrine_Connection { * @param integer $offset start reading from given offset * @return string modified query */ - public function modifyLimitQuery($query, $limit, $offset) { + public function modifyLimitQuery($query, $limit, $offset) + { if ($limit > 0) { $query = preg_replace('/^([\s(])*SELECT(?!\s*FIRST\s*\d+)/i', "SELECT FIRST $limit SKIP $offset", $query); @@ -106,7 +110,8 @@ class Doctrine_Connection_Firebird extends Doctrine_Connection { * @param string $sequence * @return integer */ - public function getNextID($sequence) { + public function getNextID($sequence) + { $stmt = $this->query('SELECT UNIQUE FROM ' . $sequence); $data = $stmt->fetch(PDO::FETCH_NUM); return $data[0]; diff --git a/lib/Doctrine/Connection/Firebird/Exception.php b/lib/Doctrine/Connection/Firebird/Exception.php index e5bd880f6..a59e32fe1 100644 --- a/lib/Doctrine/Connection/Firebird/Exception.php +++ b/lib/Doctrine/Connection/Firebird/Exception.php @@ -32,7 +32,8 @@ Doctrine::autoload('Doctrine_Connection_Exception'); * @author Lorenzo Alberton (PEAR MDB2 Interbase driver) * @author Lukas Smith (PEAR MDB2 library) */ -class Doctrine_Connection_Firebird_Exception extends Doctrine_Connection_Exception { +class Doctrine_Connection_Firebird_Exception extends Doctrine_Connection_Exception +{ /** * @var array $errorCodeMap an array that is used for determining portable * error code from a native database error code @@ -106,7 +107,8 @@ class Doctrine_Connection_Firebird_Exception extends Doctrine_Connection_Excepti * @since 1.0 * @return array */ - public function processErrorInfo(array $errorInfo) { + public function processErrorInfo(array $errorInfo) + { /** // todo: are the following lines needed? // memo for the interbase php module hackers: we need something similar diff --git a/lib/Doctrine/Connection/Informix.php b/lib/Doctrine/Connection/Informix.php index c8f5bd7a9..f8f284a96 100644 --- a/lib/Doctrine/Connection/Informix.php +++ b/lib/Doctrine/Connection/Informix.php @@ -30,7 +30,8 @@ Doctrine::autoload('Doctrine_Connection'); * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Connection_Informix extends Doctrine_Connection { +class Doctrine_Connection_Informix extends Doctrine_Connection +{ /** * @var string $driverName the name of this connection driver */ @@ -41,7 +42,8 @@ class Doctrine_Connection_Informix extends Doctrine_Connection { * @param Doctrine_Manager $manager * @param PDO $pdo database handle */ - public function __construct(Doctrine_Manager $manager, $adapter) { + public function __construct(Doctrine_Manager $manager, $adapter) + { // initialize all driver options parent::__construct($manager, $adapter); diff --git a/lib/Doctrine/Connection/Informix/Exception.php b/lib/Doctrine/Connection/Informix/Exception.php index 49be2f956..7d95c67d7 100644 --- a/lib/Doctrine/Connection/Informix/Exception.php +++ b/lib/Doctrine/Connection/Informix/Exception.php @@ -30,4 +30,5 @@ Doctrine::autoload('Doctrine_Connection_Exception'); * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Connection_Informix_Exception extends Doctrine_Connection_Exception { } +class Doctrine_Connection_Informix_Exception extends Doctrine_Connection_Exception +{ } diff --git a/lib/Doctrine/Connection/Mock.php b/lib/Doctrine/Connection/Mock.php index 0d116441d..e7ccda759 100644 --- a/lib/Doctrine/Connection/Mock.php +++ b/lib/Doctrine/Connection/Mock.php @@ -31,7 +31,8 @@ Doctrine::autoload('Doctrine_Connection_Common'); * @link www.phpdoctrine.com * @since 1.0 */ -class Doctrine_Connection_Mock extends Doctrine_Connection_Common { +class Doctrine_Connection_Mock extends Doctrine_Connection_Common +{ /** * @var string $driverName the name of this connection driver */ @@ -42,7 +43,8 @@ class Doctrine_Connection_Mock extends Doctrine_Connection_Common { * @param Doctrine_Manager $manager * @param PDO|Doctrine_Adapter $adapter database handler */ - public function __construct(Doctrine_Manager $manager, $adapter) { + public function __construct(Doctrine_Manager $manager, $adapter) + { } } diff --git a/lib/Doctrine/Connection/Module.php b/lib/Doctrine/Connection/Module.php index b1e55867d..127bdbe17 100644 --- a/lib/Doctrine/Connection/Module.php +++ b/lib/Doctrine/Connection/Module.php @@ -29,7 +29,8 @@ * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Connection_Module { +class Doctrine_Connection_Module +{ /** * @var Doctrine_Connection $conn Doctrine_Connection object, every connection * module holds an instance of Doctrine_Connection @@ -43,7 +44,8 @@ class Doctrine_Connection_Module { * @param Doctrine_Connection $conn Doctrine_Connection object, every connection * module holds an instance of Doctrine_Connection */ - public function __construct($conn = null) { + public function __construct($conn = null) + { if ( ! ($conn instanceof Doctrine_Connection)) { $conn = Doctrine_Manager::getInstance()->getCurrentConnection(); } @@ -59,7 +61,8 @@ class Doctrine_Connection_Module { * * @return Doctrine_Connection */ - public function getConnection() { + public function getConnection() + { return $this->conn; } /** @@ -68,7 +71,8 @@ class Doctrine_Connection_Module { * * @return string the name of this module */ - public function getModuleName() { + public function getModuleName() + { return $this->moduleName; } } diff --git a/lib/Doctrine/Connection/Mssql.php b/lib/Doctrine/Connection/Mssql.php index e8f824fbc..538c81a6a 100644 --- a/lib/Doctrine/Connection/Mssql.php +++ b/lib/Doctrine/Connection/Mssql.php @@ -31,7 +31,8 @@ Doctrine::autoload('Doctrine_Connection'); * @link www.phpdoctrine.com * @since 1.0 */ -class Doctrine_Connection_Mssql extends Doctrine_Connection { +class Doctrine_Connection_Mssql extends Doctrine_Connection +{ /** * @var string $driverName the name of this connection driver */ @@ -42,7 +43,8 @@ class Doctrine_Connection_Mssql extends Doctrine_Connection { * @param Doctrine_Manager $manager * @param PDO $pdo database handle */ - public function __construct(Doctrine_Manager $manager, $adapter) { + public function __construct(Doctrine_Manager $manager, $adapter) + { // initialize all driver options $this->supported = array( 'sequences' => 'emulated', @@ -75,7 +77,8 @@ class Doctrine_Connection_Mssql extends Doctrine_Connection { * * @return string quoted identifier string */ - public function quoteIdentifier($identifier, $checkOption = false) { + public function quoteIdentifier($identifier, $checkOption = false) + { if ($checkOption && ! $this->options['quote_identifier']) { return $identifier; } @@ -87,7 +90,8 @@ class Doctrine_Connection_Mssql extends Doctrine_Connection { * @param string $sequence name of the sequence * @return integer the next value in the given sequence */ - public function nextId($sequence) { + public function nextId($sequence) + { $this->query("INSERT INTO $sequence (vapor) VALUES (0)"); $stmt = $this->query("SELECT @@IDENTITY FROM $sequence"); $data = $stmt->fetch(PDO::FETCH_NUM); @@ -103,7 +107,8 @@ class Doctrine_Connection_Mssql extends Doctrine_Connection { * @link http://lists.bestpractical.com/pipermail/rt-devel/2005-June/007339.html * @return string */ - public function modifyLimitQuery($query, $limit, $offset, $isManip = false) { + public function modifyLimitQuery($query, $limit, $offset, $isManip = false) + { if ($limit > 0) { // we need the starting SELECT clause for later $select = 'SELECT '; @@ -154,7 +159,8 @@ class Doctrine_Connection_Mssql extends Doctrine_Connection { * @param string $field name of the field into which a new row was inserted * @return integer */ - public function lastInsertID($table = null, $field = null) { + public function lastInsertID($table = null, $field = null) + { $server_info = $this->getServerVersion(); if (is_array($server_info) && !is_null($server_info['major']) diff --git a/lib/Doctrine/Connection/Mssql/Exception.php b/lib/Doctrine/Connection/Mssql/Exception.php index c53b9b6d8..f747cd04e 100644 --- a/lib/Doctrine/Connection/Mssql/Exception.php +++ b/lib/Doctrine/Connection/Mssql/Exception.php @@ -31,7 +31,8 @@ Doctrine::autoload('Doctrine_Connection_Exception'); * @category Object Relational Mapping * @link www.phpdoctrine.com */ -class Doctrine_Connection_Mssql_Exception extends Doctrine_Connection_Exception { +class Doctrine_Connection_Mssql_Exception extends Doctrine_Connection_Exception +{ /** * @var array $errorCodeMap an array that is used for determining portable * error code from a native database error code @@ -61,7 +62,8 @@ class Doctrine_Connection_Mssql_Exception extends Doctrine_Connection_Exception * @return boolean whether or not the error info processing was successfull * (the process is successfull if portable error code was found) */ - public function processErrorInfo(array $errorInfo) { + public function processErrorInfo(array $errorInfo) + { $code = $errorInfo[1]; if (isset(self::$errorCodeMap[$code])) { $this->portableCode = self::$errorCodeMap[$code]; diff --git a/lib/Doctrine/Connection/Mysql.php b/lib/Doctrine/Connection/Mysql.php index 2d550d286..507c3ad91 100644 --- a/lib/Doctrine/Connection/Mysql.php +++ b/lib/Doctrine/Connection/Mysql.php @@ -31,7 +31,8 @@ Doctrine::autoload('Doctrine_Connection_Common'); * @link www.phpdoctrine.com * @since 1.0 */ -class Doctrine_Connection_Mysql extends Doctrine_Connection_Common { +class Doctrine_Connection_Mysql extends Doctrine_Connection_Common +{ /** * @var string $driverName the name of this connection driver */ @@ -42,7 +43,8 @@ class Doctrine_Connection_Mysql extends Doctrine_Connection_Common { * @param Doctrine_Manager $manager * @param PDO|Doctrine_Adapter $adapter database handler */ - public function __construct(Doctrine_Manager $manager, $adapter) { + public function __construct(Doctrine_Manager $manager, $adapter) + { $adapter->setAttribute(PDO::ATTR_EMULATE_PREPARES, true); $this->setAttribute(Doctrine::ATTR_DEFAULT_TABLE_TYPE, 'INNODB'); @@ -94,7 +96,8 @@ class Doctrine_Connection_Mysql extends Doctrine_Connection_Common { * * @return void */ - public function setCharset($charset) { + public function setCharset($charset) + { $query = 'SET NAMES '.$this->dbh->quote($charset); $this->dbh->query($query); } @@ -110,7 +113,8 @@ class Doctrine_Connection_Mysql extends Doctrine_Connection_Common { * * @return integer */ - public function nextId($seqName, $ondemand = true) { + public function nextId($seqName, $ondemand = true) + { $sequenceName = $this->quoteIdentifier($this->getSequenceName($seqName), true); $seqcolName = $this->quoteIdentifier($this->getAttribute(Doctrine::ATTR_SEQCOL_NAME), true); $query = 'INSERT INTO ' . $sequenceName . ' (' . $seqcolName . ') VALUES (NULL)'; @@ -129,7 +133,8 @@ class Doctrine_Connection_Mysql extends Doctrine_Connection_Common { * @param string $seq_name name of the sequence * @return integer */ - public function currId($seqName) { + public function currId($seqName) + { $sequenceName = $this->quoteIdentifier($this->getSequenceName($seqName), true); $seqcolName = $this->quoteIdentifier($this->options['seqcol_name'], true); $query = 'SELECT MAX(' . $seqcolName . ') FROM ' . $sequenceName; @@ -199,7 +204,8 @@ class Doctrine_Connection_Mysql extends Doctrine_Connection_Common { * * @return integer the number of affected rows */ - public function replace($table, array $fields, array $keys) { + public function replace($table, array $fields, array $keys) + { $count = count($fields); $query = $values = ''; $keys = $colnum = 0; diff --git a/lib/Doctrine/Connection/Mysql/Exception.php b/lib/Doctrine/Connection/Mysql/Exception.php index f7f427953..1240772e4 100644 --- a/lib/Doctrine/Connection/Mysql/Exception.php +++ b/lib/Doctrine/Connection/Mysql/Exception.php @@ -31,7 +31,8 @@ Doctrine::autoload('Doctrine_Connection_Exception'); * @category Object Relational Mapping * @link www.phpdoctrine.com */ -class Doctrine_Connection_Mysql_Exception extends Doctrine_Connection_Exception { +class Doctrine_Connection_Mysql_Exception extends Doctrine_Connection_Exception +{ /** * @var array $errorCodeMap an array that is used for determining portable * error code from a native database error code @@ -71,7 +72,8 @@ class Doctrine_Connection_Mysql_Exception extends Doctrine_Connection_Exception * @return boolean whether or not the error info processing was successfull * (the process is successfull if portable error code was found) */ - public function processErrorInfo(array $errorInfo) { + public function processErrorInfo(array $errorInfo) + { $code = $errorInfo[1]; if (isset(self::$errorCodeMap[$code])) { $this->portableCode = self::$errorCodeMap[$code]; diff --git a/lib/Doctrine/Connection/Oracle.php b/lib/Doctrine/Connection/Oracle.php index 4155181f8..33ee0a696 100644 --- a/lib/Doctrine/Connection/Oracle.php +++ b/lib/Doctrine/Connection/Oracle.php @@ -30,13 +30,15 @@ Doctrine::autoload('Doctrine_Connection'); * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Connection_Oracle extends Doctrine_Connection { +class Doctrine_Connection_Oracle extends Doctrine_Connection +{ /** * @var string $driverName the name of this connection driver */ protected $driverName = 'Oracle'; - public function __construct(Doctrine_Manager $manager, $adapter) { + public function __construct(Doctrine_Manager $manager, $adapter) + { $this->supported = array( 'sequences' => true, 'indexes' => true, @@ -76,7 +78,8 @@ class Doctrine_Connection_Oracle extends Doctrine_Connection { * @param integer $offset start reading from given offset * @return string the modified query */ - public function modifyLimitQuery($query, $limit, $offset) { + public function modifyLimitQuery($query, $limit, $offset) + { /** $e = explode("select ",strtolower($query)); $e2 = explode(" from ",$e[1]); @@ -107,7 +110,8 @@ class Doctrine_Connection_Oracle extends Doctrine_Connection { * @throws PDOException if something went wrong at database level * @return integer */ - public function nextId($sequence) { + public function nextId($sequence) + { $stmt = $this->query('SELECT ' . $sequence . '.nextval FROM dual'); $data = $stmt->fetch(PDO::FETCH_NUM); return $data[0]; @@ -119,7 +123,8 @@ class Doctrine_Connection_Oracle extends Doctrine_Connection { * @throws PDOException if something went wrong at database level * @return mixed id */ - public function currId($sequence) { + public function currId($sequence) + { $sequence = $this->quoteIdentifier($this->getSequenceName($sequence), true); $stmt = $this->query('SELECT ' . $sequence . '.currval FROM dual'); $data = $stmt->fetch(PDO::FETCH_NUM); diff --git a/lib/Doctrine/Connection/Oracle/Exception.php b/lib/Doctrine/Connection/Oracle/Exception.php index 24fb01a2a..782492b6a 100644 --- a/lib/Doctrine/Connection/Oracle/Exception.php +++ b/lib/Doctrine/Connection/Oracle/Exception.php @@ -31,7 +31,8 @@ Doctrine::autoload('Doctrine_Connection_Exception'); * @category Object Relational Mapping * @link www.phpdoctrine.com */ -class Doctrine_Connection_Oracle_Exception extends Doctrine_Connection_Exception { +class Doctrine_Connection_Oracle_Exception extends Doctrine_Connection_Exception +{ /** * @var array $errorCodeMap an array that is used for determining portable * error code from a native database error code @@ -66,7 +67,8 @@ class Doctrine_Connection_Oracle_Exception extends Doctrine_Connection_Exception * @return boolean whether or not the error info processing was successfull * (the process is successfull if portable error code was found) */ - public function processErrorInfo(array $errorInfo) { + public function processErrorInfo(array $errorInfo) + { $code = $errorInfo[1]; if (isset(self::$errorCodeMap[$code])) { $this->portableCode = self::$errorCodeMap[$code]; diff --git a/lib/Doctrine/Connection/Pgsql.php b/lib/Doctrine/Connection/Pgsql.php index b4b0f8b55..eacecbea0 100644 --- a/lib/Doctrine/Connection/Pgsql.php +++ b/lib/Doctrine/Connection/Pgsql.php @@ -31,7 +31,8 @@ Doctrine::autoload("Doctrine_Connection_Common"); * @link www.phpdoctrine.com * @since 1.0 */ -class Doctrine_Connection_Pgsql extends Doctrine_Connection_Common { +class Doctrine_Connection_Pgsql extends Doctrine_Connection_Common +{ /** * @var string $driverName the name of this connection driver */ @@ -42,7 +43,8 @@ class Doctrine_Connection_Pgsql extends Doctrine_Connection_Common { * @param Doctrine_Manager $manager * @param PDO $pdo database handle */ - public function __construct(Doctrine_Manager $manager, $adapter) { + public function __construct(Doctrine_Manager $manager, $adapter) + { // initialize all driver options $this->supported = array( 'sequences' => true, @@ -82,7 +84,8 @@ class Doctrine_Connection_Pgsql extends Doctrine_Connection_Common { * * @return void */ - public function setCharset($charset) { + public function setCharset($charset) + { $query = 'SET NAMES '.$this->dbh->quote($charset); $this->dbh->query($query); } @@ -91,7 +94,8 @@ class Doctrine_Connection_Pgsql extends Doctrine_Connection_Common { * @param string $sequence * @return integer */ - public function nextId($sequence) { + public function nextId($sequence) + { $stmt = $this->dbh->query("SELECT NEXTVAL('$sequence')"); $data = $stmt->fetch(PDO::FETCH_NUM); return $data[0]; @@ -102,7 +106,8 @@ class Doctrine_Connection_Pgsql extends Doctrine_Connection_Common { * @param string $seq_name name of the sequence * @return integer */ - public function currId($sequence) { + public function currId($sequence) + { $stmt = $this->dbh->query('SELECT last_value FROM '.$sequence); $data = $stmt->fetch(PDO::FETCH_NUM); return $data[0]; @@ -116,7 +121,8 @@ class Doctrine_Connection_Pgsql extends Doctrine_Connection_Common { * @param boolean $isManip if the query is a DML query * @return string modified query */ - public function modifyLimitQuery($query, $limit = false, $offset = false, $isManip = false) { + public function modifyLimitQuery($query, $limit = false, $offset = false, $isManip = false) + { if ($limit > 0) { $query = rtrim($query); @@ -148,7 +154,8 @@ class Doctrine_Connection_Pgsql extends Doctrine_Connection_Common { * @param string $native determines if the raw version string should be returned * @return array|string an array or string with version information */ - public function getServerVersion($native = false) { + public function getServerVersion($native = false) + { $query = 'SHOW SERVER_VERSION'; $serverInfo = $this->fetchOne($query); diff --git a/lib/Doctrine/Connection/Pgsql/Exception.php b/lib/Doctrine/Connection/Pgsql/Exception.php index 1c51b86b9..addafbc49 100644 --- a/lib/Doctrine/Connection/Pgsql/Exception.php +++ b/lib/Doctrine/Connection/Pgsql/Exception.php @@ -32,7 +32,8 @@ Doctrine::autoload('Doctrine_Connection_Exception'); * @since 1.0 * @version $Revision$ */ -class Doctrine_Connection_Pgsql_Exception extends Doctrine_Connection_Exception { +class Doctrine_Connection_Pgsql_Exception extends Doctrine_Connection_Exception +{ /** * @var array $errorRegexps an array that is used for determining portable * error code from a native database error message @@ -90,10 +91,11 @@ class Doctrine_Connection_Pgsql_Exception extends Doctrine_Connection_Exception * @since 1.0 * @see Doctrine::ERR_* constants * @see Doctrine_Connection::$portableCode - * @return boolean whether or not the error info processing was successfull + * @return boolean whether or not the error info processing was successfull * (the process is successfull if portable error code was found) */ - public function processErrorInfo(array $errorInfo) { + public function processErrorInfo(array $errorInfo) + { foreach (self::$errorRegexps as $regexp => $code) { if (preg_match($regexp, $errorInfo[2])) { $this->portableCode = $code; diff --git a/lib/Doctrine/Connection/Sqlite.php b/lib/Doctrine/Connection/Sqlite.php index c867096f5..5e44663a2 100644 --- a/lib/Doctrine/Connection/Sqlite.php +++ b/lib/Doctrine/Connection/Sqlite.php @@ -31,7 +31,8 @@ Doctrine::autoload("Doctrine_Connection_Common"); * @link www.phpdoctrine.com * @since 1.0 */ -class Doctrine_Connection_Sqlite extends Doctrine_Connection_Common { +class Doctrine_Connection_Sqlite extends Doctrine_Connection_Common +{ /** * @var string $driverName the name of this connection driver */ @@ -42,7 +43,8 @@ class Doctrine_Connection_Sqlite extends Doctrine_Connection_Common { * @param Doctrine_Manager $manager * @param PDO $pdo database handle */ - public function __construct(Doctrine_Manager $manager, $adapter) { + public function __construct(Doctrine_Manager $manager, $adapter) + { $this->supported = array( 'sequences' => 'emulated', @@ -76,7 +78,8 @@ class Doctrine_Connection_Sqlite extends Doctrine_Connection_Common { /** * initializes database functions missing in sqlite */ - public function initFunctions() { + public function initFunctions() + { $this->dbh->sqliteCreateFunction('md5', array('Doctrine_Expression_Sqlite', 'md5Impl'), 1); $this->dbh->sqliteCreateFunction('mod', array('Doctrine_Expression_Sqlite', 'modImpl'), 2); $this->dbh->sqliteCreateFunction('concat', array('Doctrine_Expression_Sqlite', 'concatImpl')); @@ -88,7 +91,8 @@ class Doctrine_Connection_Sqlite extends Doctrine_Connection_Common { * @param string $seq_name name of the sequence * @return integer the current id in the given sequence */ - public function currId($sequence) { + public function currId($sequence) + { $sequence = $this->quoteIdentifier($sequence, true); $seqColumn = $this->quoteIdentifier($this->options['seqcol_name'], true); $stmt = $this->dbh->query('SELECT MAX(' . $seqColumn . ') FROM ' . $sequence); diff --git a/lib/Doctrine/Connection/Sqlite/Exception.php b/lib/Doctrine/Connection/Sqlite/Exception.php index 62477fd91..872962ea1 100644 --- a/lib/Doctrine/Connection/Sqlite/Exception.php +++ b/lib/Doctrine/Connection/Sqlite/Exception.php @@ -31,7 +31,8 @@ Doctrine::autoload('Doctrine_Connection_Exception'); * @category Object Relational Mapping * @link www.phpdoctrine.com */ -class Doctrine_Connection_Sqlite_Exception extends Doctrine_Connection_Exception { +class Doctrine_Connection_Sqlite_Exception extends Doctrine_Connection_Exception +{ /** * @var array $errorRegexps an array that is used for determining portable * error code from a native database error message @@ -62,7 +63,8 @@ class Doctrine_Connection_Sqlite_Exception extends Doctrine_Connection_Exception * @return boolean whether or not the error info processing was successfull * (the process is successfull if portable error code was found) */ - public function processErrorInfo(array $errorInfo) { + public function processErrorInfo(array $errorInfo) + { foreach (self::$errorRegexps as $regexp => $code) { if (preg_match($regexp, $errorInfo[2])) { diff --git a/lib/Doctrine/Connection/UnitOfWork.php b/lib/Doctrine/Connection/UnitOfWork.php index 0a2c434b5..dfb90ee5e 100644 --- a/lib/Doctrine/Connection/UnitOfWork.php +++ b/lib/Doctrine/Connection/UnitOfWork.php @@ -30,7 +30,8 @@ Doctrine::autoload('Doctrine_Connection_Module'); * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module implements IteratorAggregate, Countable { +class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module implements IteratorAggregate, Countable +{ /** * buildFlushTree * builds a flush tree that is used in transactions @@ -42,7 +43,8 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module implemen * @param array $tables * @return array */ - public function buildFlushTree(array $tables) { + public function buildFlushTree(array $tables) + { $tree = array(); foreach ($tables as $k => $table) { $k = $k.$table; @@ -135,7 +137,8 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module implemen * @throws PDOException if something went wrong at database level * @param Doctrine_Record $record */ - public function saveRelated(Doctrine_Record $record) { + public function saveRelated(Doctrine_Record $record) + { $saveLater = array(); foreach ($record->getReferences() as $k=>$v) { $fk = $record->getTable()->getRelation($k); @@ -181,7 +184,8 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module implemen * @param Doctrine_Record $record * @return void */ - public function saveAssociations(Doctrine_Record $record) { + public function saveAssociations(Doctrine_Record $record) + { foreach ($record->getTable()->getRelations() as $rel) { $table = $rel->getTable(); $alias = $rel->getAlias(); @@ -196,7 +200,8 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module implemen * @throws PDOException if something went wrong at database level * @return void */ - public function deleteComposites(Doctrine_Record $record) { + public function deleteComposites(Doctrine_Record $record) + { foreach ($record->getTable()->getRelations() as $fk) { switch ($fk->getType()) { case Doctrine_Relation::ONE_COMPOSITE: @@ -214,7 +219,8 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module implemen * @throws PDOException if something went wrong at database level * @return void */ - public function saveAll() { + public function saveAll() + { // get the flush tree $tree = $this->buildFlushTree($this->conn->getTables()); @@ -242,7 +248,8 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module implemen * @param Doctrine_Record $record * @return boolean */ - public function update(Doctrine_Record $record) { + public function update(Doctrine_Record $record) + { $record->getTable()->getAttribute(Doctrine::ATTR_LISTENER)->onPreUpdate($record); $array = $record->getPrepared(); @@ -295,7 +302,8 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module implemen * @param Doctrine_Record $record record to be inserted * @return boolean */ - public function insert(Doctrine_Record $record) { + public function insert(Doctrine_Record $record) + { // listen the onPreInsert event $record->getTable()->getAttribute(Doctrine::ATTR_LISTENER)->onPreInsert($record); @@ -333,7 +341,9 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module implemen return true; } - public function getIterator() { } + public function getIterator() + { } - public function count() { } + public function count() + { } } diff --git a/lib/Doctrine/DataDict.php b/lib/Doctrine/DataDict.php index b967f3667..e8c8d6aed 100644 --- a/lib/Doctrine/DataDict.php +++ b/lib/Doctrine/DataDict.php @@ -1,5 +1,5 @@ + * @author Konsta Vesterinen * @author Lukas Smith (PEAR MDB2 library) */ -class Doctrine_DataDict extends Doctrine_Connection_Module { +class Doctrine_DataDict extends Doctrine_Connection_Module +{ /** * Obtain an array of changes that may need to applied * @@ -38,7 +39,8 @@ class Doctrine_DataDict extends Doctrine_Connection_Module { * @param array $previous old definition * @return array containing all changes that will need to be applied */ - public function compareDefinition($current, $previous) { + public function compareDefinition($current, $previous) + { $type = !empty($current['type']) ? $current['type'] : null; if (!method_exists($this, "_compare{$type}Definition")) { diff --git a/lib/Doctrine/DataDict/Exception.php b/lib/Doctrine/DataDict/Exception.php index cf6e02afa..493ea4672 100644 --- a/lib/Doctrine/DataDict/Exception.php +++ b/lib/Doctrine/DataDict/Exception.php @@ -30,4 +30,5 @@ Doctrine::autoload('Doctrine_Exception'); * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_DataDict_Exception extends Doctrine_Exception { } +class Doctrine_DataDict_Exception extends Doctrine_Exception +{ } diff --git a/lib/Doctrine/DataDict/Firebird.php b/lib/Doctrine/DataDict/Firebird.php index 35dbcba29..0c46f321a 100644 --- a/lib/Doctrine/DataDict/Firebird.php +++ b/lib/Doctrine/DataDict/Firebird.php @@ -30,7 +30,8 @@ Doctrine::autoload('Doctrine_DataDict'); * @link www.phpdoctrine.com * @since 1.0 */ -class Doctrine_DataDict_Firebird extends Doctrine_DataDict { +class Doctrine_DataDict_Firebird extends Doctrine_DataDict +{ /** * Obtain DBMS specific SQL code portion needed to declare an text type * field to be used in statements like CREATE TABLE. @@ -53,7 +54,8 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict { * @return string DBMS specific SQL code portion that should be used to * declare the specified field. */ - public function getNativeDeclaration($field) { + public function getNativeDeclaration($field) + { switch ($field['type']) { case 'varchar': case 'string': @@ -96,7 +98,8 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict { * @param array $field native field description * @return array containing the various possible types, length, sign, fixed */ - public function getPortableDeclaration($field) { + public function getPortableDeclaration($field) + { $length = $field['length']; if ((int) $length <= 0) @@ -181,7 +184,8 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict { * @return string DBMS specific SQL code portion needed to set the CHARACTER SET * of a field declaration. */ - public function getCharsetFieldDeclaration($charset) { + public function getCharsetFieldDeclaration($charset) + { return 'CHARACTER SET '.$charset; } /** @@ -192,7 +196,8 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict { * @return string DBMS specific SQL code portion needed to set the COLLATION * of a field declaration. */ - public function getCollationFieldDeclaration($collation) { + public function getCollationFieldDeclaration($collation) + { return 'COLLATE '.$collation; } } diff --git a/lib/Doctrine/DataDict/Informix.php b/lib/Doctrine/DataDict/Informix.php index 1cf8e9ecb..d06bc4d5e 100644 --- a/lib/Doctrine/DataDict/Informix.php +++ b/lib/Doctrine/DataDict/Informix.php @@ -29,7 +29,8 @@ Doctrine::autoload('Doctrine_DataDict'); * @link www.phpdoctrine.com * @since 1.0 */ -class Doctrine_DataDict_Informix extends Doctrine_DataDict { +class Doctrine_DataDict_Informix extends Doctrine_DataDict +{ /** * Obtain DBMS specific SQL code portion needed to declare an text type * field to be used in statements like CREATE TABLE. @@ -53,7 +54,8 @@ class Doctrine_DataDict_Informix extends Doctrine_DataDict { * @return string DBMS specific SQL code portion that should be used to * declare the specified field. */ - public function getNativeDeclaration($field) { + public function getNativeDeclaration($field) + { switch ($field['type']) { case 'char': case 'varchar': @@ -63,7 +65,7 @@ class Doctrine_DataDict_Informix extends Doctrine_DataDict { if (empty($field['length']) && array_key_exists('default', $field)) { $field['length'] = $this->conn->varchar_max_length; } - + $length = (! empty($field['length'])) ? $field['length'] : false; $fixed = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false; diff --git a/lib/Doctrine/DataDict/Informix/Exception.php b/lib/Doctrine/DataDict/Informix/Exception.php index 001816298..cf4fe7a08 100644 --- a/lib/Doctrine/DataDict/Informix/Exception.php +++ b/lib/Doctrine/DataDict/Informix/Exception.php @@ -30,4 +30,5 @@ Doctrine::autoload('Doctrine_DataDict_Informix_Exception'); * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_DataDict_Informix_Exception extends Doctrine_DataDict_Exception { } +class Doctrine_DataDict_Informix_Exception extends Doctrine_DataDict_Exception +{ } diff --git a/lib/Doctrine/DataDict/Mssql.php b/lib/Doctrine/DataDict/Mssql.php index e79156351..62323e18b 100644 --- a/lib/Doctrine/DataDict/Mssql.php +++ b/lib/Doctrine/DataDict/Mssql.php @@ -31,11 +31,12 @@ Doctrine::autoload('Doctrine_DataDict'); * @link www.phpdoctrine.com * @since 1.0 */ -class Doctrine_DataDict_Mssql extends Doctrine_DataDict { +class Doctrine_DataDict_Mssql extends Doctrine_DataDict +{ /** * Obtain DBMS specific SQL code portion needed to declare an text type * field to be used in statements like CREATE TABLE. - * + * * @param array $field associative array with the name of the properties * of the field being declared as array indexes. Currently, the types * of supported field properties are as follows: @@ -55,7 +56,8 @@ class Doctrine_DataDict_Mssql extends Doctrine_DataDict { * @return string DBMS specific SQL code portion that should be used to * declare the specified field. */ - public function getNativeDeclaration($field) { + public function getNativeDeclaration($field) + { switch ($field['type']) { case 'array': case 'object': @@ -65,7 +67,7 @@ class Doctrine_DataDict_Mssql extends Doctrine_DataDict { case 'string': $length = !empty($field['length']) ? $field['length'] : false; - + $fixed = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false; return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR('.$db->options['default_text_field_length'].')') @@ -111,7 +113,8 @@ class Doctrine_DataDict_Mssql extends Doctrine_DataDict { * @param array $field native field description * @return array containing the various possible types, length, sign, fixed */ - public function getPortableDeclaration($field) { + public function getPortableDeclaration($field) + { $db_type = preg_replace('/\d/','', strtolower($field['type']) ); $length = $field['length']; if ((int)$length <= 0) { diff --git a/lib/Doctrine/DataDict/Mssql/Exception.php b/lib/Doctrine/DataDict/Mssql/Exception.php index 6f61638de..2c106287f 100644 --- a/lib/Doctrine/DataDict/Mssql/Exception.php +++ b/lib/Doctrine/DataDict/Mssql/Exception.php @@ -30,4 +30,5 @@ Doctrine::autoload('Doctrine_DataDict_Exception'); * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_DataDict_Mssql_Exception extends Doctrine_DataDict_Exception { } +class Doctrine_DataDict_Mssql_Exception extends Doctrine_DataDict_Exception +{ } diff --git a/lib/Doctrine/DataDict/Mysql.php b/lib/Doctrine/DataDict/Mysql.php index fa188ee48..75cd92e53 100644 --- a/lib/Doctrine/DataDict/Mysql.php +++ b/lib/Doctrine/DataDict/Mysql.php @@ -29,7 +29,8 @@ Doctrine::autoload('Doctrine_DataDict'); * @link www.phpdoctrine.com * @since 1.0 */ -class Doctrine_DataDict_Mysql extends Doctrine_DataDict { +class Doctrine_DataDict_Mysql extends Doctrine_DataDict +{ protected $keywords = array( 'ADD', 'ALL', 'ALTER', 'ANALYZE', 'AND', 'AS', @@ -130,7 +131,7 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict { * @return string DBMS specific SQL code portion that should be used to * declare the specified field. */ - public function getNativeDeclaration($field) + public function getNativeDeclaration($field) { switch ($field['type']) { case 'char': @@ -218,7 +219,8 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict { * @param array $field native field description * @return array containing the various possible types, length, sign, fixed */ - public function getPortableDeclaration(array $field) { + public function getPortableDeclaration(array $field) + { $dbType = strtolower($field['type']); $dbType = strtok($dbType, '(), '); if ($dbType == 'national') { @@ -362,7 +364,8 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict { * @return string DBMS specific SQL code portion needed to set the CHARACTER SET * of a field declaration. */ - public function getCharsetFieldDeclaration($charset) { + public function getCharsetFieldDeclaration($charset) + { return 'CHARACTER SET '.$charset; } /** @@ -373,7 +376,8 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict { * @return string DBMS specific SQL code portion needed to set the COLLATION * of a field declaration. */ - public function getCollationFieldDeclaration($collation) { + public function getCollationFieldDeclaration($collation) + { return 'COLLATE '.$collation; } /** @@ -401,7 +405,8 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict { * @return string DBMS specific SQL code portion that should be used to * declare the specified field. */ - public function getIntegerDeclaration($name, $field) { + public function getIntegerDeclaration($name, $field) + { $default = $autoinc = ''; if (!empty($field['autoincrement'])) { $autoinc = ' AUTO_INCREMENT PRIMARY KEY'; @@ -410,7 +415,7 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict { $field['default'] = empty($field['notnull']) ? null : 0; } $default = ' DEFAULT '.$this->conn->getDbh()->quote($field['default']); - } + } /** elseif (empty($field['notnull'])) { $default = ' DEFAULT NULL'; diff --git a/lib/Doctrine/DataDict/Mysql/Exception.php b/lib/Doctrine/DataDict/Mysql/Exception.php index 31c97358b..e3804e3fa 100644 --- a/lib/Doctrine/DataDict/Mysql/Exception.php +++ b/lib/Doctrine/DataDict/Mysql/Exception.php @@ -30,4 +30,5 @@ Doctrine::autoload('Doctrine_DataDict_Exception'); * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_DataDict_Mysql_Exception extends Doctrine_DataDict_Exception { } +class Doctrine_DataDict_Mysql_Exception extends Doctrine_DataDict_Exception +{ } diff --git a/lib/Doctrine/DataDict/Oracle.php b/lib/Doctrine/DataDict/Oracle.php index 5ed9f63ef..408827083 100644 --- a/lib/Doctrine/DataDict/Oracle.php +++ b/lib/Doctrine/DataDict/Oracle.php @@ -27,7 +27,8 @@ * @link www.phpdoctrine.com * @since 1.0 */ -class Doctrine_DataDict_Oracle extends Doctrine_DataDict { +class Doctrine_DataDict_Oracle extends Doctrine_DataDict +{ /** * Obtain DBMS specific SQL code portion needed to declare an text type * field to be used in statements like CREATE TABLE. @@ -50,7 +51,8 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict { * @return string DBMS specific SQL code portion that should be used to * declare the specified field. */ - public function getNativeDeclaration(array $field) { + public function getNativeDeclaration(array $field) + { switch ($field['type']) { case 'string': case 'array': @@ -93,7 +95,8 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict { * @return array containing the various possible types, length, sign, fixed * @throws Doctrine_DataDict_Oracle_Exception */ - public function getPortableDeclaration(array $field) { + public function getPortableDeclaration(array $field) + { $db_type = strtolower($field['type']); $type = array(); $length = $unsigned = $fixed = null; diff --git a/lib/Doctrine/DataDict/Oracle/Exception.php b/lib/Doctrine/DataDict/Oracle/Exception.php index 563ed5158..1584a85cc 100644 --- a/lib/Doctrine/DataDict/Oracle/Exception.php +++ b/lib/Doctrine/DataDict/Oracle/Exception.php @@ -30,4 +30,5 @@ Doctrine::autoload('Doctrine_DataDict_Exception'); * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_DataDict_Oracle_Exception extends Doctrine_DataDict_Exception { } +class Doctrine_DataDict_Oracle_Exception extends Doctrine_DataDict_Exception +{ } diff --git a/lib/Doctrine/DataDict/Pgsql.php b/lib/Doctrine/DataDict/Pgsql.php index c927c703b..511e7652d 100644 --- a/lib/Doctrine/DataDict/Pgsql.php +++ b/lib/Doctrine/DataDict/Pgsql.php @@ -29,7 +29,8 @@ * @link www.phpdoctrine.com * @since 1.0 */ -class Doctrine_DataDict_Pgsql extends Doctrine_DataDict { +class Doctrine_DataDict_Pgsql extends Doctrine_DataDict +{ /** * @param array $reservedKeyWords an array of reserved keywords by pgsql */ @@ -329,7 +330,7 @@ class Doctrine_DataDict_Pgsql extends Doctrine_DataDict { 'work', 'write', 'year', - 'zone' + 'zone' ); /** @@ -350,12 +351,13 @@ class Doctrine_DataDict_Pgsql extends Doctrine_DataDict { * * notnull * Boolean flag that indicates whether this field is constrained - * to not be set to null. + * to not be set to null. * * @return string DBMS specific SQL code portion that should be used to * declare the specified field. */ - public function getNativeDeclaration(array $field) { + public function getNativeDeclaration(array $field) + { switch ($field['type']) { case 'char': case 'string': @@ -420,7 +422,8 @@ class Doctrine_DataDict_Pgsql extends Doctrine_DataDict { * * @return array containing the various possible types, length, sign, fixed */ - public function getPortableDeclaration(array $field) { + public function getPortableDeclaration(array $field) + { $length = $field['length']; if ($length == '-1' && isset($field['atttypmod'])) { @@ -554,7 +557,8 @@ class Doctrine_DataDict_Pgsql extends Doctrine_DataDict { * @return string DBMS specific SQL code portion that should be used to * declare the specified field. */ - public function getIntegerDeclaration($name, $field) { + public function getIntegerDeclaration($name, $field) + { /** if (!empty($field['unsigned'])) { $db->warnings[] = "unsigned integer field \"$name\" is being declared as signed integer"; @@ -572,8 +576,8 @@ class Doctrine_DataDict_Pgsql extends Doctrine_DataDict { $field['default'] = empty($field['notnull']) ? null : 0; } $default = ' DEFAULT '.$this->conn->quote($field['default'], $field['type']); - } - /** + } + /** TODO: is this needed ? elseif (empty($field['notnull'])) { $default = ' DEFAULT NULL'; diff --git a/lib/Doctrine/DataDict/Pgsql/Exception.php b/lib/Doctrine/DataDict/Pgsql/Exception.php index 06b61327c..65f33d53a 100644 --- a/lib/Doctrine/DataDict/Pgsql/Exception.php +++ b/lib/Doctrine/DataDict/Pgsql/Exception.php @@ -22,12 +22,13 @@ Doctrine::autoload('Doctrine_DataDict_Exception'); /** * Doctrine_DataDict_Pgsql_Exception * - * @package Doctrine - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @category Object Relational Mapping - * @link www.phpdoctrine.com - * @since 1.0 - * @version $Revision$ - * @author Konsta Vesterinen - */ -class Doctrine_DataDict_Pgsql_Exception extends Doctrine_DataDict_Exception { } + * @package Doctrine + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @category Object Relational Mapping + * @link www.phpdoctrine.com + * @since 1.0 + * @version $Revision$ + * @author Konsta Vesterinen + */ +class Doctrine_DataDict_Pgsql_Exception extends Doctrine_DataDict_Exception +{ } diff --git a/lib/Doctrine/DataDict/Sqlite.php b/lib/Doctrine/DataDict/Sqlite.php index 068983f64..38a9bf355 100644 --- a/lib/Doctrine/DataDict/Sqlite.php +++ b/lib/Doctrine/DataDict/Sqlite.php @@ -29,7 +29,8 @@ Doctrine::autoload('Doctrine_DataDict'); * @link www.phpdoctrine.com * @since 1.0 */ -class Doctrine_DataDict_Sqlite extends Doctrine_DataDict { +class Doctrine_DataDict_Sqlite extends Doctrine_DataDict +{ /** * Obtain DBMS specific SQL code portion needed to declare an text type * field to be used in statements like CREATE TABLE. @@ -53,7 +54,8 @@ class Doctrine_DataDict_Sqlite extends Doctrine_DataDict { * @return string DBMS specific SQL code portion that should be used to * declare the specified field. */ - public function getNativeDeclaration(array $field) { + public function getNativeDeclaration(array $field) + { switch ($field['type']) { case 'text': case 'object': @@ -118,7 +120,8 @@ class Doctrine_DataDict_Sqlite extends Doctrine_DataDict { * @param array $field native field description * @return array containing the various possible types, length, sign, fixed */ - public function getPortableDeclaration(array $field) { + public function getPortableDeclaration(array $field) + { $dbType = strtolower($field['type']); $length = ( ! empty($field['length'])) ? $field['length'] : null; $unsigned = ( ! empty($field['unsigned'])) ? $field['unsigned'] : null; @@ -250,7 +253,8 @@ class Doctrine_DataDict_Sqlite extends Doctrine_DataDict { * declare the specified field. * @access protected */ - public function getIntegerDeclaration($name, array $field) { + public function getIntegerDeclaration($name, array $field) + { $default = $autoinc = ''; $type = $this->getNativeDeclaration($field); @@ -274,4 +278,4 @@ class Doctrine_DataDict_Sqlite extends Doctrine_DataDict { $name = $this->conn->quoteIdentifier($name, true); return $name . ' ' . $type . $unsigned . $default . $notnull . $autoinc; } -} +} diff --git a/lib/Doctrine/DataDict/Sqlite/Exception.php b/lib/Doctrine/DataDict/Sqlite/Exception.php index 343784280..ddf9a8f0f 100644 --- a/lib/Doctrine/DataDict/Sqlite/Exception.php +++ b/lib/Doctrine/DataDict/Sqlite/Exception.php @@ -22,12 +22,13 @@ Doctrine::autoload('Doctrine_DataDict_Exception'); /** * Doctrine_DataDict_Sqlite_Exception * - * @package Doctrine - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @category Object Relational Mapping - * @link www.phpdoctrine.com - * @since 1.0 - * @version $Revision$ - * @author Konsta Vesterinen - */ -class Doctrine_DataDict_Sqlite_Exception extends Doctrine_DataDict_Exception { } + * @package Doctrine + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @category Object Relational Mapping + * @link www.phpdoctrine.com + * @since 1.0 + * @version $Revision$ + * @author Konsta Vesterinen + */ +class Doctrine_DataDict_Sqlite_Exception extends Doctrine_DataDict_Exception +{ } diff --git a/lib/Doctrine/Db.php b/lib/Doctrine/Db.php index ce59b0171..e0a2f832a 100644 --- a/lib/Doctrine/Db.php +++ b/lib/Doctrine/Db.php @@ -48,7 +48,8 @@ * @since 1.0 * @version $Revision$ */ -class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Interface { +class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Interface +{ /** * @var array $instances all the instances of this class */ @@ -91,7 +92,8 @@ class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Inte * @param string $user database username * @param string $pass database password */ - public function __construct($dsn, $user, $pass) { + public function __construct($dsn, $user, $pass) + { if ( ! isset($user)) { $a = self::parseDSN($dsn); @@ -103,22 +105,26 @@ class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Inte $this->listener = new Doctrine_Db_EventListener(); } - public function nextQuerySequence() { + public function nextQuerySequence() + { return ++$this->querySequence; } /** * getQuerySequence */ - public function getQuerySequence() { + public function getQuerySequence() + { return $this->querySequence; } /** * getDBH */ - public function getDBH() { + public function getDBH() + { return $this->dbh; } - public function getOption($name) { + public function getOption($name) + { if ( ! array_key_exists($name, $this->options)) { throw new Doctrine_Db_Exception('Unknown option ' . $name); } @@ -130,7 +136,8 @@ class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Inte * @param Doctrine_Db_EventListener_Interface|Doctrine_Overloadable $listener * @return Doctrine_Db */ - public function addListener($listener, $name = null) { + public function addListener($listener, $name = null) + { if ( ! ($this->listener instanceof Doctrine_Db_EventListener_Chain)) { $this->listener = new Doctrine_Db_EventListener_Chain(); } @@ -143,7 +150,8 @@ class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Inte * * @return Doctrine_Db_EventListener_Interface|Doctrine_Overloadable */ - public function getListener() { + public function getListener() + { return $this->listener; } /** @@ -152,7 +160,8 @@ class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Inte * @param Doctrine_Db_EventListener_Interface|Doctrine_Overloadable $listener * @return Doctrine_Db */ - public function setListener($listener) { + public function setListener($listener) + { if ( ! ($listener instanceof Doctrine_Db_EventListener_Interface) && ! ($listener instanceof Doctrine_Overloadable) ) { @@ -169,7 +178,8 @@ class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Inte * * @return boolean */ - public function connect() { + public function connect() + { if ($this->isConnected) return false; @@ -188,7 +198,8 @@ class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Inte * * @return */ - public static function getConnection($dsn = null, $username = null, $password = null) { + public static function getConnection($dsn = null, $username = null, $password = null) + { return new self($dsn, $username, $password); } /** @@ -199,7 +210,8 @@ class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Inte * @param string $name * @return string */ - public static function driverName($name) { + public static function driverName($name) + { if (isset(self::$driverMap[$name])) { return self::$driverMap[$name]; } @@ -211,7 +223,8 @@ class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Inte * @param string $dsn * @return array Parsed contents of DSN */ - function parseDSN($dsn) { + function parseDSN($dsn) + { // silence any warnings $parts = @parse_url($dsn); @@ -271,7 +284,8 @@ class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Inte * * @return void */ - public static function clear() { + public static function clear() + { self::$instances = array(); } @@ -281,7 +295,8 @@ class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Inte * * @return integer */ - public function errorCode() { + public function errorCode() + { return $this->dbh->errorCode(); } /** @@ -290,7 +305,8 @@ class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Inte * * @return array */ - public function errorInfo() { + public function errorInfo() + { return $this->dbh->errorInfo(); } /** @@ -298,7 +314,8 @@ class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Inte * * @param string $statement */ - public function prepare($statement) { + public function prepare($statement) + { $this->connect(); $event = new Doctrine_Db_Event($this, Doctrine_Db_Event::PREPARE, $statement); @@ -345,7 +362,8 @@ class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Inte * @param string $input * @return string */ - public function quote($input) { + public function quote($input) + { $this->connect(); return $this->dbh->quote($input); @@ -357,7 +375,8 @@ class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Inte * @param string $statement * @return integer */ - public function exec($statement) { + public function exec($statement) + { $this->connect(); $args = func_get_args(); @@ -378,7 +397,8 @@ class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Inte * * @return integer */ - public function lastInsertId() { + public function lastInsertId() + { $this->connect(); return $this->dbh->lastInsertId(); @@ -388,7 +408,8 @@ class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Inte * * @return boolean */ - public function beginTransaction() { + public function beginTransaction() + { $event = new Doctrine_Db_Event($this, Doctrine_Db_Event::BEGIN); $this->listener->onPreBeginTransaction($event); @@ -404,7 +425,8 @@ class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Inte * * @return boolean */ - public function commit() { + public function commit() + { $event = new Doctrine_Db_Event($this, Doctrine_Db_Event::COMMIT); $this->listener->onPreCommit($event); @@ -420,7 +442,8 @@ class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Inte * * @return boolean */ - public function rollBack() { + public function rollBack() + { $this->connect(); $event = new Doctrine_Db_Event($this, Doctrine_Db_Event::ROLLBACK); @@ -438,7 +461,8 @@ class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Inte * @param integer $attribute * @return mixed */ - public function getAttribute($attribute) { + public function getAttribute($attribute) + { $this->connect(); return $this->dbh->getAttribute($attribute); @@ -446,7 +470,8 @@ class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Inte /** * returns an array of available PDO drivers */ - public static function getAvailableDrivers() { + public static function getAvailableDrivers() + { return PDO::getAvailableDrivers(); } /** @@ -457,7 +482,8 @@ class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Inte * @param mixed $value * @return boolean */ - public function setAttribute($attribute, $value) { + public function setAttribute($attribute, $value) + { $this->connect(); $this->dbh->setAttribute($attribute, $value); @@ -467,7 +493,8 @@ class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Inte * * @return ArrayIterator */ - public function getIterator() { + public function getIterator() + { if ($this->listener instanceof Doctrine_Db_Profiler) return $this->listener; } @@ -477,7 +504,8 @@ class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Inte * * @return integer */ - public function count() { + public function count() + { return $this->querySequence; } } diff --git a/lib/Doctrine/Db/Event.php b/lib/Doctrine/Db/Event.php index 3f615b0bb..8ca5c1bda 100644 --- a/lib/Doctrine/Db/Event.php +++ b/lib/Doctrine/Db/Event.php @@ -29,7 +29,8 @@ * @since 1.0 * @version $Revision$ */ -class Doctrine_Db_Event { +class Doctrine_Db_Event +{ const QUERY = 1; const EXEC = 2; const EXECUTE = 3; @@ -47,28 +48,35 @@ class Doctrine_Db_Event { protected $endedMicrotime; - public function __construct($invoker, $type, $query = null) { + public function __construct($invoker, $type, $query = null) + { $this->invoker = $invoker; $this->type = $type; $this->query = $query; } - public function getQuery() { + public function getQuery() + { return $this->query; } - public function getType() { + public function getType() + { return $this->type; } - public function start() { + public function start() + { $this->startedMicrotime = microtime(true); } - public function hasEnded() { + public function hasEnded() + { return ($this->endedMicrotime != null); } - public function end() { + public function end() + { $this->endedMicrotime = microtime(true); } - public function getInvoker() { + public function getInvoker() + { return $this->invoker; } /** @@ -77,7 +85,8 @@ class Doctrine_Db_Event { * * @return mixed */ - public function getElapsedSecs() { + public function getElapsedSecs() + { if (is_null($this->endedMicrotime)) { return false; } diff --git a/lib/Doctrine/Db/EventListener.php b/lib/Doctrine/Db/EventListener.php index c9dc4daea..a340919a6 100644 --- a/lib/Doctrine/Db/EventListener.php +++ b/lib/Doctrine/Db/EventListener.php @@ -21,33 +21,48 @@ /** * Doctrine_Db_EventListener * - * @author Konsta Vesterinen - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @package Doctrine - * @category Object Relational Mapping - * @link www.phpdoctrine.com - * @since 1.0 - * @version $Revision$ - */ -class Doctrine_Db_EventListener implements Doctrine_Db_EventListener_Interface { - public function onPreQuery(Doctrine_Db_Event $event) { } - public function onQuery(Doctrine_Db_Event $event) { } + * @author Konsta Vesterinen + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @package Doctrine + * @category Object Relational Mapping + * @link www.phpdoctrine.com + * @since 1.0 + * @version $Revision$ + */ +class Doctrine_Db_EventListener implements Doctrine_Db_EventListener_Interface +{ + public function onPreQuery(Doctrine_Db_Event $event) + { } + public function onQuery(Doctrine_Db_Event $event) + { } - public function onPrePrepare(Doctrine_Db_Event $event) { } - public function onPrepare(Doctrine_Db_Event $event) { } + public function onPrePrepare(Doctrine_Db_Event $event) + { } + public function onPrepare(Doctrine_Db_Event $event) + { } - public function onPreCommit(Doctrine_Db_Event $event) { } - public function onCommit(Doctrine_Db_Event $event) { } + public function onPreCommit(Doctrine_Db_Event $event) + { } + public function onCommit(Doctrine_Db_Event $event) + { } - public function onPreExec(Doctrine_Db_Event $event) { } - public function onExec(Doctrine_Db_Event $event) { } + public function onPreExec(Doctrine_Db_Event $event) + { } + public function onExec(Doctrine_Db_Event $event) + { } - public function onPreRollBack(Doctrine_Db_Event $event) { } - public function onRollBack(Doctrine_Db_Event $event) { } + public function onPreRollBack(Doctrine_Db_Event $event) + { } + public function onRollBack(Doctrine_Db_Event $event) + { } - public function onPreBeginTransaction(Doctrine_Db_Event $event) { } - public function onBeginTransaction(Doctrine_Db_Event $event) { } + public function onPreBeginTransaction(Doctrine_Db_Event $event) + { } + public function onBeginTransaction(Doctrine_Db_Event $event) + { } - public function onPreExecute(Doctrine_Db_Event $event) { } - public function onExecute(Doctrine_Db_Event $event) { } + public function onPreExecute(Doctrine_Db_Event $event) + { } + public function onExecute(Doctrine_Db_Event $event) + { } } diff --git a/lib/Doctrine/Db/EventListener/Chain.php b/lib/Doctrine/Db/EventListener/Chain.php index c0fea9d44..896614e44 100644 --- a/lib/Doctrine/Db/EventListener/Chain.php +++ b/lib/Doctrine/Db/EventListener/Chain.php @@ -31,10 +31,12 @@ Doctrine::autoload('Doctrine_Access'); * @since 1.0 * @version $Revision$ */ -class Doctrine_Db_EventListener_Chain extends Doctrine_Access implements Doctrine_Db_EventListener_Interface { +class Doctrine_Db_EventListener_Chain extends Doctrine_Access implements Doctrine_Db_EventListener_Interface +{ private $listeners = array(); - public function add($listener, $name = null) { + public function add($listener, $name = null) + { if ( ! ($listener instanceof Doctrine_Db_EventListener_Interface) && ! ($listener instanceof Doctrine_Overloadable) ) { @@ -47,14 +49,16 @@ class Doctrine_Db_EventListener_Chain extends Doctrine_Access implements Doctrin } } - public function get($name) { + public function get($name) + { if ( ! isset($this->listeners[$name])) { throw new Doctrine_Db_Exception("Unknown listener $name"); } return $this->listeners[$name]; } - public function set($name, $listener) { + public function set($name, $listener) + { if ( ! ($listener instanceof Doctrine_Db_EventListener_Interface) && ! ($listener instanceof Doctrine_Overloadable) ) { @@ -63,78 +67,92 @@ class Doctrine_Db_EventListener_Chain extends Doctrine_Access implements Doctrin $this->listeners[$name] = $listener; } - public function onQuery(Doctrine_Db_Event $event) { + public function onQuery(Doctrine_Db_Event $event) + { foreach ($this->listeners as $listener) { $listener->onQuery($event); } } - public function onPreQuery(Doctrine_Db_Event $event) { + public function onPreQuery(Doctrine_Db_Event $event) + { foreach ($this->listeners as $listener) { $listener->onPreQuery($event); } } - public function onPreExec(Doctrine_Db_Event $event) { + public function onPreExec(Doctrine_Db_Event $event) + { foreach ($this->listeners as $listener) { $listener->onPreExec($event); } } - public function onExec(Doctrine_Db_Event $event) { + public function onExec(Doctrine_Db_Event $event) + { foreach ($this->listeners as $listener) { $listener->onExec($event); } } - public function onPrePrepare(Doctrine_Db_Event $event) { + public function onPrePrepare(Doctrine_Db_Event $event) + { foreach ($this->listeners as $listener) { $listener->onPrePrepare($event); } } - public function onPrepare(Doctrine_Db_Event $event) { + public function onPrepare(Doctrine_Db_Event $event) + { foreach ($this->listeners as $listener) { $listener->onPrepare($event); } } - public function onPreCommit(Doctrine_Db_Event $event) { + public function onPreCommit(Doctrine_Db_Event $event) + { foreach ($this->listeners as $listener) { $listener->onPreCommit($event); } } - public function onCommit(Doctrine_Db_Event $event) { + public function onCommit(Doctrine_Db_Event $event) + { foreach ($this->listeners as $listener) { $listener->onCommit($event); } } - public function onPreRollBack(Doctrine_Db_Event $event) { + public function onPreRollBack(Doctrine_Db_Event $event) + { foreach ($this->listeners as $listener) { $listener->onPreRollBack($event); } } - public function onRollBack(Doctrine_Db_Event $event) { + public function onRollBack(Doctrine_Db_Event $event) + { foreach ($this->listeners as $listener) { $listener->onRollBack($event); } } - public function onPreBeginTransaction(Doctrine_Db_Event $event) { + public function onPreBeginTransaction(Doctrine_Db_Event $event) + { foreach ($this->listeners as $listener) { $listener->onPreBeginTransaction($event); } } - public function onBeginTransaction(Doctrine_Db_Event $event) { + public function onBeginTransaction(Doctrine_Db_Event $event) + { foreach ($this->listeners as $listener) { $listener->onBeginTransaction($event); } } - public function onPreExecute(Doctrine_Db_Event $event) { + public function onPreExecute(Doctrine_Db_Event $event) + { foreach ($this->listeners as $listener) { $listener->onPreExecute($event); } } - public function onExecute(Doctrine_Db_Event $event) { + public function onExecute(Doctrine_Db_Event $event) + { foreach ($this->listeners as $listener) { $listener->onExecute($event); } diff --git a/lib/Doctrine/Db/Exception.php b/lib/Doctrine/Db/Exception.php index e7f84bfd4..54fa3984d 100644 --- a/lib/Doctrine/Db/Exception.php +++ b/lib/Doctrine/Db/Exception.php @@ -30,6 +30,7 @@ * @since 1.0 * @version $Revision$ */ -class Doctrine_Db_Exception extends Doctrine_Exception { +class Doctrine_Db_Exception extends Doctrine_Exception +{ } diff --git a/lib/Doctrine/Db/Mock.php b/lib/Doctrine/Db/Mock.php index 6a0b499bc..84f9e2dd9 100644 --- a/lib/Doctrine/Db/Mock.php +++ b/lib/Doctrine/Db/Mock.php @@ -29,7 +29,8 @@ Doctrine::autoload('Doctrine_Db'); * @link www.phpdoctrine.com * @since 1.0 */ -class Doctrine_Db_Mock extends Doctrine_Db { +class Doctrine_Db_Mock extends Doctrine_Db +{ protected static $errorCodeMap = array( 1004 => Doctrine::ERR_CANNOT_CREATE, 1005 => Doctrine::ERR_CANNOT_CREATE, diff --git a/lib/Doctrine/Db/Profiler.php b/lib/Doctrine/Db/Profiler.php index d81a68224..8a99d5c7f 100644 --- a/lib/Doctrine/Db/Profiler.php +++ b/lib/Doctrine/Db/Profiler.php @@ -30,7 +30,8 @@ Doctrine::autoload('Doctrine_Overloadable'); * @since 1.0 * @version $Revision$ */ -class Doctrine_Db_Profiler implements Doctrine_Overloadable { +class Doctrine_Db_Profiler implements Doctrine_Overloadable +{ /** * @param array $listeners an array containing all availible listeners */ @@ -56,7 +57,8 @@ class Doctrine_Db_Profiler implements Doctrine_Overloadable { * @see Doctrine_Db_EventListener * @return void */ - public function __call($m, $a) { + public function __call($m, $a) + { // first argument should be an instance of Doctrine_Db_Event if ( ! ($a[0] instanceof Doctrine_Db_Event)) { throw new Doctrine_Db_Profiler_Exception("Couldn't listen event. Event should be an instance of Doctrine_Db_Event."); @@ -83,7 +85,8 @@ class Doctrine_Db_Profiler implements Doctrine_Overloadable { * * @return Doctrine_Db_Event */ - public function lastEvent() { + public function lastEvent() + { if (empty($this->events)) { return false; } diff --git a/lib/Doctrine/Db/Profiler/Exception.php b/lib/Doctrine/Db/Profiler/Exception.php index 081a1e9c8..bd3d0b0ef 100644 --- a/lib/Doctrine/Db/Profiler/Exception.php +++ b/lib/Doctrine/Db/Profiler/Exception.php @@ -22,12 +22,13 @@ Doctrine::autoload('Doctrine_Db_Exception'); /** * Doctrine_Db_Exception * - * @author Konsta Vesterinen - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @package Doctrine - * @category Object Relational Mapping - * @link www.phpdoctrine.com - * @since 1.0 - * @version $Revision$ - */ -class Doctrine_Db_Profiler_Exception extends Doctrine_Db_Exception { } + * @author Konsta Vesterinen + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @package Doctrine + * @category Object Relational Mapping + * @link www.phpdoctrine.com + * @since 1.0 + * @version $Revision$ + */ +class Doctrine_Db_Profiler_Exception extends Doctrine_Db_Exception +{ } diff --git a/lib/Doctrine/Db/Profiler/Query.php b/lib/Doctrine/Db/Profiler/Query.php index 52ac469b9..85add369a 100644 --- a/lib/Doctrine/Db/Profiler/Query.php +++ b/lib/Doctrine/Db/Profiler/Query.php @@ -29,7 +29,8 @@ * @since 1.0 * @version $Revision$ */ -class Doctrine_Db_Profiler_Query { +class Doctrine_Db_Profiler_Query +{ /** * @var string SQL query string or user comment, set by $query argument in constructor. */ @@ -60,7 +61,8 @@ class Doctrine_Db_Profiler_Query { * @param string $query * @param int $queryType */ - public function __construct($query, $prepareTime = null) { + public function __construct($query, $prepareTime = null) + { $this->query = $query; if ($prepareTime !== null) { $this->prepareTime = $prepareTime; @@ -68,7 +70,8 @@ class Doctrine_Db_Profiler_Query { $this->startedMicrotime = microtime(true); } } - public function start() { + public function start() + { $this->startedMicrotime = microtime(true); } /** @@ -76,12 +79,14 @@ class Doctrine_Db_Profiler_Query { * * @return bool */ - public function end() { + public function end() + { $this->endedMicrotime = microtime(true); return true; } - public function getPrepareTime() { + public function getPrepareTime() + { return $this->prepareTime; } @@ -90,7 +95,8 @@ class Doctrine_Db_Profiler_Query { * * @return bool */ - public function hasEnded() { + public function hasEnded() + { return ($this->endedMicrotime != null); } @@ -99,7 +105,8 @@ class Doctrine_Db_Profiler_Query { * * @return string */ - public function getQuery() { + public function getQuery() + { return $this->query; } @@ -108,7 +115,8 @@ class Doctrine_Db_Profiler_Query { * * @return int */ - public function getQueryType() { + public function getQueryType() + { return $this->queryType; } /** @@ -117,7 +125,8 @@ class Doctrine_Db_Profiler_Query { * * @return mixed */ - public function getElapsedSecs() { + public function getElapsedSecs() + { if (is_null($this->endedMicrotime) && ! $this->prepareTime) { return false; } diff --git a/lib/Doctrine/Db/Statement.php b/lib/Doctrine/Db/Statement.php index 3e11b000b..7be13f908 100644 --- a/lib/Doctrine/Db/Statement.php +++ b/lib/Doctrine/Db/Statement.php @@ -29,7 +29,8 @@ * @since 1.0 * @version $Revision$ */ -class Doctrine_Db_Statement extends PDOStatement { +class Doctrine_Db_Statement extends PDOStatement +{ protected $dbh; protected $querySequence; @@ -38,28 +39,34 @@ class Doctrine_Db_Statement extends PDOStatement { protected $executed = false; - protected function __construct($dbh) { + protected function __construct($dbh) + { $this->dbh = $dbh; $this->baseSequence = $this->querySequence = $this->dbh->getQuerySequence(); } - public function getQuerySequence() { + public function getQuerySequence() + { return $this->querySequence; } - public function getBaseSequence() { + public function getBaseSequence() + { return $this->baseSequence; } - public function getQuery() { + public function getQuery() + { return $this->queryString; } - public function isExecuted($executed = null) { + public function isExecuted($executed = null) + { if ($executed === null) return $this->executed; $this->executed = (bool) $executed; } - public function execute(array $params = null) { + public function execute(array $params = null) + { $event = new Doctrine_Db_Event($this, Doctrine_Db_Event::EXECUTE, $this->queryString); $this->dbh->getListener()->onPreExecute($event); diff --git a/lib/Doctrine/EventListener.php b/lib/Doctrine/EventListener.php index d0afbc47b..0b41066e0 100644 --- a/lib/Doctrine/EventListener.php +++ b/lib/Doctrine/EventListener.php @@ -32,54 +32,84 @@ Doctrine::autoload('Doctrine_EventListener_Interface'); * @since 1.0 * @version $Revision$ */ -class Doctrine_EventListener implements Doctrine_EventListener_Interface { +class Doctrine_EventListener implements Doctrine_EventListener_Interface +{ - public function onLoad(Doctrine_Record $record) { } - public function onPreLoad(Doctrine_Record $record) { } + public function onLoad(Doctrine_Record $record) + { } + public function onPreLoad(Doctrine_Record $record) + { } - public function onSleep(Doctrine_Record $record) { } + public function onSleep(Doctrine_Record $record) + { } - public function onWakeUp(Doctrine_Record $record) { } + public function onWakeUp(Doctrine_Record $record) + { } - public function onUpdate(Doctrine_Record $record) { } - public function onPreUpdate(Doctrine_Record $record) { } + public function onUpdate(Doctrine_Record $record) + { } + public function onPreUpdate(Doctrine_Record $record) + { } - public function onCreate(Doctrine_Record $record) { } - public function onPreCreate(Doctrine_Record $record) { } + public function onCreate(Doctrine_Record $record) + { } + public function onPreCreate(Doctrine_Record $record) + { } - public function onSave(Doctrine_Record $record) { } - public function onPreSave(Doctrine_Record $record) { } + public function onSave(Doctrine_Record $record) + { } + public function onPreSave(Doctrine_Record $record) + { } - public function onGetProperty(Doctrine_Record $record, $property, $value) { + public function onGetProperty(Doctrine_Record $record, $property, $value) + { return $value; } - public function onSetProperty(Doctrine_Record $record, $property, $value) { + public function onSetProperty(Doctrine_Record $record, $property, $value) + { return $value; } - public function onInsert(Doctrine_Record $record) { } - public function onPreInsert(Doctrine_Record $record) { } + public function onInsert(Doctrine_Record $record) + { } + public function onPreInsert(Doctrine_Record $record) + { } - public function onDelete(Doctrine_Record $record) { } - public function onPreDelete(Doctrine_Record $record) { } + public function onDelete(Doctrine_Record $record) + { } + public function onPreDelete(Doctrine_Record $record) + { } - public function onEvict(Doctrine_Record $record) { } - public function onPreEvict(Doctrine_Record $record) { } + public function onEvict(Doctrine_Record $record) + { } + public function onPreEvict(Doctrine_Record $record) + { } - public function onClose(Doctrine_Connection $connection) { } - public function onPreClose(Doctrine_Connection $connection) { } + public function onClose(Doctrine_Connection $connection) + { } + public function onPreClose(Doctrine_Connection $connection) + { } - public function onOpen(Doctrine_Connection $connection) { } + public function onOpen(Doctrine_Connection $connection) + { } - public function onTransactionCommit(Doctrine_Connection $connection) { } - public function onPreTransactionCommit(Doctrine_Connection $connection) { } + public function onTransactionCommit(Doctrine_Connection $connection) + { } + public function onPreTransactionCommit(Doctrine_Connection $connection) + { } - public function onTransactionRollback(Doctrine_Connection $connection) { } - public function onPreTransactionRollback(Doctrine_Connection $connection) { } + public function onTransactionRollback(Doctrine_Connection $connection) + { } + public function onPreTransactionRollback(Doctrine_Connection $connection) + { } - public function onTransactionBegin(Doctrine_Connection $connection) { } - public function onPreTransactionBegin(Doctrine_Connection $connection) { } + public function onTransactionBegin(Doctrine_Connection $connection) + { } + public function onPreTransactionBegin(Doctrine_Connection $connection) + { } - public function onCollectionDelete(Doctrine_Collection $collection) { } - public function onPreCollectionDelete(Doctrine_Collection $collection) { } + public function onCollectionDelete(Doctrine_Collection $collection) + { } + public function onPreCollectionDelete(Doctrine_Collection $collection) + { } } diff --git a/lib/Doctrine/EventListener/AccessorInvoker.php b/lib/Doctrine/EventListener/AccessorInvoker.php index f36ae72e5..cc892e690 100644 --- a/lib/Doctrine/EventListener/AccessorInvoker.php +++ b/lib/Doctrine/EventListener/AccessorInvoker.php @@ -22,15 +22,16 @@ Doctrine::autoload('Doctrine_EventListener'); /** * Doctrine_EventListener_AccessorInvoker * - * @author Konsta Vesterinen - * @package Doctrine - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @category Object Relational Mapping - * @link www.phpdoctrine.com - * @since 1.0 - * @version $Revision$ - */ -class Doctrine_EventListener_AccessorInvoker extends Doctrine_EventListener { + * @author Konsta Vesterinen + * @package Doctrine + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @category Object Relational Mapping + * @link www.phpdoctrine.com + * @since 1.0 + * @version $Revision$ + */ +class Doctrine_EventListener_AccessorInvoker extends Doctrine_EventListener +{ /** * @var boolean $lockGetCall a simple variable to prevent recursion */ @@ -47,7 +48,8 @@ class Doctrine_EventListener_AccessorInvoker extends Doctrine_EventListener { * @param mixed $value * @return mixed */ - public function onGetProperty(Doctrine_Record $record, $property, $value) { + public function onGetProperty(Doctrine_Record $record, $property, $value) + { $method = 'get' . ucwords($property); if (method_exists($record, $method) && ! $this->lockGetCall) { @@ -67,7 +69,8 @@ class Doctrine_EventListener_AccessorInvoker extends Doctrine_EventListener { * @param mixed $value * @return mixed */ - public function onSetProperty(Doctrine_Record $record, $property, $value) { + public function onSetProperty(Doctrine_Record $record, $property, $value) + { $method = 'set' . ucwords($property); if (method_exists($record, $method) && ! $this->lockSetCall) { diff --git a/lib/Doctrine/EventListener/Chain.php b/lib/Doctrine/EventListener/Chain.php index 1888d7202..6c864722d 100644 --- a/lib/Doctrine/EventListener/Chain.php +++ b/lib/Doctrine/EventListener/Chain.php @@ -33,7 +33,8 @@ Doctrine::autoload('Doctrine_Access'); * @since 1.0 * @version $Revision$ */ -class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_EventListener_Interface { +class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_EventListener_Interface +{ /** * @var array $listeners an array containing all listeners */ @@ -44,7 +45,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param Doctrine_EventListener $listener * @return void */ - public function add(Doctrine_EventListener $listener) { + public function add(Doctrine_EventListener $listener) + { $this->listeners[] = $listener; } /** @@ -54,7 +56,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param mixed $key * @return mixed */ - public function get($key) { + public function get($key) + { if ( ! isset($this->listeners[$key])) { return null; } @@ -67,7 +70,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param Doctrine_EventListener $listener * @return void */ - public function set($key, Doctrine_EventListener $listener) { + public function set($key, Doctrine_EventListener $listener) + { $this->listeners[$key] = $listener; } /** @@ -77,7 +81,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param Doctrine_Record $record * @return void */ - public function onLoad(Doctrine_Record $record) { + public function onLoad(Doctrine_Record $record) + { foreach ($this->listeners as $listener) { $listener->onLoad($record); } @@ -90,7 +95,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param Doctrine_Record $record * @return void */ - public function onPreLoad(Doctrine_Record $record) { + public function onPreLoad(Doctrine_Record $record) + { foreach ($this->listeners as $listener) { $listener->onPreLoad($record); } @@ -102,7 +108,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param Doctrine_Record $record * @return void */ - public function onSleep(Doctrine_Record $record) { + public function onSleep(Doctrine_Record $record) + { foreach ($this->listeners as $listener) { $listener->onSleep($record); } @@ -114,7 +121,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param Doctrine_Record $record * @return void */ - public function onWakeUp(Doctrine_Record $record) { + public function onWakeUp(Doctrine_Record $record) + { foreach ($this->listeners as $listener) { $listener->onWakeUp($record); } @@ -126,7 +134,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param Doctrine_Record $record * @return void */ - public function onUpdate(Doctrine_Record $record) { + public function onUpdate(Doctrine_Record $record) + { foreach ($this->listeners as $listener) { $listener->onUpdate($record); } @@ -138,7 +147,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param Doctrine_Record $record * @return void */ - public function onPreUpdate(Doctrine_Record $record) { + public function onPreUpdate(Doctrine_Record $record) + { foreach ($this->listeners as $listener) { $listener->onPreUpdate($record); } @@ -150,7 +160,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param Doctrine_Record $record * @return void */ - public function onCreate(Doctrine_Record $record) { + public function onCreate(Doctrine_Record $record) + { foreach ($this->listeners as $listener) { $listener->onCreate($record); } @@ -163,7 +174,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param Doctrine_Record $record * @return void */ - public function onPreCreate(Doctrine_Record $record) { + public function onPreCreate(Doctrine_Record $record) + { foreach ($this->listeners as $listener) { $listener->onPreCreate($record); } @@ -175,7 +187,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param Doctrine_Record $record * @return void */ - public function onSave(Doctrine_Record $record) { + public function onSave(Doctrine_Record $record) + { foreach ($this->listeners as $listener) { $listener->onSave($record); } @@ -187,7 +200,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param Doctrine_Record $record * @return void */ - public function onPreSave(Doctrine_Record $record) { + public function onPreSave(Doctrine_Record $record) + { foreach ($this->listeners as $listener) { $listener->onPreSave($record); } @@ -201,7 +215,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param mixed $value * @return mixed */ - public function onGetProperty(Doctrine_Record $record, $property, $value) { + public function onGetProperty(Doctrine_Record $record, $property, $value) + { foreach ($this->listeners as $listener) { $value = $listener->onGetProperty($record, $property, $value); } @@ -216,7 +231,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param mixed $value * @return mixed */ - public function onSetProperty(Doctrine_Record $record, $property, $value) { + public function onSetProperty(Doctrine_Record $record, $property, $value) + { foreach ($this->listeners as $listener) { $value = $listener->onSetProperty($record, $property, $value); } @@ -229,7 +245,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param Doctrine_Record $record * @return void */ - public function onInsert(Doctrine_Record $record) { + public function onInsert(Doctrine_Record $record) + { foreach ($this->listeners as $listener) { $listener->onInsert($record); } @@ -241,7 +258,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param Doctrine_Record $record * @return void */ - public function onPreInsert(Doctrine_Record $record) { + public function onPreInsert(Doctrine_Record $record) + { foreach ($this->listeners as $listener) { $listener->onPreInsert($record); } @@ -253,7 +271,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param Doctrine_Record $record * @return void */ - public function onDelete(Doctrine_Record $record) { + public function onDelete(Doctrine_Record $record) + { foreach ($this->listeners as $listener) { $listener->onDelete($record); } @@ -265,7 +284,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param Doctrine_Record $record * @return void */ - public function onPreDelete(Doctrine_Record $record) { + public function onPreDelete(Doctrine_Record $record) + { foreach ($this->listeners as $listener) { $listener->onPreDelete($record); } @@ -277,7 +297,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param Doctrine_Record $record * @return void */ - public function onEvict(Doctrine_Record $record) { + public function onEvict(Doctrine_Record $record) + { foreach ($this->listeners as $listener) { $listener->onEvict($record); } @@ -289,7 +310,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param Doctrine_Record $record * @return void */ - public function onPreEvict(Doctrine_Record $record) { + public function onPreEvict(Doctrine_Record $record) + { foreach ($this->listeners as $listener) { $listener->onPreEvict($record); } @@ -301,7 +323,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param Doctrine_Connection $connection * @return void */ - public function onClose(Doctrine_Connection $connection) { + public function onClose(Doctrine_Connection $connection) + { foreach ($this->listeners as $listener) { $listener->onClose($connection); } @@ -313,7 +336,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param Doctrine_Connection $connection * @return void */ - public function onPreClose(Doctrine_Connection $connection) { + public function onPreClose(Doctrine_Connection $connection) + { foreach ($this->listeners as $listener) { $listener->onPreClose($connection); } @@ -325,7 +349,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param Doctrine_Connection $connection * @return void */ - public function onOpen(Doctrine_Connection $connection) { + public function onOpen(Doctrine_Connection $connection) + { foreach ($this->listeners as $listener) { $listener->onOpen($connection); } @@ -337,7 +362,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param Doctrine_Connection $connection * @return void */ - public function onTransactionCommit(Doctrine_Connection $connection) { + public function onTransactionCommit(Doctrine_Connection $connection) + { foreach ($this->listeners as $listener) { $listener->onTransactionCommit($connection); } @@ -349,7 +375,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param Doctrine_Connection $connection * @return void */ - public function onPreTransactionCommit(Doctrine_Connection $connection) { + public function onPreTransactionCommit(Doctrine_Connection $connection) + { foreach ($this->listeners as $listener) { $listener->onPreTransactionCommit($connection); } @@ -361,7 +388,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param Doctrine_Connection $connection * @return void */ - public function onTransactionRollback(Doctrine_Connection $connection) { + public function onTransactionRollback(Doctrine_Connection $connection) + { foreach ($this->listeners as $listener) { $listener->onTransactionRollback($connection); } @@ -373,7 +401,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param Doctrine_Connection $connection * @return void */ - public function onPreTransactionRollback(Doctrine_Connection $connection) { + public function onPreTransactionRollback(Doctrine_Connection $connection) + { foreach ($this->listeners as $listener) { $listener->onPreTransactionRollback($connection); } @@ -385,7 +414,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param Doctrine_Connection $connection * @return void */ - public function onTransactionBegin(Doctrine_Connection $connection) { + public function onTransactionBegin(Doctrine_Connection $connection) + { foreach ($this->listeners as $listener) { $listener->onTransactionBegin($connection); } @@ -397,7 +427,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param Doctrine_Connection $connection * @return void */ - public function onPreTransactionBegin(Doctrine_Connection $connection) { + public function onPreTransactionBegin(Doctrine_Connection $connection) + { foreach ($this->listeners as $listener) { $listener->onPreTransactionBegin($connection); } @@ -409,7 +440,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param Doctrine_Collection $collection * @return void */ - public function onCollectionDelete(Doctrine_Collection $collection) { + public function onCollectionDelete(Doctrine_Collection $collection) + { foreach ($this->listeners as $listener) { $listener->onCollectionDelete($record); } @@ -421,7 +453,8 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E * @param Doctrine_Collection $collection * @return void */ - public function onPreCollectionDelete(Doctrine_Collection $collection) { + public function onPreCollectionDelete(Doctrine_Collection $collection) + { foreach ($this->listeners as $listener) { $listener->onPreCollectionDelete($collection); } diff --git a/lib/Doctrine/EventListener/Debugger.php b/lib/Doctrine/EventListener/Debugger.php index 522622291..6cdeb855f 100644 --- a/lib/Doctrine/EventListener/Debugger.php +++ b/lib/Doctrine/EventListener/Debugger.php @@ -1,21 +1,26 @@ object = $object; $this->code = $code; } - final public function getCode() { + final public function getCode() + { return $this->code; } - final public function getObject() { + final public function getObject() + { return $this->object; } } -class Doctrine_EventListener_Debugger extends Doctrine_EventListener { +class Doctrine_EventListener_Debugger extends Doctrine_EventListener +{ const EVENT_LOAD = 1; const EVENT_PRELOAD = 2; @@ -48,103 +53,131 @@ class Doctrine_EventListener_Debugger extends Doctrine_EventListener { const EVENT_PRECOLLDELETE = 27; private $debug; - public function getMessages() { + public function getMessages() + { return $this->debug; } - public function onLoad(Doctrine_Record $record) { + public function onLoad(Doctrine_Record $record) + { $this->debug[] = new Doctrine_DebugMessage($record,self::EVENT_LOAD); } - public function onPreLoad(Doctrine_Record $record) { + public function onPreLoad(Doctrine_Record $record) + { $this->debug[] = new Doctrine_DebugMessage($record,self::EVENT_PRELOAD); } - public function onSleep(Doctrine_Record $record) { + public function onSleep(Doctrine_Record $record) + { $this->debug[] = new Doctrine_DebugMessage($record,self::EVENT_SLEEP); } - public function onWakeUp(Doctrine_Record $record) { + public function onWakeUp(Doctrine_Record $record) + { $this->debug[] = new Doctrine_DebugMessage($record,self::EVENT_WAKEUP); } - public function onUpdate(Doctrine_Record $record) { + public function onUpdate(Doctrine_Record $record) + { $this->debug[] = new Doctrine_DebugMessage($record,self::EVENT_UPDATE); } - public function onPreUpdate(Doctrine_Record $record) { + public function onPreUpdate(Doctrine_Record $record) + { $this->debug[] = new Doctrine_DebugMessage($record,self::EVENT_PREUPDATE); } - public function onCreate(Doctrine_Record $record) { + public function onCreate(Doctrine_Record $record) + { $this->debug[] = new Doctrine_DebugMessage($record,self::EVENT_CREATE); } - public function onPreCreate(Doctrine_Record $record) { + public function onPreCreate(Doctrine_Record $record) + { $this->debug[] = new Doctrine_DebugMessage($record,self::EVENT_PRECREATE); } - public function onSave(Doctrine_Record $record) { + public function onSave(Doctrine_Record $record) + { $this->debug[] = new Doctrine_DebugMessage($record,self::EVENT_SAVE); } - public function onPreSave(Doctrine_Record $record) { + public function onPreSave(Doctrine_Record $record) + { $this->debug[] = new Doctrine_DebugMessage($record,self::EVENT_PRESAVE); } - public function onInsert(Doctrine_Record $record) { + public function onInsert(Doctrine_Record $record) + { $this->debug[] = new Doctrine_DebugMessage($record,self::EVENT_INSERT); } - public function onPreInsert(Doctrine_Record $record) { + public function onPreInsert(Doctrine_Record $record) + { $this->debug[] = new Doctrine_DebugMessage($record,self::EVENT_PREINSERT); } - public function onDelete(Doctrine_Record $record) { + public function onDelete(Doctrine_Record $record) + { $this->debug[] = new Doctrine_DebugMessage($record,self::EVENT_DELETE); } - public function onPreDelete(Doctrine_Record $record) { + public function onPreDelete(Doctrine_Record $record) + { $this->debug[] = new Doctrine_DebugMessage($record,self::EVENT_PREDELETE); } - public function onEvict(Doctrine_Record $record) { + public function onEvict(Doctrine_Record $record) + { $this->debug[] = new Doctrine_DebugMessage($record,self::EVENT_EVICT); } - public function onPreEvict(Doctrine_Record $record) { + public function onPreEvict(Doctrine_Record $record) + { $this->debug[] = new Doctrine_DebugMessage($record,self::EVENT_PREEVICT); } - public function onClose(Doctrine_Connection $connection) { + public function onClose(Doctrine_Connection $connection) + { $this->debug[] = new Doctrine_DebugMessage($connection,self::EVENT_CLOSE); } - public function onPreClose(Doctrine_Connection $connection) { + public function onPreClose(Doctrine_Connection $connection) + { $this->debug[] = new Doctrine_DebugMessage($connection,self::EVENT_PRECLOSE); } - public function onOpen(Doctrine_Connection $connection) { + public function onOpen(Doctrine_Connection $connection) + { $this->debug[] = new Doctrine_DebugMessage($connection,self::EVENT_OPEN); } - public function onTransactionCommit(Doctrine_Connection $connection) { + public function onTransactionCommit(Doctrine_Connection $connection) + { $this->debug[] = new Doctrine_DebugMessage($connection,self::EVENT_COMMIT); } - public function onPreTransactionCommit(Doctrine_Connection $connection) { + public function onPreTransactionCommit(Doctrine_Connection $connection) + { $this->debug[] = new Doctrine_DebugMessage($connection,self::EVENT_PRECOMMIT); } - public function onTransactionRollback(Doctrine_Connection $connection) { + public function onTransactionRollback(Doctrine_Connection $connection) + { $this->debug[] = new Doctrine_DebugMessage($connection,self::EVENT_ROLLBACK); } - public function onPreTransactionRollback(Doctrine_Connection $connection) { + public function onPreTransactionRollback(Doctrine_Connection $connection) + { $this->debug[] = new Doctrine_DebugMessage($connection,self::EVENT_PREROLLBACK); } - public function onTransactionBegin(Doctrine_Connection $connection) { + public function onTransactionBegin(Doctrine_Connection $connection) + { $this->debug[] = new Doctrine_DebugMessage($connection,self::EVENT_BEGIN); } - public function onPreTransactionBegin(Doctrine_Connection $connection) { + public function onPreTransactionBegin(Doctrine_Connection $connection) + { $this->debug[] = new Doctrine_DebugMessage($connection,self::EVENT_PREBEGIN); } - public function onCollectionDelete(Doctrine_Collection $collection) { + public function onCollectionDelete(Doctrine_Collection $collection) + { $this->debug[] = new Doctrine_DebugMessage($collection,self::EVENT_COLLDELETE); } - public function onPreCollectionDelete(Doctrine_Collection $collection) { + public function onPreCollectionDelete(Doctrine_Collection $collection) + { $this->debug[] = new Doctrine_DebugMessage($collection,self::EVENT_PRECOLLDELETE); } } diff --git a/lib/Doctrine/EventListener/Empty.php b/lib/Doctrine/EventListener/Empty.php index 626822666..7c6f11342 100644 --- a/lib/Doctrine/EventListener/Empty.php +++ b/lib/Doctrine/EventListener/Empty.php @@ -9,4 +9,5 @@ * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_EventListener_Empty extends Doctrine_EventListener { } +class Doctrine_EventListener_Empty extends Doctrine_EventListener +{ } diff --git a/lib/Doctrine/Exception.php b/lib/Doctrine/Exception.php index 342f8ecc1..82def6b0f 100644 --- a/lib/Doctrine/Exception.php +++ b/lib/Doctrine/Exception.php @@ -29,4 +29,5 @@ * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Exception extends Exception { } +class Doctrine_Exception extends Exception +{ } diff --git a/lib/Doctrine/Export.php b/lib/Doctrine/Export.php index 0d62ad75b..38d5e9e1f 100644 --- a/lib/Doctrine/Export.php +++ b/lib/Doctrine/Export.php @@ -31,7 +31,8 @@ Doctrine::autoload('Doctrine_Connection_Module'); * @since 1.0 * @version $Revision$ */ -class Doctrine_Export extends Doctrine_Connection_Module { +class Doctrine_Export extends Doctrine_Connection_Module +{ /** * drop an existing database * (this method is implemented by the drivers) @@ -39,7 +40,8 @@ class Doctrine_Export extends Doctrine_Connection_Module { * @param string $name name of the database that should be dropped * @return void */ - public function dropDatabase($database) { + public function dropDatabase($database) + { throw new Doctrine_Export_Exception('Drop database not supported by this driver.'); } /** @@ -50,7 +52,8 @@ class Doctrine_Export extends Doctrine_Connection_Module { * @throws PDOException * @return void */ - public function dropTable($table) { + public function dropTable($table) + { $this->conn->execute('DROP TABLE ' . $table); } @@ -61,7 +64,8 @@ class Doctrine_Export extends Doctrine_Connection_Module { * @param string $name name of the index to be dropped * @return void */ - public function dropIndex($table, $name) { + public function dropIndex($table, $name) + { $name = $this->conn->quoteIdentifier($this->conn->getIndexName($name), true); return $this->conn->exec('DROP INDEX ' . $name); } @@ -73,7 +77,8 @@ class Doctrine_Export extends Doctrine_Connection_Module { * @param string $primary hint if the constraint is primary * @return void */ - public function dropConstraint($table, $name, $primary = false) { + public function dropConstraint($table, $name, $primary = false) + { $table = $this->conn->quoteIdentifier($table, true); $name = $this->conn->quoteIdentifier($this->conn->getIndexName($name), true); return $this->conn->exec('ALTER TABLE ' . $table . ' DROP CONSTRAINT ' . $name); @@ -85,7 +90,8 @@ class Doctrine_Export extends Doctrine_Connection_Module { * @param string $seq_name name of the sequence to be dropped * @return void */ - public function dropSequence($name) { + public function dropSequence($name) + { throw new Doctrine_Export_Exception('Drop sequence not supported by this driver.'); } /** @@ -95,7 +101,8 @@ class Doctrine_Export extends Doctrine_Connection_Module { * @param string $name name of the database that should be created * @return void */ - public function createDatabase($database) { + public function createDatabase($database) + { throw new Doctrine_Export_Exception('Create database not supported by this driver.'); } /** @@ -152,7 +159,8 @@ class Doctrine_Export extends Doctrine_Connection_Module { * @param string $start start value of the sequence; default is 1 * @return void */ - public function createSequence($seqName, $seqcolName, $start = 1) { + public function createSequence($seqName, $seqcolName, $start = 1) + { throw new Doctrine_Export_Exception('Create sequence not supported by this driver.'); } @@ -177,7 +185,8 @@ class Doctrine_Export extends Doctrine_Connection_Module { * ) * @return void */ - public function createConstraint($table, $name, $definition) { + public function createConstraint($table, $name, $definition) + { $table = $this->conn->quoteIdentifier($table, true); $name = $this->conn->quoteIdentifier($this->conn->getIndexName($name), true); $query = "ALTER TABLE $table ADD CONSTRAINT $name"; @@ -225,7 +234,8 @@ class Doctrine_Export extends Doctrine_Connection_Module { * ) * @return void */ - public function createIndex($table, $name, array $definition) { + public function createIndex($table, $name, array $definition) + { return $this->conn->execute($this->createIndexSql($table, $name, $definition)); } /** @@ -260,7 +270,8 @@ class Doctrine_Export extends Doctrine_Connection_Module { * ) * @return string */ - public function createIndexSql($table, $name, array $definition) { + public function createIndexSql($table, $name, array $definition) + { $table = $this->conn->quoteIdentifier($table); $name = $this->conn->quoteIdentifier($name); @@ -362,7 +373,8 @@ class Doctrine_Export extends Doctrine_Connection_Module { * actually perform them otherwise. * @return void */ - public function alterTable($name, array $changes, $check) { + public function alterTable($name, array $changes, $check) + { $this->conn->execute($this->alterTableSql($name, $changes, $check)); } /** @@ -454,7 +466,8 @@ class Doctrine_Export extends Doctrine_Connection_Module { * actually perform them otherwise. * @return string */ - public function alterTableSql($name, array $changes, $check) { + public function alterTableSql($name, array $changes, $check) + { throw new Doctrine_Export_Exception('Alter table not supported by this driver.'); } /** @@ -484,7 +497,8 @@ class Doctrine_Export extends Doctrine_Connection_Module { * * @return string */ - public function getFieldDeclarationList(array $fields) { + public function getFieldDeclarationList(array $fields) + { foreach ($fields as $fieldName => $field) { $query = $this->getDeclaration($fieldName, $field); @@ -519,7 +533,8 @@ class Doctrine_Export extends Doctrine_Connection_Module { * @return string DBMS specific SQL code portion that should be used to * declare the specified field. */ - public function getDeclaration($name, array $field) { + public function getDeclaration($name, array $field) + { $default = ''; if (isset($field['default'])) { @@ -567,7 +582,8 @@ class Doctrine_Export extends Doctrine_Connection_Module { * @return string DBMS specific SQL code portion needed to set the CHARACTER SET * of a field declaration. */ - public function getCharsetFieldDeclaration($charset) { + public function getCharsetFieldDeclaration($charset) + { return ''; } /** @@ -578,7 +594,8 @@ class Doctrine_Export extends Doctrine_Connection_Module { * @return string DBMS specific SQL code portion needed to set the COLLATION * of a field declaration. */ - public function getCollationFieldDeclaration($collation) { + public function getCollationFieldDeclaration($collation) + { return ''; } /** @@ -587,7 +604,8 @@ class Doctrine_Export extends Doctrine_Connection_Module { * * @return void */ - public static function exportAll() { + public static function exportAll() + { $parent = new ReflectionClass('Doctrine_Record'); $conn = Doctrine_Manager::getInstance()->getCurrentConnection(); $old = $conn->getAttribute(Doctrine::ATTR_CREATE_TABLES); @@ -603,7 +621,8 @@ class Doctrine_Export extends Doctrine_Connection_Module { } $conn->setAttribute(Doctrine::ATTR_CREATE_TABLES, $old); } - public function export($record) { + public function export($record) + { if ( ! $record instanceof Doctrine_Record) $record = new $record(); diff --git a/lib/Doctrine/Export/Exception.php b/lib/Doctrine/Export/Exception.php index f4a76e777..60b4d5856 100644 --- a/lib/Doctrine/Export/Exception.php +++ b/lib/Doctrine/Export/Exception.php @@ -30,4 +30,5 @@ Doctrine::autoload('Doctrine_Exception'); * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Export_Exception extends Doctrine_Exception { } +class Doctrine_Export_Exception extends Doctrine_Exception +{ } diff --git a/lib/Doctrine/Export/Firebird.php b/lib/Doctrine/Export/Firebird.php index f20bf3f82..040f913c5 100644 --- a/lib/Doctrine/Export/Firebird.php +++ b/lib/Doctrine/Export/Firebird.php @@ -32,14 +32,16 @@ Doctrine::autoload('Doctrine_Export'); * @since 1.0 * @version $Revision$ */ -class Doctrine_Export_Firebird extends Doctrine_Export { +class Doctrine_Export_Firebird extends Doctrine_Export +{ /** * create a new database * * @param string $name name of the database that should be created * @return void */ - public function createDatabase($name) { + public function createDatabase($name) + { throw new Doctrine_Export_Firebird_Exception( 'PHP Interbase API does not support direct queries. You have to ' . 'create the db manually by using isql command or a similar program'); @@ -50,7 +52,8 @@ class Doctrine_Export_Firebird extends Doctrine_Export { * @param string $name name of the database that should be dropped * @return void */ - public function dropDatabase($name) { + public function dropDatabase($name) + { throw new Doctrine_Export_Firebird_Exception( 'PHP Interbase API does not support direct queries. You have ' . 'to drop the db manually by using isql command or a similar program'); @@ -63,7 +66,8 @@ class Doctrine_Export_Firebird extends Doctrine_Export { * @param string $start start value for the sequence * @return void */ - public function _makeAutoincrement($name, $table, $start = null) { + public function _makeAutoincrement($name, $table, $start = null) + { if (is_null($start)) { $this->conn->beginTransaction(); $query = 'SELECT MAX(' . $this->conn->quoteIdentifier($name, true) . ') FROM ' . $this->conn->quoteIdentifier($table, true); @@ -101,7 +105,8 @@ class Doctrine_Export_Firebird extends Doctrine_Export { * @param string $table name of the table * @return void */ - public function _dropAutoincrement($table) { + public function _dropAutoincrement($table) + { $result = $this->dropSequence($table); @@ -180,7 +185,8 @@ class Doctrine_Export_Firebird extends Doctrine_Export { * @param string $name name of the database that should be dropped * @return void */ - public function checkSupportedChanges(&$changes) { + public function checkSupportedChanges(&$changes) + { foreach ($changes as $change_name => $change) { switch ($change_name) { case 'notnull': @@ -213,7 +219,8 @@ class Doctrine_Export_Firebird extends Doctrine_Export { * @return mixed MDB2_OK on success, a MDB2 error on failure * @access public */ - public function dropTable($name) { + public function dropTable($name) + { $result = $this->_dropAutoincrement($name); $result = parent::dropTable($name); @@ -309,7 +316,8 @@ class Doctrine_Export_Firebird extends Doctrine_Export { * actually perform them otherwise. * @return void */ - public function alterTable($name, $changes, $check) { + public function alterTable($name, $changes, $check) + { foreach ($changes as $change_name => $change) { switch ($change_name) { case 'add': @@ -416,7 +424,8 @@ class Doctrine_Export_Firebird extends Doctrine_Export { * ) * @return void */ - public function createIndex($table, $name, array $definition) { + public function createIndex($table, $name, array $definition) + { $query = 'CREATE'; $query_sort = ''; @@ -466,7 +475,8 @@ class Doctrine_Export_Firebird extends Doctrine_Export { * ) * @return void */ - public function createConstraint($table, $name, $definition) { + public function createConstraint($table, $name, $definition) + { $table = $this->conn->quoteIdentifier($table, true); if (!empty($name)) { @@ -500,7 +510,8 @@ class Doctrine_Export_Firebird extends Doctrine_Export { * @param string $start start value of the sequence; default is 1 * @return void */ - public function createSequence($seqName, $start = 1) { + public function createSequence($seqName, $start = 1) + { $sequenceName = $this->conn->getSequenceName($seqName); $this->conn->exec('CREATE GENERATOR ' . $sequenceName); @@ -515,7 +526,8 @@ class Doctrine_Export_Firebird extends Doctrine_Export { * @param string $seq_name name of the sequence to be dropped * @return void */ - public function dropSequence($seq_name) { + public function dropSequence($seq_name) + { $sequence_name = $this->conn->getSequenceName($seq_name); $sequence_name = $this->conn->getDbh()->quote($sequence_name); $query = "DELETE FROM RDB\$GENERATORS WHERE UPPER(RDB\$GENERATOR_NAME)=$sequence_name"; diff --git a/lib/Doctrine/Export/Firebird/Exception.php b/lib/Doctrine/Export/Firebird/Exception.php index e98d3fa52..1bab7d805 100644 --- a/lib/Doctrine/Export/Firebird/Exception.php +++ b/lib/Doctrine/Export/Firebird/Exception.php @@ -30,4 +30,5 @@ Doctrine::autoload('Doctrine_Export_Exception'); * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Export_Firebird_Exception extends Doctrine_Export_Exception { } +class Doctrine_Export_Firebird_Exception extends Doctrine_Export_Exception +{ } diff --git a/lib/Doctrine/Export/Mssql.php b/lib/Doctrine/Export/Mssql.php index fa5b82c46..c965d780c 100644 --- a/lib/Doctrine/Export/Mssql.php +++ b/lib/Doctrine/Export/Mssql.php @@ -32,14 +32,16 @@ Doctrine::autoload('Doctrine_Export'); * @since 1.0 * @version $Revision$ */ -class Doctrine_Export_Mssql extends Doctrine_Export { +class Doctrine_Export_Mssql extends Doctrine_Export +{ /** * create a new database * * @param string $name name of the database that should be created * @return void */ - public function createDatabase($name) { + public function createDatabase($name) + { $name = $db->quoteIdentifier($name, true); $query = "CREATE DATABASE $name"; if ($db->options['database_device']) { @@ -55,7 +57,8 @@ class Doctrine_Export_Mssql extends Doctrine_Export { * @param string $name name of the database that should be dropped * @return void */ - public function dropDatabase($name) { + public function dropDatabase($name) + { $name = $db->quoteIdentifier($name, true); return $db->standaloneQuery("DROP DATABASE $name", null, true); } @@ -147,7 +150,8 @@ class Doctrine_Export_Mssql extends Doctrine_Export { * actually perform them otherwise. * @return void */ - public function alterTable($name, $changes, $check) { + public function alterTable($name, $changes, $check) + { foreach ($changes as $change_name => $change) { switch ($change_name) { case 'add': @@ -197,7 +201,8 @@ class Doctrine_Export_Mssql extends Doctrine_Export { * @param string $start start value of the sequence; default is 1 * @return void */ - public function createSequence($seq_name, $start = 1) { + public function createSequence($seq_name, $start = 1) + { $sequence_name = $db->quoteIdentifier($db->getSequenceName($seq_name), true); $seqcol_name = $db->quoteIdentifier($db->options['seqcol_name'], true); $query = "CREATE TABLE $sequence_name ($seqcol_name " . @@ -228,7 +233,8 @@ class Doctrine_Export_Mssql extends Doctrine_Export { * @param string $seqName name of the sequence to be dropped * @return void */ - public function dropSequence($seqName) { + public function dropSequence($seqName) + { $sequenceName = $db->quoteIdentifier($db->getSequenceName($seqName), true); return $this->conn->exec('DROP TABLE ' . $sequenceName); } diff --git a/lib/Doctrine/Export/Mysql.php b/lib/Doctrine/Export/Mysql.php index 24abaec20..e1a07668c 100644 --- a/lib/Doctrine/Export/Mysql.php +++ b/lib/Doctrine/Export/Mysql.php @@ -31,7 +31,8 @@ Doctrine::autoload('Doctrine_Export'); * @since 1.0 * @version $Revision$ */ -class Doctrine_Export_Mysql extends Doctrine_Export { +class Doctrine_Export_Mysql extends Doctrine_Export +{ /** * create a new database * @@ -39,7 +40,8 @@ class Doctrine_Export_Mysql extends Doctrine_Export { * @throws PDOException * @return void */ - public function createDatabase($name) { + public function createDatabase($name) + { $query = 'CREATE DATABASE ' . $this->conn->quoteIdentifier($name, true); $result = $this->conn->exec($query); } @@ -50,7 +52,8 @@ class Doctrine_Export_Mysql extends Doctrine_Export { * @throws PDOException * @access public */ - public function dropDatabase($name) { + public function dropDatabase($name) + { $query = 'DROP DATABASE ' . $this->conn->quoteIdentifier($name); $this->conn->exec($query); } @@ -221,7 +224,8 @@ class Doctrine_Export_Mysql extends Doctrine_Export { * actually perform them otherwise. * @return boolean */ - public function alterTable($name, array $changes, $check) { + public function alterTable($name, array $changes, $check) + { if ( ! $name) throw new Doctrine_Export_Mysql_Exception('no valid table name specified'); @@ -316,7 +320,8 @@ class Doctrine_Export_Mysql extends Doctrine_Export { * @param string $start start value of the sequence; default is 1 * @return boolean */ - public function createSequence($sequenceName, $seqcol_name, $start = 1) { + public function createSequence($sequenceName, $seqcol_name, $start = 1) + { $query = 'CREATE TABLE ' . $sequenceName . ' (' . $seqcol_name . ' INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (' . $seqcol_name . '))' @@ -376,7 +381,8 @@ class Doctrine_Export_Mysql extends Doctrine_Export { * @throws PDOException * @return void */ - public function createIndex($table, $name, array $definition) { + public function createIndex($table, $name, array $definition) + { $table = $table; $name = $this->conn->getIndexName($name); $query = 'CREATE INDEX ' . $name . ' ON ' . $table; @@ -399,7 +405,8 @@ class Doctrine_Export_Mysql extends Doctrine_Export { * @param string $name name of the index to be dropped * @return void */ - public function dropIndex($table, $name) { + public function dropIndex($table, $name) + { $table = $this->conn->quoteIdentifier($table, true); $name = $this->conn->quoteIdentifier($this->conn->getIndexName($name), true); return $this->conn->exec('DROP INDEX ' . $name . ' ON ' . $table); @@ -411,7 +418,8 @@ class Doctrine_Export_Mysql extends Doctrine_Export { * @throws PDOException * @return void */ - public function dropTable($table) { + public function dropTable($table) + { $table = $this->conn->quoteIdentifier($table, true); $this->conn->exec('DROP TABLE ' . $table); } diff --git a/lib/Doctrine/Export/Mysql/Exception.php b/lib/Doctrine/Export/Mysql/Exception.php index ec76c2143..419966d30 100644 --- a/lib/Doctrine/Export/Mysql/Exception.php +++ b/lib/Doctrine/Export/Mysql/Exception.php @@ -30,4 +30,5 @@ Doctrine::autoload('Doctrine_Export_Exception'); * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Export_Mysql_Exception extends Doctrine_Export_Exception { } +class Doctrine_Export_Mysql_Exception extends Doctrine_Export_Exception +{ } diff --git a/lib/Doctrine/Export/Oracle.php b/lib/Doctrine/Export/Oracle.php index fedfba781..a41ce3494 100644 --- a/lib/Doctrine/Export/Oracle.php +++ b/lib/Doctrine/Export/Oracle.php @@ -31,7 +31,8 @@ Doctrine::autoload('Doctrine_Export'); * @since 1.0 * @version $Revision$ */ -class Doctrine_Export_Oracle extends Doctrine_Export { +class Doctrine_Export_Oracle extends Doctrine_Export +{ /** * create a new database * @@ -40,7 +41,7 @@ class Doctrine_Export_Oracle extends Doctrine_Export { * @return mixed MDB2_OK on success, a MDB2 error on failure * @access public */ - public function createDatabase($name) + public function createDatabase($name) { if ( ! $this->conn->getAttribute(Doctrine::ATTR_EMULATE_DATABASE)) throw new Doctrine_Export_Oracle_Exception('database creation is only supported if the "emulate_database" attribute is enabled'); @@ -74,7 +75,7 @@ class Doctrine_Export_Oracle extends Doctrine_Export { * @return mixed MDB2_OK on success, a MDB2 error on failure * @access public */ - public function dropDatabase($name) + public function dropDatabase($name) { if ( ! $this->conn->getAttribute(Doctrine::ATTR_EMULATE_DATABASE)) throw new Doctrine_Export_Oracle_Exception('database dropping is only supported if the @@ -93,7 +94,7 @@ class Doctrine_Export_Oracle extends Doctrine_Export { * @return mixed MDB2_OK on success, a MDB2 error on failure * @access private */ - public function _makeAutoincrement($name, $table, $start = 1) + public function _makeAutoincrement($name, $table, $start = 1) { $table = strtoupper($table); $index_name = $table . '_AI_PK'; @@ -163,7 +164,7 @@ END; * @param string $table name of the table * @return void */ - public function dropAutoincrement($table) + public function dropAutoincrement($table) { $table = strtoupper($table); $trigger_name = $table . '_AI_PK'; @@ -219,7 +220,7 @@ END; * * @return void */ - public function createTable($name, $fields, $options = array()) + public function createTable($name, $fields, $options = array()) { $this->conn->beginTransaction(); @@ -241,7 +242,7 @@ END; * @param string $name name of the table that should be dropped * @return void */ - public function dropTable($name) + public function dropTable($name) { //$this->conn->beginNestedTransaction(); $result = $this->dropAutoincrement($name); @@ -337,7 +338,7 @@ END; * actually perform them otherwise. * @return void */ - public function alterTable($name, array $changes, $check) + public function alterTable($name, array $changes, $check) { foreach ($changes as $changeName => $change) { @@ -420,7 +421,8 @@ END; * @param string $start start value of the sequence; default is 1 * @return void */ - public function createSequence($seqName, $start = 1) { + public function createSequence($seqName, $start = 1) + { $sequenceName = $this->conn->quoteIdentifier($this->conn->getSequenceName($seqName), true); $query = 'CREATE SEQUENCE ' . $sequenceName . ' START WITH ' . $start . ' INCREMENT BY 1 NOCACHE'; $query.= ($start < 1 ? ' MINVALUE ' . $start : ''); @@ -433,7 +435,8 @@ END; * @param string $seqName name of the sequence to be dropped * @return void */ - public function dropSequence($seqName) { + public function dropSequence($seqName) + { $sequenceName = $this->conn->quoteIdentifier($this->conn->getSequenceName($seqName), true); return $this->conn->exec('DROP SEQUENCE ' . $sequenceName); } diff --git a/lib/Doctrine/Export/Pgsql.php b/lib/Doctrine/Export/Pgsql.php index ac90333a4..bf471f8be 100644 --- a/lib/Doctrine/Export/Pgsql.php +++ b/lib/Doctrine/Export/Pgsql.php @@ -31,7 +31,8 @@ Doctrine::autoload('Doctrine_Export'); * @since 1.0 * @version $Revision$ */ -class Doctrine_Export_Pgsql extends Doctrine_Export { +class Doctrine_Export_Pgsql extends Doctrine_Export +{ /** * create a new database * @@ -39,7 +40,8 @@ class Doctrine_Export_Pgsql extends Doctrine_Export { * @throws PDOException * @return void */ - public function createDatabase($name) { + public function createDatabase($name) + { $query = 'CREATE DATABASE ' . $this->conn->quoteIdentifier($name); $this->conn->exec($query); } @@ -50,7 +52,8 @@ class Doctrine_Export_Pgsql extends Doctrine_Export { * @throws PDOException * @access public */ - public function dropDatabase($name) { + public function dropDatabase($name) + { $query = 'DROP DATABASE ' . $this->conn->quoteIdentifier($name); $this->conn->exec($query); } @@ -143,7 +146,8 @@ class Doctrine_Export_Pgsql extends Doctrine_Export { * @throws PDOException * @return boolean */ - public function alterTable($name, $changes, $check) { + public function alterTable($name, $changes, $check) + { foreach ($changes as $change_name => $change) { switch ($change_name) { case 'add': diff --git a/lib/Doctrine/Export/Sqlite.php b/lib/Doctrine/Export/Sqlite.php index 616e13ff5..fc577e8a3 100644 --- a/lib/Doctrine/Export/Sqlite.php +++ b/lib/Doctrine/Export/Sqlite.php @@ -31,7 +31,8 @@ Doctrine::autoload('Doctrine_Export'); * @since 1.0 * @version $Revision$ */ -class Doctrine_Export_Sqlite extends Doctrine_Export { +class Doctrine_Export_Sqlite extends Doctrine_Export +{ /** * Get the stucture of a field into an array * @@ -64,7 +65,8 @@ class Doctrine_Export_Sqlite extends Doctrine_Export { * @throws PDOException * @return void */ - public function createIndex($table, $name, array $definition) { + public function createIndex($table, $name, array $definition) + { $table = $this->conn->quoteIdentifier($table, true); $name = $this->conn->getIndexName($name); $query = 'CREATE INDEX ' . $name . ' ON ' . $table; diff --git a/lib/Doctrine/Expression.php b/lib/Doctrine/Expression.php index 8d31dca80..bf47b84f2 100644 --- a/lib/Doctrine/Expression.php +++ b/lib/Doctrine/Expression.php @@ -30,11 +30,14 @@ Doctrine::autoload('Doctrine_Connection_Module'); * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Expression extends Doctrine_Connection_Module { - public function getIdentifier($column) { +class Doctrine_Expression extends Doctrine_Connection_Module +{ + public function getIdentifier($column) + { return $column; } - public function getIdentifiers($columns) { + public function getIdentifiers($columns) + { return $columns; } /** @@ -43,7 +46,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * * @return string */ - public function regexp() { + public function regexp() + { throw new Doctrine_Expression_Exception('Regular expression operator is not supported by this database driver.'); } /** @@ -52,7 +56,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * @param string $column the column to use * @return string generated sql including an AVG aggregate function */ - public function avg($column) { + public function avg($column) + { $column = $this->getIdentifier($column); return 'AVG(' . $column . ')'; } @@ -66,7 +71,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * @param string|integer $column the column to use * @return string generated sql including a COUNT aggregate function */ - public function count($column) { + public function count($column) + { $column = $this->getIdentifier($column); return 'COUNT(' . $column . ')'; } @@ -77,7 +83,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * @param string $column the column to use * @return string generated sql including a MAX aggregate function */ - public function max($column) { + public function max($column) + { $column = $this->getIdentifier($column); return 'MAX(' . $column . ')'; } @@ -88,7 +95,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * @param string $column the column to use * @return string */ - public function min($column) { + public function min($column) + { $column = $this->getIdentifier($column); return 'MIN(' . $column . ')'; } @@ -99,7 +107,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * @param string $column the column to use * @return string */ - public function sum($column) { + public function sum($column) + { $column = $this->getIdentifier($column); return 'SUM(' . $column . ')'; } @@ -113,7 +122,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * * @return string */ - public function md5($column) { + public function md5($column) + { $column = $this->getIdentifier($column); return 'MD5(' . $column . ')'; } @@ -125,7 +135,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * @param string $expression2 * @return string */ - public function length($column) { + public function length($column) + { $column = $this->getIdentifier($column); return 'LENGTH(' . $column . ')'; } @@ -137,7 +148,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * @param string $expression2 * @return string */ - public function round($column, $decimals = 0) { + public function round($column, $decimals = 0) + { $column = $this->getIdentifier($column); return 'ROUND(' . $column . ', ' . $decimals . ')'; @@ -151,7 +163,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * @param string $expression2 * @return string */ - public function mod($expression1, $expression2) { + public function mod($expression1, $expression2) + { $expression1 = $this->getIdentifier($expression1); $expression2 = $this->getIdentifier($expression2); return 'MOD(' . $expression1 . ', ' . $expression2 . ')'; @@ -163,7 +176,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * @param string $str literal string or column name * @return string */ - public function ltrim($str) { + public function ltrim($str) + { return 'LTRIM(' . $str . ')'; } /** @@ -174,7 +188,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * @param string $str literal string or column name * @return string */ - public function upper($str) { + public function upper($str) + { return 'UPPER(' . $str . ')'; } /** @@ -185,7 +200,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * @param string $str literal string or column name * @return string */ - public function lower($str) { + public function lower($str) + { return 'LOWER(' . $str . ')'; } /** @@ -196,7 +212,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * @param string $str literal string * @return integer */ - public function locate($str, $substr) { + public function locate($str, $substr) + { return 'LOCATE(' . $str . ', ' . $substr . ')'; } /** @@ -204,7 +221,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * * @return string */ - public function now() { + public function now() + { return 'NOW()'; } /** @@ -217,7 +235,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * @param string $value * @return string SQL soundex function with given parameter */ - public function soundex($value) { + public function soundex($value) + { throw new Doctrine_Expression_Exception('SQL soundex function not supported by this driver.'); } /** @@ -232,7 +251,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * @param integer $length the substring portion length * @return string SQL substring function with given parameters */ - public function substring($value, $from, $len = null) { + public function substring($value, $from, $len = null) + { $value = $this->getIdentifier($value); if ($len === null) return 'SUBSTRING(' . $value . ' FROM ' . $from . ')'; @@ -249,7 +269,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * * @param string|array(string) strings that will be concatinated. */ - public function concat(array $args) { + public function concat(array $args) + { $cols = $this->getIdentifiers($args); return 'CONCAT(' . join(', ', $cols) . ')'; } @@ -266,7 +287,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * * @return string a logical expression */ - public function not($expression) { + public function not($expression) + { $expression = $this->getIdentifier($expression); return 'NOT(' . $expression . ')'; } @@ -282,7 +304,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * @param string|array(string) * @return string an expression */ - private function basicMath($type, array $args) { + private function basicMath($type, array $args) + { $elements = $this->getIdentifiers($args); if (count($elements) < 1) { return ''; @@ -313,7 +336,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * @param string|array(string) * @return string an expression */ - public function add(array $args) { + public function add(array $args) + { return $this->basicMath('+', $args); } @@ -337,7 +361,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * @param string|array(string) * @return string an expression */ - public function sub(array $args) { + public function sub(array $args) + { return $this->basicMath('-', $args ); } @@ -361,7 +386,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * @param string|array(string) * @return string an expression */ - public function mul(array $args) { + public function mul(array $args) + { return $this->basicMath('*', $args); } @@ -385,7 +411,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * @param string|array(string) * @return string an expression */ - public function div(array $args) { + public function div(array $args) + { return $this->basicMath('/', $args); } @@ -404,7 +431,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * @param string $value2 logical expression to compare with * @return string logical expression */ - public function eq($value1, $value2) { + public function eq($value1, $value2) + { $value1 = $this->getIdentifier($value1); $value2 = $this->getIdentifier($value2); return $value1 . ' = ' . $value2; @@ -425,7 +453,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * @param string $value2 logical expression to compare with * @return string logical expression */ - public function neq($value1, $value2) { + public function neq($value1, $value2) + { $value1 = $this->getIdentifier($value1); $value2 = $this->getIdentifier($value2); return $value1 . ' <> ' . $value2; @@ -446,7 +475,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * @param string $value2 logical expression to compare with * @return string logical expression */ - public function gt($value1, $value2) { + public function gt($value1, $value2) + { $value1 = $this->getIdentifier($value1); $value2 = $this->getIdentifier($value2); return $value1 . ' > ' . $value2; @@ -468,7 +498,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * @param string $value2 logical expression to compare with * @return string logical expression */ - public function gte($value1, $value2) { + public function gte($value1, $value2) + { $value1 = $this->getIdentifier($value1); $value2 = $this->getIdentifier($value2); return $value1 . ' >= ' . $value2; @@ -489,7 +520,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * @param string $value2 logical expression to compare with * @return string logical expression */ - public function lt($value1, $value2) { + public function lt($value1, $value2) + { $value1 = $this->getIdentifier($value1); $value2 = $this->getIdentifier($value2); return $value1 . ' < ' . $value2; @@ -511,7 +543,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * @param string $value2 logical expression to compare with * @return string logical expression */ - public function lte($value1, $value2) { + public function lte($value1, $value2) + { $value1 = $this->getIdentifier($value1); $value2 = $this->getIdentifier($value2); return $value1 . ' <= ' . $value2; @@ -538,7 +571,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * @param string|array(string) values that will be matched against $column * @return string logical expression */ - public function in($column, $values) { + public function in($column, $values) + { if ( ! is_array($values)) { $values = array($values); } @@ -564,7 +598,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * @param string $expression the expression that should be compared to null * @return string logical expression */ - public function isNull($expression) { + public function isNull($expression) + { $expression = $this->getIdentifier($expression); return $expression . ' IS NULL'; } @@ -582,7 +617,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * @param string $expression the expression that should be compared to null * @return string logical expression */ - public function isNotNull($expression) { + public function isNotNull($expression) + { $expression = $this->getIdentifier($expression); return $expression . ' IS NOT NULL'; } @@ -609,7 +645,8 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * @param string $value2 the higher value to compare with * @return string logical expression */ - public function between($expression, $value1, $value2) { + public function between($expression, $value1, $value2) + { $expression = $this->getIdentifier($expression); $value1 = $this->getIdentifier($value1); $value2 = $this->getIdentifier($value2); diff --git a/lib/Doctrine/Expression/Exception.php b/lib/Doctrine/Expression/Exception.php index 8d534431a..121588c0c 100644 --- a/lib/Doctrine/Expression/Exception.php +++ b/lib/Doctrine/Expression/Exception.php @@ -1,5 +1,5 @@ */ -class Doctrine_Expression_Exception extends Doctrine_Exception { } +class Doctrine_Expression_Exception extends Doctrine_Exception +{ } diff --git a/lib/Doctrine/Expression/Firebird.php b/lib/Doctrine/Expression/Firebird.php index 5bba1dcaa..5404496e4 100644 --- a/lib/Doctrine/Expression/Firebird.php +++ b/lib/Doctrine/Expression/Firebird.php @@ -32,14 +32,16 @@ Doctrine::autoload('Doctrine_Expression'); * @author Lorenzo Alberton (PEAR MDB2 Interbase driver) * @author Lukas Smith (PEAR MDB2 library) */ -class Doctrine_Expression_Firebird extends Doctrine_Expression { +class Doctrine_Expression_Firebird extends Doctrine_Expression +{ /** * return string for internal table used when calling only a function * * @return string for internal table used when calling only a function * @access public */ - public function functionTable() { + public function functionTable() + { return ' FROM RDB$DATABASE'; } /** @@ -47,7 +49,8 @@ class Doctrine_Expression_Firebird extends Doctrine_Expression { * * @return string define escape pattern */ - function patternEscapeString() { + function patternEscapeString() + { return " ESCAPE '". $this->conn->string_quoting['escape_pattern'] ."'"; } } diff --git a/lib/Doctrine/Expression/Informix.php b/lib/Doctrine/Expression/Informix.php index 584747b3c..45ab8478a 100644 --- a/lib/Doctrine/Expression/Informix.php +++ b/lib/Doctrine/Expression/Informix.php @@ -22,12 +22,13 @@ Doctrine::autoload('Doctrine_Expression'); /** * Doctrine_Expression_Informix * - * @package Doctrine - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @category Object Relational Mapping - * @link www.phpdoctrine.com - * @since 1.0 - * @version $Revision$ - * @author Konsta Vesterinen - */ -class Doctrine_Expression_Informix extends Doctrine_Expression { } + * @package Doctrine + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @category Object Relational Mapping + * @link www.phpdoctrine.com + * @since 1.0 + * @version $Revision$ + * @author Konsta Vesterinen + */ +class Doctrine_Expression_Informix extends Doctrine_Expression +{ } diff --git a/lib/Doctrine/Expression/Mssql.php b/lib/Doctrine/Expression/Mssql.php index cdb029b2c..d908ee592 100644 --- a/lib/Doctrine/Expression/Mssql.php +++ b/lib/Doctrine/Expression/Mssql.php @@ -30,7 +30,8 @@ Doctrine::autoload('Doctrine_Expression'); * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Expression_Mssql extends Doctrine_Expression { +class Doctrine_Expression_Mssql extends Doctrine_Expression +{ /** * Return string to call a variable with the current timestamp inside an SQL statement * There are three special variables for current date and time: @@ -41,7 +42,8 @@ class Doctrine_Expression_Mssql extends Doctrine_Expression { * @return string to call a variable with the current timestamp * @access public */ - public function now($type = 'timestamp') { + public function now($type = 'timestamp') + { switch ($type) { case 'time': case 'date': @@ -55,7 +57,8 @@ class Doctrine_Expression_Mssql extends Doctrine_Expression { * * @return string to call a function to get a substring */ - public function substring($value, $position, $length = null) { + public function substring($value, $position, $length = null) + { if (!is_null($length)) { return "SUBSTRING($value, $position, $length)"; } @@ -70,7 +73,8 @@ class Doctrine_Expression_Mssql extends Doctrine_Expression { * @return string to concatenate two strings * @access public **/ - function concat($arg1, $arg2) { + function concat($arg1, $arg2) + { $args = func_get_args(); return '(' . implode(' + ', $args) . ')'; } diff --git a/lib/Doctrine/Expression/Mysql.php b/lib/Doctrine/Expression/Mysql.php index 83dd3a7f2..76f4fdf0f 100644 --- a/lib/Doctrine/Expression/Mysql.php +++ b/lib/Doctrine/Expression/Mysql.php @@ -30,13 +30,15 @@ Doctrine::autoload('Doctrine_Expression'); * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Expression_Mysql extends Doctrine_Expression { +class Doctrine_Expression_Mysql extends Doctrine_Expression +{ /** * returns the regular expression operator * * @return string */ - public function regexp() { + public function regexp() + { return 'RLIKE'; } /** @@ -56,7 +58,8 @@ class Doctrine_Expression_Mysql extends Doctrine_Expression { * * @return string SQL pattern */ - public function matchPattern($pattern, $operator = null, $field = null) { + public function matchPattern($pattern, $operator = null, $field = null) + { $match = ''; if (!is_null($operator)) { $field = is_null($field) ? '' : $field.' '; diff --git a/lib/Doctrine/Expression/Oracle.php b/lib/Doctrine/Expression/Oracle.php index 988d12a0d..9f30514bf 100644 --- a/lib/Doctrine/Expression/Oracle.php +++ b/lib/Doctrine/Expression/Oracle.php @@ -30,7 +30,8 @@ Doctrine::autoload('Doctrine_Expression'); * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Expression_Oracle extends Doctrine_Expression { +class Doctrine_Expression_Oracle extends Doctrine_Expression +{ /** * Returns a series of strings concatinated * @@ -40,7 +41,8 @@ class Doctrine_Expression_Oracle extends Doctrine_Expression { * @param string $arg1, $arg2 ... $argN strings that will be concatinated. * @return string */ - public function concat($arg1, $arg2) { + public function concat($arg1, $arg2) + { $args = func_get_args(); $cols = $this->getIdentifiers( $args ); @@ -56,7 +58,8 @@ class Doctrine_Expression_Oracle extends Doctrine_Expression { * @param integer $length the substring portion length * @return string SQL substring function with given parameters */ - public function substring($value, $position, $length = null) { + public function substring($value, $position, $length = null) + { if ($length !== null) return "SUBSTR($value, $position, $length)"; @@ -71,7 +74,8 @@ class Doctrine_Expression_Oracle extends Doctrine_Expression { * * @return string to call a variable with the current timestamp */ - public function now($type = 'timestamp') { + public function now($type = 'timestamp') + { switch ($type) { case 'date': case 'time': @@ -85,7 +89,8 @@ class Doctrine_Expression_Oracle extends Doctrine_Expression { * * @return string an oracle SQL string that generates a float between 0 and 1 */ - function random() { + function random() + { return 'dbms_random.value'; } } diff --git a/lib/Doctrine/Expression/Pgsql.php b/lib/Doctrine/Expression/Pgsql.php index 76aad4949..f8ca8fec6 100644 --- a/lib/Doctrine/Expression/Pgsql.php +++ b/lib/Doctrine/Expression/Pgsql.php @@ -30,7 +30,8 @@ Doctrine::autoload('Doctrine_Expression'); * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Expression_Pgsql extends Doctrine_Expression { +class Doctrine_Expression_Pgsql extends Doctrine_Expression +{ /** * Returns the md5 sum of a field. * @@ -49,7 +50,8 @@ class Doctrine_Expression_Pgsql extends Doctrine_Expression { * * @return string */ - public function md5($column) { + public function md5($column) + { $column = $this->getIdentifier($column); if ($this->version > 7) { @@ -69,7 +71,8 @@ class Doctrine_Expression_Pgsql extends Doctrine_Expression { * @param int $len extract this amount of characters. * @return string sql that extracts part of a string. */ - public function substring($value, $from, $len = null) { + public function substring($value, $from, $len = null) + { $value = $this->getIdentifier($value); if ($len === null) { @@ -89,7 +92,8 @@ class Doctrine_Expression_Pgsql extends Doctrine_Expression { * @param string|array(string) strings that will be concatinated. * @return string */ - public function concat($arg1, $arg2) { + public function concat($arg1, $arg2) + { $args = func_get_args(); $cols = $this->getIdentifiers($cols); @@ -100,7 +104,8 @@ class Doctrine_Expression_Pgsql extends Doctrine_Expression { * * @return string the regular expression operator */ - public function regexp() { + public function regexp() + { return 'SIMILAR TO'; } /** @@ -109,7 +114,8 @@ class Doctrine_Expression_Pgsql extends Doctrine_Expression { * @return return string to generate float between 0 and 1 * @access public */ - public function random() { + public function random() + { return 'RANDOM()'; } /** @@ -129,7 +135,8 @@ class Doctrine_Expression_Pgsql extends Doctrine_Expression { * * @return string SQL pattern */ - public function matchPattern($pattern, $operator = null, $field = null) { + public function matchPattern($pattern, $operator = null, $field = null) + { $match = ''; if (!is_null($operator)) { $field = is_null($field) ? '' : $field.' '; diff --git a/lib/Doctrine/Expression/Sqlite.php b/lib/Doctrine/Expression/Sqlite.php index 1a8b48345..5fcf6d6f4 100644 --- a/lib/Doctrine/Expression/Sqlite.php +++ b/lib/Doctrine/Expression/Sqlite.php @@ -30,14 +30,16 @@ Doctrine::autoload('Doctrine_Expression'); * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Expression_Sqlite extends Doctrine_Expression { +class Doctrine_Expression_Sqlite extends Doctrine_Expression +{ /** * Returns the md5 sum of the data that SQLite's md5() function receives. * * @param mixed $data * @return string */ - public static function md5Impl($data) { + public static function md5Impl($data) + { return md5($data); } /** @@ -47,7 +49,8 @@ class Doctrine_Expression_Sqlite extends Doctrine_Expression { * @param integer $divisor * @return string */ - public static function modImpl($dividend, $divisor) { + public static function modImpl($dividend, $divisor) + { return $dividend % $divisor; } @@ -56,7 +59,8 @@ class Doctrine_Expression_Sqlite extends Doctrine_Expression { * * @return string */ - public static function concatImpl() { + public static function concatImpl() + { $args = func_get_args(); return join( '', $args ); } @@ -69,19 +73,24 @@ class Doctrine_Expression_Sqlite extends Doctrine_Expression { * @param string $str literal string * @return string */ - public static function locateImpl($substr, $str) { + public static function locateImpl($substr, $str) + { return strpos($str, $substr); } - public static function sha1Impl($str) { + public static function sha1Impl($str) + { return sha1($str); } - public static function ltrimImpl($str) { + public static function ltrimImpl($str) + { return ltrim($str); } - public static function rtrimImpl($str) { + public static function rtrimImpl($str) + { return rtrim($str); } - public static function trimImpl($str) { + public static function trimImpl($str) + { return trim($str); } /** @@ -89,7 +98,8 @@ class Doctrine_Expression_Sqlite extends Doctrine_Expression { * * @return string */ - public function regexp() { + public function regexp() + { return 'RLIKE'; } /** @@ -102,7 +112,8 @@ class Doctrine_Expression_Sqlite extends Doctrine_Expression { * @param string $value * @return string SQL soundex function with given parameter */ - public function soundex($value) { + public function soundex($value) + { return 'SOUNDEX(' . $value . ')'; } /** @@ -111,7 +122,8 @@ class Doctrine_Expression_Sqlite extends Doctrine_Expression { * * @return string sqlite function as string */ - public function now($type = 'timestamp') { + public function now($type = 'timestamp') + { switch ($type) { case 'time': return 'time(\'now\')'; @@ -127,7 +139,8 @@ class Doctrine_Expression_Sqlite extends Doctrine_Expression { * * @return string to generate float between 0 and 1 */ - public function random() { + public function random() + { return '((RANDOM() + 2147483648) / 4294967296)'; } /** @@ -142,7 +155,8 @@ class Doctrine_Expression_Sqlite extends Doctrine_Expression { * @param integer $length the substring portion length * @return string SQL substring function with given parameters */ - public function substring($value, $position, $length = null) { + public function substring($value, $position, $length = null) + { if ($length !== null) { return 'SUBSTR(' . $value . ', ' . $position . ', ' . $length . ')'; } diff --git a/lib/Doctrine/Hook.php b/lib/Doctrine/Hook.php index 194112b87..77af877d4 100644 --- a/lib/Doctrine/Hook.php +++ b/lib/Doctrine/Hook.php @@ -30,7 +30,8 @@ * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Hook { +class Doctrine_Hook +{ /** * @var Doctrine_Query $query the base query */ @@ -69,7 +70,8 @@ class Doctrine_Hook { /** * @param Doctrine_Query $query the base query */ - public function __construct($query) { + public function __construct($query) + { if (is_string($query)) { $this->query = new Doctrine_Query(); $this->query->parseQuery($query); @@ -77,13 +79,16 @@ class Doctrine_Hook { $this->query = $query; } } - public function getQuery() { + public function getQuery() + { return $this->query; } - public function leftJoin($dql) { + public function leftJoin($dql) + { } - public function innerJoin($dql) { + public function innerJoin($dql) + { } /** @@ -94,7 +99,8 @@ class Doctrine_Hook { * names and their values * @return boolean whether or not the hooking was */ - public function hookWhere($params) { + public function hookWhere($params) + { if ( ! is_array($params)) { return false; } @@ -132,7 +138,8 @@ class Doctrine_Hook { * should be ordered by * @return boolean whether or not the hooking was */ - public function hookOrderby($params) { + public function hookOrderby($params) + { if ( ! is_array($params)) { return false; } @@ -162,13 +169,15 @@ class Doctrine_Hook { /** * @param integer $limit */ - public function hookLimit($limit) { + public function hookLimit($limit) + { $this->query->limit((int) $limit); } /** * @param integer $offset */ - public function hookOffset($offset) { + public function hookOffset($offset) + { $this->query->offset((int) $offset); } } diff --git a/lib/Doctrine/Hook/Equal.php b/lib/Doctrine/Hook/Equal.php index 8b4feaf8a..9db62db93 100644 --- a/lib/Doctrine/Hook/Equal.php +++ b/lib/Doctrine/Hook/Equal.php @@ -30,7 +30,8 @@ Doctrine::autoload('Doctrine_Hook_Parser'); * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Hook_Equal extends Doctrine_Hook_Parser { +class Doctrine_Hook_Equal extends Doctrine_Hook_Parser +{ /** * parse * Parses given field and field value to DQL condition @@ -43,7 +44,8 @@ class Doctrine_Hook_Equal extends Doctrine_Hook_Parser { * @param mixed $value the value of the field * @return void */ - public function parse($alias, $field, $value) { + public function parse($alias, $field, $value) + { $this->params = (array) $value; $this->condition = $alias . '.' . $field . ' = ?'; } diff --git a/lib/Doctrine/Hook/Integer.php b/lib/Doctrine/Hook/Integer.php index f7f920998..a8a1ffac9 100644 --- a/lib/Doctrine/Hook/Integer.php +++ b/lib/Doctrine/Hook/Integer.php @@ -30,7 +30,8 @@ Doctrine::autoload('Doctrine_Hook_Parser_Complex'); * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Hook_Integer extends Doctrine_Hook_Parser_Complex { +class Doctrine_Hook_Integer extends Doctrine_Hook_Parser_Complex +{ /** * parse * Parses given field and field value to DQL condition @@ -43,7 +44,8 @@ class Doctrine_Hook_Integer extends Doctrine_Hook_Parser_Complex { * @param mixed $value the value of the field * @return void */ - public function parseSingle($alias, $field, $value) { + public function parseSingle($alias, $field, $value) + { $e = explode(' ', $value); foreach ($e as $v) { diff --git a/lib/Doctrine/Hook/Parser.php b/lib/Doctrine/Hook/Parser.php index 0151f0a4f..c0aef56f4 100644 --- a/lib/Doctrine/Hook/Parser.php +++ b/lib/Doctrine/Hook/Parser.php @@ -30,15 +30,18 @@ * @version $Revision$ * @author Konsta Vesterinen */ -abstract class Doctrine_Hook_Parser { +abstract class Doctrine_Hook_Parser +{ protected $condition; protected $params = array(); - public function getCondition() { + public function getCondition() + { return $this->condition; } - public function getParams() { + public function getParams() + { return $this->params; } /** diff --git a/lib/Doctrine/Hook/Parser/Complex.php b/lib/Doctrine/Hook/Parser/Complex.php index 4b520e95f..b0d8ea6b8 100644 --- a/lib/Doctrine/Hook/Parser/Complex.php +++ b/lib/Doctrine/Hook/Parser/Complex.php @@ -30,7 +30,8 @@ Doctrine::autoload('Doctrine_Hook_Parser'); * @version $Revision$ * @author Konsta Vesterinen */ -abstract class Doctrine_Hook_Parser_Complex extends Doctrine_Hook_Parser { +abstract class Doctrine_Hook_Parser_Complex extends Doctrine_Hook_Parser +{ /** * parse * Parses given field and field value to DQL condition @@ -43,7 +44,8 @@ abstract class Doctrine_Hook_Parser_Complex extends Doctrine_Hook_Parser { * @param mixed $value the value of the field * @return void */ - public function parse($alias, $field, $value) { + public function parse($alias, $field, $value) + { $this->condition = $this->parseClause($alias, $field, $value); } /** @@ -54,7 +56,8 @@ abstract class Doctrine_Hook_Parser_Complex extends Doctrine_Hook_Parser { * @param mixed $value the value of the field * @return void */ - public function parseClause($alias, $field, $value) { + public function parseClause($alias, $field, $value) + { $parts = Doctrine_Query::bracketExplode($value, ' AND ', '(', ')'); if (count($parts) > 1) { diff --git a/lib/Doctrine/Hook/WordLike.php b/lib/Doctrine/Hook/WordLike.php index b681babaf..088a3eacf 100644 --- a/lib/Doctrine/Hook/WordLike.php +++ b/lib/Doctrine/Hook/WordLike.php @@ -30,7 +30,8 @@ Doctrine::autoload('Doctrine_Hook_Parser'); * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Hook_WordLike extends Doctrine_Hook_Parser_Complex { +class Doctrine_Hook_WordLike extends Doctrine_Hook_Parser_Complex +{ /** * parse * Parses given field and field value to DQL condition @@ -43,7 +44,8 @@ class Doctrine_Hook_WordLike extends Doctrine_Hook_Parser_Complex { * @param mixed $value the value of the field * @return void */ - public function parseSingle($alias, $field, $value) { + public function parseSingle($alias, $field, $value) + { $e2 = explode(' ',$value); foreach ($e2 as $v) { diff --git a/lib/Doctrine/Hydrate.php b/lib/Doctrine/Hydrate.php index 08a460ec6..b6ef92ba2 100644 --- a/lib/Doctrine/Hydrate.php +++ b/lib/Doctrine/Hydrate.php @@ -32,7 +32,8 @@ Doctrine::autoload('Doctrine_Access'); * @version $Revision$ * @author Konsta Vesterinen */ -abstract class Doctrine_Hydrate extends Doctrine_Access { +abstract class Doctrine_Hydrate extends Doctrine_Access +{ /** * @var array $fetchmodes an array containing all fetchmodes */ @@ -110,7 +111,8 @@ abstract class Doctrine_Hydrate extends Doctrine_Access { * * @param Doctrine_Connection|null $connection */ - public function __construct($connection = null) { + public function __construct($connection = null) + { if ( ! ($connection instanceof Doctrine_Connection)) { $connection = Doctrine_Manager::getInstance()->getCurrentConnection(); } @@ -122,7 +124,8 @@ abstract class Doctrine_Hydrate extends Doctrine_Access { * * @return array */ - public function getComponentAliases() { + public function getComponentAliases() + { return $this->compAliases; } /** @@ -130,7 +133,8 @@ abstract class Doctrine_Hydrate extends Doctrine_Access { * * @return array */ - public function getTableAliases() { + public function getTableAliases() + { return $this->tableAliases; } /** @@ -138,7 +142,8 @@ abstract class Doctrine_Hydrate extends Doctrine_Access { * * @return array */ - public function getTableIndexes() { + public function getTableIndexes() + { return $this->tableIndexes; } /** @@ -146,7 +151,8 @@ abstract class Doctrine_Hydrate extends Doctrine_Access { * * @return array */ - public function getTables() { + public function getTables() + { return $this->tables; } /** @@ -154,7 +160,8 @@ abstract class Doctrine_Hydrate extends Doctrine_Access { * * @return void */ - public function copyAliases(Doctrine_Hydrate $query) { + public function copyAliases(Doctrine_Hydrate $query) + { $this->compAliases = $query->getComponentAliases(); $this->tableAliases = $query->getTableAliases(); $this->tableIndexes = $query->getTableIndexes(); @@ -162,7 +169,8 @@ abstract class Doctrine_Hydrate extends Doctrine_Access { return $this; } - public function getPathAlias($path) { + public function getPathAlias($path) + { $s = array_search($path, $this->compAliases); if ($s === false) return $path; @@ -174,7 +182,8 @@ abstract class Doctrine_Hydrate extends Doctrine_Access { * * @return Doctrine_Hydrate */ - public function createSubquery() { + public function createSubquery() + { $class = get_class($this); $obj = new $class(); @@ -194,7 +203,8 @@ abstract class Doctrine_Hydrate extends Doctrine_Access { * * @return boolean */ - public function isLimitSubqueryUsed() { + public function isLimitSubqueryUsed() + { return false; } @@ -203,7 +213,8 @@ abstract class Doctrine_Hydrate extends Doctrine_Access { * * @param $name */ - public function remove($name) { + public function remove($name) + { if (isset($this->parts[$name])) { if ($name == "limit" || $name == "offset") { $this->parts[$name] = false; @@ -219,7 +230,8 @@ abstract class Doctrine_Hydrate extends Doctrine_Access { * * @return void */ - protected function clear() { + protected function clear() + { $this->fetchModes = array(); $this->tables = array(); $this->parts = array( @@ -247,7 +259,8 @@ abstract class Doctrine_Hydrate extends Doctrine_Access { * * @return Doctrine_Connection */ - public function getConnection() { + public function getConnection() + { return $this->conn; } /** @@ -258,7 +271,8 @@ abstract class Doctrine_Hydrate extends Doctrine_Access { * @param Doctrine_View $view database view * @return void */ - public function setView(Doctrine_View $view) { + public function setView(Doctrine_View $view) + { $this->view = $view; } /** @@ -267,15 +281,17 @@ abstract class Doctrine_Hydrate extends Doctrine_Access { * * @return Doctrine_View the view associated with this query object */ - public function getView() { + public function getView() + { return $this->view; } /** * getParams - * + * * @return array */ - public function getParams() { + public function getParams() + { return $this->params; } /** @@ -284,7 +300,8 @@ abstract class Doctrine_Hydrate extends Doctrine_Access { * @param string $path * @return string */ - final public function getTableAlias($path) { + final public function getTableAlias($path) + { if (isset($this->compAliases[$path])) { $path = $this->compAliases[$path]; } @@ -299,7 +316,8 @@ abstract class Doctrine_Hydrate extends Doctrine_Access { * @parma string $name component name * @param integer $index */ - private function getCollection($name) { + private function getCollection($name) + { $table = $this->tables[$name]; if ( ! isset($this->fetchModes[$name])) { return new Doctrine_Collection($table); @@ -333,7 +351,8 @@ abstract class Doctrine_Hydrate extends Doctrine_Access { * @param mixed $item * @return void */ - public static function convertBoolean(&$item) { + public static function convertBoolean(&$item) + { if (is_bool($item)) { $item = (int) $item; } @@ -512,7 +531,8 @@ abstract class Doctrine_Hydrate extends Doctrine_Access { * @param string $name * @return array */ - public function initRelated(array $prev, $name) { + public function initRelated(array $prev, $name) + { $pointer = $this->joins[$name]; $path = array_search($name, $this->tableAliases); $tmp = explode('.', $path); @@ -543,7 +563,8 @@ abstract class Doctrine_Hydrate extends Doctrine_Access { * @param string $name * @return array */ - public function addRelated(array $prev, $name, Doctrine_Record $record) { + public function addRelated(array $prev, $name, Doctrine_Record $record) + { $pointer = $this->joins[$name]; $path = array_search($name, $this->tableAliases); @@ -581,7 +602,8 @@ abstract class Doctrine_Hydrate extends Doctrine_Access { * @param mixed $ids * @return boolean */ - public function isIdentifiable(array $row, $ids) { + public function isIdentifiable(array $row, $ids) + { if (is_array($ids)) { foreach ($ids as $id) { if ($row[$id] == null) @@ -600,7 +622,8 @@ abstract class Doctrine_Hydrate extends Doctrine_Access { * * @return string */ - public function applyInheritance() { + public function applyInheritance() + { // get the inheritance maps $array = array(); @@ -647,7 +670,8 @@ abstract class Doctrine_Hydrate extends Doctrine_Access { * @param PDOStatement $stmt * @return array */ - public function parseData(PDOStatement $stmt) { + public function parseData(PDOStatement $stmt) + { $array = array(); while ($data = $stmt->fetch(PDO::FETCH_ASSOC)) { @@ -676,7 +700,8 @@ abstract class Doctrine_Hydrate extends Doctrine_Access { * @param string $name component name * @return Doctrine_Table|boolean */ - public function getTable($name) { + public function getTable($name) + { if (isset($this->tables[$name])) { return $this->tables[$name]; } @@ -685,7 +710,8 @@ abstract class Doctrine_Hydrate extends Doctrine_Access { /** * @return string returns a string representation of this object */ - public function __toString() { + public function __toString() + { return Doctrine_Lib::formatSql($this->getQuery()); } } diff --git a/lib/Doctrine/Hydrate/Alias.php b/lib/Doctrine/Hydrate/Alias.php index ecca99887..df0e3c7cb 100644 --- a/lib/Doctrine/Hydrate/Alias.php +++ b/lib/Doctrine/Hydrate/Alias.php @@ -30,18 +30,21 @@ * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Hydrate_Alias { +class Doctrine_Hydrate_Alias +{ protected $shortAliases = array(); protected $shortAliasIndexes = array(); - public function clear() { + public function clear() + { $this->shortAliases = array(); $this->shortAliasIndexes = array(); } - public function generateNewAlias($alias) { + public function generateNewAlias($alias) + { if (isset($this->shortAliases[$alias])) { // generate a new alias $name = substr($alias, 0, 1); @@ -58,16 +61,19 @@ class Doctrine_Hydrate_Alias { return $alias; } - public function hasAliasFor($tableName) { + public function hasAliasFor($tableName) + { return (isset($this->shortAliases[$tableName])); } - public function getShortAliasIndex($alias) { + public function getShortAliasIndex($alias) + { if ( ! isset($this->shortAliasIndexes[$alias])) { return 0; } return $this->shortAliasIndexes[$alias]; } - public function generateShortAlias($tableName) { + public function generateShortAlias($tableName) + { $char = strtolower(substr($tableName, 0, 1)); $alias = $char; @@ -83,7 +89,8 @@ class Doctrine_Hydrate_Alias { return $alias; } - public function getShortAlias($tableName) { + public function getShortAlias($tableName) + { $alias = array_search($tableName, $this->shortAliases); if ($alias !== false) { diff --git a/lib/Doctrine/Identifier.php b/lib/Doctrine/Identifier.php index 520513654..364fcda8c 100644 --- a/lib/Doctrine/Identifier.php +++ b/lib/Doctrine/Identifier.php @@ -29,7 +29,8 @@ * @since 1.0 * @version $Revision$ */ -class Doctrine_Identifier { +class Doctrine_Identifier +{ /** * constant for auto_increment identifier */ diff --git a/lib/Doctrine/Import.php b/lib/Doctrine/Import.php index e6f4004b0..ca0603d4b 100644 --- a/lib/Doctrine/Import.php +++ b/lib/Doctrine/Import.php @@ -34,7 +34,7 @@ Doctrine::autoload('Doctrine_Connection_Module'); * @author Konsta Vesterinen * @author Jukka Hassinen */ -class Doctrine_Import extends Doctrine_Connection_Module +class Doctrine_Import extends Doctrine_Connection_Module { protected $sql = array(); /** @@ -42,7 +42,7 @@ class Doctrine_Import extends Doctrine_Connection_Module * * @return array */ - public function listDatabases() + public function listDatabases() { if ( ! isset($this->sql['listDatabases'])) { throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.'); @@ -55,7 +55,7 @@ class Doctrine_Import extends Doctrine_Connection_Module * * @return array */ - public function listFunctions() + public function listFunctions() { if ( ! isset($this->sql['listFunctions'])) { throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.'); @@ -69,7 +69,7 @@ class Doctrine_Import extends Doctrine_Connection_Module * @param string|null $database * @return array */ - public function listTriggers($database = null) + public function listTriggers($database = null) { throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.'); } @@ -79,7 +79,7 @@ class Doctrine_Import extends Doctrine_Connection_Module * @param string|null $database * @return array */ - public function listSequences($database = null) + public function listSequences($database = null) { if ( ! isset($this->sql['listSequences'])) { throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.'); @@ -93,7 +93,7 @@ class Doctrine_Import extends Doctrine_Connection_Module * @param string $table database table name * @return array */ - public function listTableConstraints($table) + public function listTableConstraints($table) { throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.'); } @@ -103,7 +103,7 @@ class Doctrine_Import extends Doctrine_Connection_Module * @param string $table database table name * @return array */ - public function listTableColumns($table) + public function listTableColumns($table) { throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.'); } @@ -113,7 +113,7 @@ class Doctrine_Import extends Doctrine_Connection_Module * @param string $table database table name * @return array */ - public function listTableIndexes($table) + public function listTableIndexes($table) { throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.'); } @@ -123,7 +123,7 @@ class Doctrine_Import extends Doctrine_Connection_Module * @param string|null $database * @return array */ - public function listTables($database = null) + public function listTables($database = null) { throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.'); } @@ -133,7 +133,7 @@ class Doctrine_Import extends Doctrine_Connection_Module * @param string $table database table name * @return array */ - public function listTableTriggers($table) + public function listTableTriggers($table) { throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.'); } @@ -143,7 +143,7 @@ class Doctrine_Import extends Doctrine_Connection_Module * @param string $table database table name * @return array */ - public function listTableViews($table) + public function listTableViews($table) { throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.'); } @@ -152,7 +152,7 @@ class Doctrine_Import extends Doctrine_Connection_Module * * @return array */ - public function listUsers() + public function listUsers() { if ( ! isset($this->sql['listUsers'])) { throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.'); @@ -166,7 +166,7 @@ class Doctrine_Import extends Doctrine_Connection_Module * @param string|null $database * @return array */ - public function listViews($database = null) + public function listViews($database = null) { if ( ! isset($this->sql['listViews'])) { throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.'); diff --git a/lib/Doctrine/Import/Builder.php b/lib/Doctrine/Import/Builder.php index 5f0724871..71bc5ef09 100644 --- a/lib/Doctrine/Import/Builder.php +++ b/lib/Doctrine/Import/Builder.php @@ -33,7 +33,8 @@ * @author Konsta Vesterinen * @author Jukka Hassinen */ -class Doctrine_Import_Builder { +class Doctrine_Import_Builder +{ private $path = ''; @@ -41,7 +42,8 @@ class Doctrine_Import_Builder { private static $tpl; - public function __construct() { + public function __construct() + { if ( ! isset(self::$tpl)) { self::$tpl = file_get_contents(Doctrine::getPath() . DIRECTORY_SEPARATOR . 'Doctrine' @@ -57,14 +59,16 @@ class Doctrine_Import_Builder { * @return * @access public */ - public function setTargetPath($path) { + public function setTargetPath($path) + { if ( ! file_exists($path)) { mkdir($path, 0777); } $this->path = $path; } - public function getTargetPath() { + public function getTargetPath() + { return $this->path; } /** @@ -73,14 +77,17 @@ class Doctrine_Import_Builder { * @return * @access public */ - public function setFileSuffix($suffix) { + public function setFileSuffix($suffix) + { $this->suffix = $suffix; } - public function getFileSuffix() { + public function getFileSuffix() + { return $this->suffix; } - public function buildRecord(Doctrine_Schema_Table $table) { + public function buildRecord(Doctrine_Schema_Table $table) + { if (empty($this->path)) { throw new Doctrine_Import_Builder_Exception('No build target directory set.'); } @@ -146,7 +153,8 @@ class Doctrine_Import_Builder { * @throws Doctrine_Import_Exception * @return void */ - public function build(Doctrine_Schema_Object $schema) { + public function build(Doctrine_Schema_Object $schema) + { foreach ($schema->getDatabases() as $database){ foreach ($database->getTables() as $table){ $this->buildRecord($table); diff --git a/lib/Doctrine/Import/Builder/BaseClass.php b/lib/Doctrine/Import/Builder/BaseClass.php index 31e355143..f0f2b01f9 100644 --- a/lib/Doctrine/Import/Builder/BaseClass.php +++ b/lib/Doctrine/Import/Builder/BaseClass.php @@ -1,41 +1,42 @@ -. - */ -Doctrine::autoload('Doctrine_Import_Builder'); -/** - * @package Doctrine - * @url http://www.phpdoctrine.com - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @author Jukka Hassinen - * @version $Id$ - */ -/** - * class Doctrine_Import_Builder_BaseClass - * Builds a Doctrine_Record base class definition based on a schema. - * @package Doctrine - * @category Object Relational Mapping - * @link www.phpdoctrine.com - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @since 1.0 - * @version $Revision$ - * @author Konsta Vesterinen - */ -class Doctrine_Import_Builder_BaseClass extends Doctrine_Import_Builder { -} +. + */ +Doctrine::autoload('Doctrine_Import_Builder'); +/** + * @package Doctrine + * @url http://www.phpdoctrine.com + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @author Jukka Hassinen + * @version $Id$ + */ +/** + * class Doctrine_Import_Builder_BaseClass + * Builds a Doctrine_Record base class definition based on a schema. + * @package Doctrine + * @category Object Relational Mapping + * @link www.phpdoctrine.com + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @since 1.0 + * @version $Revision$ + * @author Konsta Vesterinen + */ +class Doctrine_Import_Builder_BaseClass extends Doctrine_Import_Builder +{ +} diff --git a/lib/Doctrine/Import/Builder/Exception.php b/lib/Doctrine/Import/Builder/Exception.php index 2956295b8..22ff1b5e5 100644 --- a/lib/Doctrine/Import/Builder/Exception.php +++ b/lib/Doctrine/Import/Builder/Exception.php @@ -1,39 +1,40 @@ -. - */ -Doctrine::autoload('Doctrine_Import_Exception'); -/** - * @package Doctrine - * @url http://www.phpdoctrine.com - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @author Jukka Hassinen - * @version $Id$ - */ -/** - * class Doctrine_Import_Builder_Exception - * @package Doctrine - * @category Object Relational Mapping - * @link www.phpdoctrine.com - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @since 1.0 - * @version $Revision$ - * @author Konsta Vesterinen - */ -class Doctrine_Import_Builder_Exception extends Doctrine_Import_Exception { } +. + */ +Doctrine::autoload('Doctrine_Import_Exception'); +/** + * @package Doctrine + * @url http://www.phpdoctrine.com + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @author Jukka Hassinen + * @version $Id$ + */ +/** + * class Doctrine_Import_Builder_Exception + * @package Doctrine + * @category Object Relational Mapping + * @link www.phpdoctrine.com + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @since 1.0 + * @version $Revision$ + * @author Konsta Vesterinen + */ +class Doctrine_Import_Builder_Exception extends Doctrine_Import_Exception +{ } diff --git a/lib/Doctrine/Import/Builder/Record.tpl b/lib/Doctrine/Import/Builder/Record.tpl index e6852d254..1cd9b1abd 100644 --- a/lib/Doctrine/Import/Builder/Record.tpl +++ b/lib/Doctrine/Import/Builder/Record.tpl @@ -3,11 +3,14 @@ * This class has been auto-generated by the Doctrine ORM Framework * Created: %s */ -class %s extends Doctrine_Record { - public function setTableDefinition() { +class %s extends Doctrine_Record +{ + public function setTableDefinition() + { %s } - public function setUp() { + public function setUp() + { } } diff --git a/lib/Doctrine/Import/Exception.php b/lib/Doctrine/Import/Exception.php index 919c0ebd1..66598c035 100644 --- a/lib/Doctrine/Import/Exception.php +++ b/lib/Doctrine/Import/Exception.php @@ -27,12 +27,13 @@ Doctrine::autoload('Doctrine_Exception'); */ /** * class Doctrine_Import_Exception - * @package Doctrine - * @category Object Relational Mapping - * @link www.phpdoctrine.com - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @since 1.0 - * @version $Revision$ - * @author Konsta Vesterinen - */ -class Doctrine_Import_Exception extends Doctrine_Exception { } + * @package Doctrine + * @category Object Relational Mapping + * @link www.phpdoctrine.com + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @since 1.0 + * @version $Revision$ + * @author Konsta Vesterinen + */ +class Doctrine_Import_Exception extends Doctrine_Exception +{ } diff --git a/lib/Doctrine/Import/Firebird.php b/lib/Doctrine/Import/Firebird.php index 9d8dff710..33ba2ba2c 100644 --- a/lib/Doctrine/Import/Firebird.php +++ b/lib/Doctrine/Import/Firebird.php @@ -30,13 +30,15 @@ Doctrine::autoload('Doctrine_Import'); * @link www.phpdoctrine.com * @since 1.0 */ -class Doctrine_Import_Firebird extends Doctrine_Import { +class Doctrine_Import_Firebird extends Doctrine_Import +{ /** * list all tables in the current database * * @return array data array */ - public function listTables() { + public function listTables() + { $query = 'SELECT RDB$RELATION_NAME FROM RDB$RELATIONS WHERE RDB$SYSTEM_FLAG=0 AND RDB$VIEW_BLR IS NULL'; return $this->conn->fetchColumn($query); @@ -48,7 +50,8 @@ class Doctrine_Import_Firebird extends Doctrine_Import { * @return mixed data array on success, a MDB2 error on failure * @access public */ - public function listTableFields($table) { + public function listTableFields($table) + { $table = $db->quote(strtoupper($table), 'text'); $query = 'SELECT RDB\$FIELD_NAME FROM RDB$RELATION_FIELDS WHERE UPPER(RDB$RELATION_NAME) = ' . $table; @@ -59,7 +62,8 @@ class Doctrine_Import_Firebird extends Doctrine_Import { * * @return array data array containing all database users */ - public function listUsers() { + public function listUsers() + { return $this->conn->fetchColumn('SELECT DISTINCT RDB$USER FROM RDB$USER_PRIVILEGES'); } /** @@ -67,7 +71,8 @@ class Doctrine_Import_Firebird extends Doctrine_Import { * * @return array data array containing all database views */ - public function listViews() { + public function listViews() + { $result = $db->queryCol('SELECT DISTINCT RDB$VIEW_NAME FROM RDB$VIEW_RELATIONS'); return $this->conn->fetchColumn($query); @@ -78,7 +83,8 @@ class Doctrine_Import_Firebird extends Doctrine_Import { * @param string $table table for which all references views should be found * @return array data array containing all views for given table */ - public function listTableViews($table) { + public function listTableViews($table) + { $query = 'SELECT DISTINCT RDB$VIEW_NAME FROM RDB$VIEW_RELATIONS'; $table = $db->quote(strtoupper($table), 'text'); $query .= 'WHERE UPPER(RDB\$RELATION_NAME) = ' . $table; @@ -90,7 +96,8 @@ class Doctrine_Import_Firebird extends Doctrine_Import { * * @return array data array containing all availible functions */ - public function listFunctions() { + public function listFunctions() + { $query = 'SELECT RDB$FUNCTION_NAME FROM RDB$FUNCTIONS WHERE RDB$SYSTEM_FLAG IS NULL'; return $this->conn->fetchColumn($query); @@ -103,7 +110,8 @@ class Doctrine_Import_Firebird extends Doctrine_Import { * previous database to query against. * @return array data array containing all triggers for given table */ - public function listTableTriggers($table = null) { + public function listTableTriggers($table = null) + { $query = 'SELECT RDB$TRIGGER_NAME FROM RDB$TRIGGERS WHERE RDB$SYSTEM_FLAG IS NULL diff --git a/lib/Doctrine/Import/Informix.php b/lib/Doctrine/Import/Informix.php index ec22004d0..65d4528c5 100644 --- a/lib/Doctrine/Import/Informix.php +++ b/lib/Doctrine/Import/Informix.php @@ -29,7 +29,8 @@ Doctrine::autoload('Doctrine_Import'); * @link www.phpdoctrine.com * @since 1.0 */ -class Doctrine_Import_Informix extends Doctrine_Import { +class Doctrine_Import_Informix extends Doctrine_Import +{ protected static $sql = array( 'listTables' => "SELECT tabname,tabtype FROM systables WHERE tabtype IN ('T','V') AND owner != 'informix'", 'listColumns' => "SELECT c.colname, c.coltype, c.collength, d.default, c.colno diff --git a/lib/Doctrine/Import/Mssql.php b/lib/Doctrine/Import/Mssql.php index baed547b1..fe040682c 100644 --- a/lib/Doctrine/Import/Mssql.php +++ b/lib/Doctrine/Import/Mssql.php @@ -31,13 +31,15 @@ Doctrine::autoload('Doctrine_Import'); * @link www.phpdoctrine.com * @since 1.0 */ -class Doctrine_Import_Mssql extends Doctrine_Import { +class Doctrine_Import_Mssql extends Doctrine_Import +{ /** * lists all databases * * @return array */ - public function listDatabases() { + public function listDatabases() + { } /** @@ -45,8 +47,9 @@ class Doctrine_Import_Mssql extends Doctrine_Import { * * @return array */ - public function listFunctions() { - + public function listFunctions() + { + } /** * lists all database triggers @@ -54,7 +57,8 @@ class Doctrine_Import_Mssql extends Doctrine_Import { * @param string|null $database * @return array */ - public function listTriggers($database = null) { + public function listTriggers($database = null) + { } /** @@ -63,7 +67,8 @@ class Doctrine_Import_Mssql extends Doctrine_Import { * @param string|null $database * @return array */ - public function listSequences($database = null) { + public function listSequences($database = null) + { $query = "SELECT name FROM sysobjects WHERE xtype = 'U'"; $table_names = $db->queryCol($query); if (PEAR::isError($table_names)) { @@ -87,8 +92,9 @@ class Doctrine_Import_Mssql extends Doctrine_Import { * @param string $table database table name * @return array */ - public function listTableConstraints($table) { - + public function listTableConstraints($table) + { + } /** * lists table constraints @@ -96,7 +102,8 @@ class Doctrine_Import_Mssql extends Doctrine_Import { * @param string $table database table name * @return array */ - public function listTableColumns($table) { + public function listTableColumns($table) + { $sql = 'EXEC sp_columns @table_name = ' . $this->quoteIdentifier($table); $result = $this->dbh->query($sql)->fetchAll(PDO::FETCH_ASSOC); $columns = array(); @@ -131,8 +138,9 @@ class Doctrine_Import_Mssql extends Doctrine_Import { * @param string $table database table name * @return array */ - public function listTableIndexes($table) { - + public function listTableIndexes($table) + { + } /** * lists tables @@ -140,7 +148,8 @@ class Doctrine_Import_Mssql extends Doctrine_Import { * @param string|null $database * @return array */ - public function listTables($database = null) { + public function listTables($database = null) + { $sql = "SELECT name FROM sysobjects WHERE type = 'U' ORDER BY name"; return $this->dbh->fetchCol($sql); @@ -151,7 +160,8 @@ class Doctrine_Import_Mssql extends Doctrine_Import { * @param string $table database table name * @return array */ - public function listTableTriggers($table) { + public function listTableTriggers($table) + { $table = $db->quote($table, 'text'); $query = "SELECT name FROM sysobjects WHERE xtype = 'TR'"; if (!is_null($table)) { @@ -177,7 +187,8 @@ class Doctrine_Import_Mssql extends Doctrine_Import { * @param string $table database table name * @return array */ - public function listTableViews($table) { + public function listTableViews($table) + { $keyName = 'INDEX_NAME'; $pkName = 'PK_NAME'; if ($db->options['portability'] & Doctrine::PORTABILITY_FIX_CASE) { @@ -212,8 +223,9 @@ class Doctrine_Import_Mssql extends Doctrine_Import { * * @return array */ - public function listUsers() { - + public function listUsers() + { + } /** * lists database views @@ -221,7 +233,8 @@ class Doctrine_Import_Mssql extends Doctrine_Import { * @param string|null $database * @return array */ - public function listViews($database = null) { + public function listViews($database = null) + { $query = "SELECT name FROM sysobjects WHERE xtype = 'V'"; $result = $db->queryCol($query); diff --git a/lib/Doctrine/Import/Mysql.php b/lib/Doctrine/Import/Mysql.php index 769fbb593..992b9b16e 100644 --- a/lib/Doctrine/Import/Mysql.php +++ b/lib/Doctrine/Import/Mysql.php @@ -29,15 +29,17 @@ Doctrine::autoload('Doctrine_Import'); * @link www.phpdoctrine.com * @since 1.0 */ -class Doctrine_Import_Mysql extends Doctrine_Import { +class Doctrine_Import_Mysql extends Doctrine_Import +{ /** * lists all databases * * @return array */ - public function listDatabases() { + public function listDatabases() + { $sql = 'SHOW DATABASES'; - + return $this->dbh->query($sql)->fetchAll(PDO::FETCH_COLUMN); } /** @@ -45,8 +47,9 @@ class Doctrine_Import_Mysql extends Doctrine_Import { * * @return array */ - public function listFunctions() { - + public function listFunctions() + { + } /** * lists all database triggers @@ -54,7 +57,8 @@ class Doctrine_Import_Mysql extends Doctrine_Import { * @param string|null $database * @return array */ - public function listTriggers($database = null) { + public function listTriggers($database = null) + { } /** @@ -63,7 +67,8 @@ class Doctrine_Import_Mysql extends Doctrine_Import { * @param string|null $database * @return array */ - public function listSequences($database = null) { + public function listSequences($database = null) + { $query = "SHOW TABLES"; if (!is_null($database)) { $query .= " FROM $database"; @@ -87,7 +92,8 @@ class Doctrine_Import_Mysql extends Doctrine_Import { * @param string $table database table name * @return array */ - public function listTableConstraints($table) { + public function listTableConstraints($table) + { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { return $db; @@ -137,7 +143,8 @@ class Doctrine_Import_Mysql extends Doctrine_Import { * @param string $table database table name * @return array */ - public function listTableColumns($table) { + public function listTableColumns($table) + { $sql = "DESCRIBE $table"; $result = $this->dbh->query($sql)->fetchAll(PDO::FETCH_ASSOC); $description = array(); @@ -166,7 +173,7 @@ class Doctrine_Import_Mysql extends Doctrine_Import { * @param string $table database table name * @return array */ - public function listTableIndexes($table) + public function listTableIndexes($table) { $key_name = 'Key_name'; $non_unique = 'Non_unique'; @@ -203,10 +210,10 @@ class Doctrine_Import_Mysql extends Doctrine_Import { * @param string|null $database * @return array */ - public function listTables($database = null) + public function listTables($database = null) { $sql = 'SHOW TABLES'; - + return $this->dbh->query($sql)->fetchAll(PDO::FETCH_COLUMN); } /** @@ -215,9 +222,9 @@ class Doctrine_Import_Mysql extends Doctrine_Import { * @param string $table database table name * @return array */ - public function listTableTriggers($table) + public function listTableTriggers($table) { - + } /** * lists table views @@ -225,7 +232,7 @@ class Doctrine_Import_Mysql extends Doctrine_Import { * @param string $table database table name * @return array */ - public function listTableViews($table) + public function listTableViews($table) { } @@ -234,7 +241,7 @@ class Doctrine_Import_Mysql extends Doctrine_Import { * * @return array */ - public function listUsers() + public function listUsers() { return $db->queryCol('SELECT DISTINCT USER FROM USER'); } @@ -244,7 +251,7 @@ class Doctrine_Import_Mysql extends Doctrine_Import { * @param string|null $database * @return array */ - public function listViews($database = null) + public function listViews($database = null) { $query = 'SHOW FULL TABLES'; if (!is_null($database)) { diff --git a/lib/Doctrine/Import/Oracle.php b/lib/Doctrine/Import/Oracle.php index bec2b3d1f..708b3239e 100644 --- a/lib/Doctrine/Import/Oracle.php +++ b/lib/Doctrine/Import/Oracle.php @@ -28,13 +28,14 @@ Doctrine::autoload('Doctrine_Import'); * @link www.phpdoctrine.com * @since 1.0 */ -class Doctrine_Import_Oracle extends Doctrine_Import { +class Doctrine_Import_Oracle extends Doctrine_Import +{ /** * lists all databases * * @return array */ - public function listDatabases() + public function listDatabases() { if ( ! $this->conn->options['emulate_database']) { return $this->conn->raiseError(Doctrine::ERROR_UNSUPPORTED, null, null, @@ -65,7 +66,7 @@ class Doctrine_Import_Oracle extends Doctrine_Import { * * @return array */ - public function listFunctions() + public function listFunctions() { $query = "SELECT name FROM sys.user_source WHERE line = 1 AND type = 'FUNCTION'"; $result = $this->conn->queryCol($query); @@ -83,7 +84,7 @@ class Doctrine_Import_Oracle extends Doctrine_Import { * @param string|null $database * @return array */ - public function listTriggers($database = null) + public function listTriggers($database = null) { } @@ -93,7 +94,7 @@ class Doctrine_Import_Oracle extends Doctrine_Import { * @param string|null $database * @return array */ - public function listSequences($database = null) + public function listSequences($database = null) { $query = "SELECT sequence_name FROM sys.user_sequences"; $tableNames = $this->conn->queryCol($query); @@ -113,7 +114,7 @@ class Doctrine_Import_Oracle extends Doctrine_Import { * @param string $table database table name * @return array */ - public function listTableConstraints($table) + public function listTableConstraints($table) { $table = $this->conn->quote($table, 'text'); @@ -142,7 +143,7 @@ class Doctrine_Import_Oracle extends Doctrine_Import { * @param string $table database table name * @return array */ - public function listTableColumns($table) + public function listTableColumns($table) { $table = $this->conn->quote($table, 'text'); @@ -163,7 +164,8 @@ class Doctrine_Import_Oracle extends Doctrine_Import { * @param string $table database table name * @return array */ - public function listTableIndexes($table) { + public function listTableIndexes($table) + { $table = $this->conn->quote($table, 'text'); $query = 'SELECT index_name name FROM user_indexes'; @@ -192,7 +194,7 @@ class Doctrine_Import_Oracle extends Doctrine_Import { * @param string|null $database * @return array */ - public function listTables($database = null) + public function listTables($database = null) { $query = 'SELECT table_name FROM sys.user_tables'; @@ -211,9 +213,9 @@ class Doctrine_Import_Oracle extends Doctrine_Import { * @param string $table database table name * @return array */ - public function listTableTriggers($table) + public function listTableTriggers($table) { - + } /** * lists table views @@ -221,16 +223,16 @@ class Doctrine_Import_Oracle extends Doctrine_Import { * @param string $table database table name * @return array */ - public function listTableViews($table) + public function listTableViews($table) { - + } /** * lists database users * * @return array */ - public function listUsers() + public function listUsers() { if ($this->conn->options['emulate_database'] && $this->conn->options['database_name_prefix']) { @@ -249,7 +251,7 @@ class Doctrine_Import_Oracle extends Doctrine_Import { * @param string|null $database * @return array */ - public function listViews($database = null) + public function listViews($database = null) { $query = 'SELECT view_name FROM sys.user_views'; $result = $this->conn->queryCol($query); diff --git a/lib/Doctrine/Import/Pgsql.php b/lib/Doctrine/Import/Pgsql.php index 48b1e7126..aaff53a7c 100644 --- a/lib/Doctrine/Import/Pgsql.php +++ b/lib/Doctrine/Import/Pgsql.php @@ -30,8 +30,9 @@ Doctrine::autoload('Doctrine_Import'); * @link www.phpdoctrine.com * @since 1.0 */ -class Doctrine_Import_Pgsql extends Doctrine_Import { - +class Doctrine_Import_Pgsql extends Doctrine_Import +{ + protected $sql = array( 'listDatabases' => 'SELECT datname FROM pg_database', 'listFunctions' => "SELECT @@ -44,19 +45,19 @@ class Doctrine_Import_Pgsql extends Doctrine_Import { AND pr.proisagg = FALSE AND tp.typname <> 'trigger' AND pr.pronamespace IN - (SELECT oid FROM pg_namespace + (SELECT oid FROM pg_namespace WHERE nspname NOT LIKE 'pg_%' AND nspname != 'information_schema'", 'listSequences' => "SELECT - relname - FROM - pg_class + relname + FROM + pg_class WHERE relkind = 'S' AND relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname NOT LIKE 'pg_%' AND nspname != 'information_schema')", 'listTables' => "SELECT c.relname AS table_name FROM pg_class c, pg_user u - WHERE c.relowner = u.usesysid + WHERE c.relowner = u.usesysid AND c.relkind = 'r' AND NOT EXISTS (SELECT 1 FROM pg_views WHERE viewname = c.relname) AND c.relname !~ '^(pg_|sql_)' @@ -71,13 +72,13 @@ class Doctrine_Import_Pgsql extends Doctrine_Import { 'listUsers' => 'SELECT usename FROM pg_user', 'listTableConstraints' => "SELECT relname - FROM - pg_class + FROM + pg_class WHERE oid IN ( SELECT indexrelid FROM pg_index, pg_class - WHERE pg_class.relname = %s - AND pg_class.oid = pg_index.indrelid + WHERE pg_class.relname = %s + AND pg_class.oid = pg_index.indrelid AND (indisunique = 't' OR indisprimary = 't') )", 'listTableIndexes' => "SELECT @@ -85,17 +86,17 @@ class Doctrine_Import_Pgsql extends Doctrine_Import { FROM pg_class WHERE oid IN ( - SELECT indexrelid + SELECT indexrelid FROM pg_index, pg_class - WHERE pg_class.relname=%s - AND pg_class.oid=pg_index.indrelid - AND indisunique != 't' + WHERE pg_class.relname=%s + AND pg_class.oid=pg_index.indrelid + AND indisunique != 't' AND indisprimary != 't' )", 'listTableColumns' => "SELECT - a.attnum, - a.attname AS field, - t.typname AS type, + a.attnum, + a.attname AS field, + t.typname AS type, format_type(a.atttypid, a.atttypmod) AS complete_type, a.attnotnull AS isnotnull, (SELECT 't' @@ -122,7 +123,8 @@ class Doctrine_Import_Pgsql extends Doctrine_Import { * @param string|null $database * @return array */ - public function listTriggers($database = null) { + public function listTriggers($database = null) + { } /** @@ -131,10 +133,11 @@ class Doctrine_Import_Pgsql extends Doctrine_Import { * @param string $table database table name * @return array */ - public function listTableConstraints($table) { + public function listTableConstraints($table) + { $table = $this->conn->quote($table); $query = sprintf($this->sql['listTableConstraints'], $table); - + return $this->conn->fetchColumn($query); } /** @@ -143,7 +146,8 @@ class Doctrine_Import_Pgsql extends Doctrine_Import { * @param string $table database table name * @return array */ - public function listTableColumns($table) { + public function listTableColumns($table) + { $result = $this->dbh->query($this->sql['listTableColumns'])->fetchAll(PDO::FETCH_ASSOC); $columns = array(); @@ -171,7 +175,8 @@ class Doctrine_Import_Pgsql extends Doctrine_Import { * @param string $table database table name * @return array */ - public function listTableIndexes($table) { + public function listTableIndexes($table) + { $table = $this->conn->quote($table); $query = sprintf($this->sql['listTableIndexes'], $table); @@ -183,7 +188,8 @@ class Doctrine_Import_Pgsql extends Doctrine_Import { * @param string|null $database * @return array */ - public function listTables($database = null) { + public function listTables($database = null) + { return $this->dbh->query($this->sql['listTables'])->fetchAll(PDO::FETCH_ASSOC); } /** @@ -192,8 +198,9 @@ class Doctrine_Import_Pgsql extends Doctrine_Import { * @param string $table database table name * @return array */ - public function listTableTriggers($table) { - + public function listTableTriggers($table) + { + } /** * list the views in the database that reference a given table @@ -201,7 +208,8 @@ class Doctrine_Import_Pgsql extends Doctrine_Import { * @param string $table database table name * @return array */ - public function listTableViews($table) { + public function listTableViews($table) + { return $this->conn->fetchColumn($query); } } diff --git a/lib/Doctrine/Import/Reader/Db.php b/lib/Doctrine/Import/Reader/Db.php index 86ec03bb5..8b8decfa0 100644 --- a/lib/Doctrine/Import/Reader/Db.php +++ b/lib/Doctrine/Import/Reader/Db.php @@ -57,7 +57,8 @@ class Doctrine_Import_Reader_Db extends Doctrine_Import_Reader * @param object pdo * @return * @access public */ - public function setPdo( $pdo ) { + public function setPdo( $pdo ) + { } // end of member function setPdo diff --git a/lib/Doctrine/Import/Reader/Propel.php b/lib/Doctrine/Import/Reader/Propel.php index dc3cc532f..d54cc75d1 100644 --- a/lib/Doctrine/Import/Reader/Propel.php +++ b/lib/Doctrine/Import/Reader/Propel.php @@ -55,10 +55,12 @@ class Doctrine_Import_Reader_Xml_Propel extends Doctrine_Import_Reader * @param string xml * @return * @access public */ - public function setXml( $xml ) { + public function setXml( $xml ) + { } // end of member function setXml - public function read() { } + public function read() + { } } // end of Doctrine_Import_Reader_Xml_Propel diff --git a/lib/Doctrine/Import/Sqlite.php b/lib/Doctrine/Import/Sqlite.php index 5f3aa67d5..a98b1f15f 100644 --- a/lib/Doctrine/Import/Sqlite.php +++ b/lib/Doctrine/Import/Sqlite.php @@ -29,13 +29,15 @@ Doctrine::autoload('Doctrine_Import'); * @link www.phpdoctrine.com * @since 1.0 */ -class Doctrine_Import_Sqlite extends Doctrine_Import { +class Doctrine_Import_Sqlite extends Doctrine_Import +{ /** * lists all databases * * @return array */ - public function listDatabases() { + public function listDatabases() + { } /** @@ -43,8 +45,9 @@ class Doctrine_Import_Sqlite extends Doctrine_Import { * * @return array */ - public function listFunctions() { - + public function listFunctions() + { + } /** * lists all database triggers @@ -52,7 +55,8 @@ class Doctrine_Import_Sqlite extends Doctrine_Import { * @param string|null $database * @return array */ - public function listTriggers($database = null) { + public function listTriggers($database = null) + { } /** @@ -61,7 +65,8 @@ class Doctrine_Import_Sqlite extends Doctrine_Import { * @param string|null $database * @return array */ - public function listSequences($database = null) { + public function listSequences($database = null) + { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { return $db; @@ -89,7 +94,8 @@ class Doctrine_Import_Sqlite extends Doctrine_Import { * @param string $table database table name * @return array */ - public function listTableConstraints($table) { + public function listTableConstraints($table) + { $db =& $this->getDBInstance(); if (PEAR::isError($db)) { return $db; @@ -121,7 +127,7 @@ class Doctrine_Import_Sqlite extends Doctrine_Import { if ($db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) { $result = array_change_key_case($result, $db->options['field_case']); } - return array_keys($result); + return array_keys($result); } /** * lists table constraints @@ -129,7 +135,8 @@ class Doctrine_Import_Sqlite extends Doctrine_Import { * @param string $table database table name * @return array */ - public function listTableColumns($table) { + public function listTableColumns($table) + { $sql = 'PRAGMA table_info(' . $table . ')'; $result = $this->dbh->query($sql)->fetchAll(PDO::FETCH_ASSOC); @@ -154,7 +161,8 @@ class Doctrine_Import_Sqlite extends Doctrine_Import { * @param string $table database table name * @return array */ - public function listTableIndexes($table) { + public function listTableIndexes($table) + { $sql = 'PRAGMA index_list(' . $table . ')'; $result = $this->dbh->query($sql)->fetchAll(PDO::FETCH_ASSOC); @@ -169,14 +177,15 @@ class Doctrine_Import_Sqlite extends Doctrine_Import { * @param string|null $database * @return array */ - public function listTables($database = null) { + public function listTables($database = null) + { $sql = "SELECT name FROM sqlite_master WHERE type = 'table' " . "UNION ALL SELECT name FROM sqlite_temp_master " . "WHERE type = 'table' ORDER BY name"; $tables = array(); $stmt = $this->dbh->query($sql); - + $data = $stmt->fetchAll(PDO::FETCH_COLUMN); foreach ($data as $table) { @@ -190,8 +199,9 @@ class Doctrine_Import_Sqlite extends Doctrine_Import { * @param string $table database table name * @return array */ - public function listTableTriggers($table) { - + public function listTableTriggers($table) + { + } /** * lists table views @@ -199,16 +209,18 @@ class Doctrine_Import_Sqlite extends Doctrine_Import { * @param string $table database table name * @return array */ - public function listTableViews($table) { - + public function listTableViews($table) + { + } /** * lists database users * * @return array */ - public function listUsers() { - + public function listUsers() + { + } /** * lists database views @@ -216,8 +228,9 @@ class Doctrine_Import_Sqlite extends Doctrine_Import { * @param string|null $database * @return array */ - public function listViews($database = null) { - + public function listViews($database = null) + { + } } diff --git a/lib/Doctrine/Lib.php b/lib/Doctrine/Lib.php index 7696a5167..b256b4368 100644 --- a/lib/Doctrine/Lib.php +++ b/lib/Doctrine/Lib.php @@ -29,13 +29,15 @@ * @version $Revision$ * @author Konsta Vesterinen */ -class Doctrine_Lib { +class Doctrine_Lib +{ /** * @param integer $state the state of record * @see Doctrine_Record::STATE_* constants * @return string string representation of given state */ - public static function getRecordStateAsString($state) { + public static function getRecordStateAsString($state) + { switch ($state) { case Doctrine_Record::STATE_PROXY: return "proxy"; @@ -59,7 +61,8 @@ class Doctrine_Lib { * @param Doctrine_Record $record * @return string */ - public static function getRecordAsString(Doctrine_Record $record) { + public static function getRecordAsString(Doctrine_Record $record) + { $r[] = "
";
         $r[] = "Component  : ".$record->getTable()->getComponentName();
         $r[] = "ID         : ".$record->obtainIdentifier();
@@ -74,7 +77,8 @@ class Doctrine_Lib {
      * returns a given connection state as string
      * @param integer $state        connection state
      */
-    public static function getConnectionStateAsString($state) {
+    public static function getConnectionStateAsString($state)
+    {
         switch ($state) {
         case Doctrine_Transaction::STATE_SLEEP:
             return "open";
@@ -92,7 +96,8 @@ class Doctrine_Lib {
      * @param Doctrine_Connection $connection
      * @return string
      */
-    public static function getConnectionAsString(Doctrine_Connection $connection) {
+    public static function getConnectionAsString(Doctrine_Connection $connection)
+    {
         $r[] = "
";
         $r[] = "Doctrine_Connection object";
         $r[] = "State               : ".Doctrine_Lib::getConnectionStateAsString($connection->getTransaction()->getState());
@@ -124,7 +129,8 @@ class Doctrine_Lib {
      * @param Doctrine_Table $table
      * @return string
      */
-    public static function getTableAsString(Doctrine_Table $table) {
+    public static function getTableAsString(Doctrine_Table $table)
+    {
         $r[] = "
";
         $r[] = "Component   : ".$table->getComponentName();
         $r[] = "Table       : ".$table->getTableName();
@@ -134,7 +140,8 @@ class Doctrine_Lib {
     /**
      * @return string
      */
-    public static function formatSql($sql) {
+    public static function formatSql($sql)
+    {
         $e = explode("\n",$sql);
         $color = "367FAC";
         $l = $sql;
@@ -159,7 +166,8 @@ class Doctrine_Lib {
      * @param Doctrine_Collection $collection
      * @return string
      */
-    public static function getCollectionAsString(Doctrine_Collection $collection) {
+    public static function getCollectionAsString(Doctrine_Collection $collection)
+    {
         $r[] = "
";
         $r[] = get_class($collection);
 
diff --git a/lib/Doctrine/Locking/Exception.php b/lib/Doctrine/Locking/Exception.php
index 228210bd9..a89eda0bb 100644
--- a/lib/Doctrine/Locking/Exception.php
+++ b/lib/Doctrine/Locking/Exception.php
@@ -12,4 +12,5 @@
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Locking_Exception extends Doctrine_Exception {}
+class Doctrine_Locking_Exception extends Doctrine_Exception
+{}
diff --git a/lib/Doctrine/Locking/Manager/Pessimistic.php b/lib/Doctrine/Locking/Manager/Pessimistic.php
index f8366e356..d38fb2b04 100644
--- a/lib/Doctrine/Locking/Manager/Pessimistic.php
+++ b/lib/Doctrine/Locking/Manager/Pessimistic.php
@@ -33,7 +33,8 @@
  * @category    Object Relational Mapping
  * @version     $Revision$
  */
-class Doctrine_Locking_Manager_Pessimistic {
+class Doctrine_Locking_Manager_Pessimistic
+{
     /**
      * The conn that is used by the locking manager
      *
@@ -53,7 +54,8 @@ class Doctrine_Locking_Manager_Pessimistic {
      *
      * @param Doctrine_Connection $conn The database connection to use
      */
-    public function __construct(Doctrine_Connection $conn) {
+    public function __construct(Doctrine_Connection $conn)
+    {
         $this->conn = $conn;
 
         if ($this->conn->getAttribute(Doctrine::ATTR_CREATE_TABLES) === true) {
@@ -94,7 +96,8 @@ class Doctrine_Locking_Manager_Pessimistic {
      *                  holds a lock on this record
      * @throws Doctrine_Locking_Exception  If the locking failed due to database errors
      */
-    public function getLock(Doctrine_Record $record, $userIdent) {
+    public function getLock(Doctrine_Record $record, $userIdent)
+    {
         $objectType = $record->getTable()->getComponentName();
         $key        = $record->obtainIdentifier();
 
@@ -159,7 +162,8 @@ class Doctrine_Locking_Manager_Pessimistic {
      * @return boolean  TRUE if a lock was released, FALSE if no lock was released
      * @throws Doctrine_Locking_Exception If the release procedure failed due to database errors
      */
-    public function releaseLock(Doctrine_Record $record, $userIdent) {
+    public function releaseLock(Doctrine_Record $record, $userIdent)
+    {
         $objectType = $record->getTable()->getComponentName();
         $key        = $record->obtainIdentifier();
 
@@ -195,7 +199,8 @@ class Doctrine_Locking_Manager_Pessimistic {
      * @return mixed  The unique user identifier for the specified lock
      * @throws Doctrine_Locking_Exception If the query failed due to database errors
      */
-    private function _getLockingUserIdent($objectType, $key) {
+    private function _getLockingUserIdent($objectType, $key)
+    {
         if (is_array($key)) {
             // Composite key
             $key = implode('|', $key);
@@ -229,7 +234,8 @@ class Doctrine_Locking_Manager_Pessimistic {
      * @param Doctrine_Record $lockedRecord  The record.
      * @return mixed The unique user identifier that identifies the owner of the lock.
      */
-    public function getLockOwner($lockedRecord) {
+    public function getLockOwner($lockedRecord)
+    {
         $objectType = $lockedRecord->getTable()->getComponentName();
         $key        = $lockedRecord->obtainIdentifier();
         return $this->_getLockingUserIdent($objectType, $key);
@@ -246,7 +252,8 @@ class Doctrine_Locking_Manager_Pessimistic {
      * @return integer The number of locks that have been released
      * @throws Doctrine_Locking_Exception If the release process failed due to database errors
      */
-    public function releaseAgedLocks($age = 900, $objectType = null, $userIdent = null) {
+    public function releaseAgedLocks($age = 900, $objectType = null, $userIdent = null)
+    {
         $age = time() - $age;
 
         try {
diff --git a/lib/Doctrine/Manager.php b/lib/Doctrine/Manager.php
index 2b6c59624..6600c79e7 100644
--- a/lib/Doctrine/Manager.php
+++ b/lib/Doctrine/Manager.php
@@ -20,7 +20,7 @@
  */
 /**
  *
- * Doctrine_Manager is the base component of all doctrine based projects. 
+ * Doctrine_Manager is the base component of all doctrine based projects.
  * It opens and keeps track of all connections (database connections).
  *
  * @package     Doctrine
@@ -31,7 +31,8 @@
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Manager extends Doctrine_Configurable implements Countable, IteratorAggregate {
+class Doctrine_Manager extends Doctrine_Configurable implements Countable, IteratorAggregate
+{
     /**
      * @var array $connections      an array containing all the opened connections
      */
@@ -62,7 +63,8 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
      *
      * this is private constructor (use getInstance to get an instance of this class)
      */
-    private function __construct() {
+    private function __construct()
+    {
         $this->root = dirname(__FILE__);
         $this->null = new Doctrine_Null;
 
@@ -74,7 +76,8 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
     /**
      * @return Doctrine_Null
      */
-    final public function getNullObject() {
+    final public function getNullObject()
+    {
         return $this->null;
     }
     /**
@@ -83,7 +86,8 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
      *
      * @return boolean
      */
-    final public function setDefaultAttributes() {
+    final public function setDefaultAttributes()
+    {
         static $init = false;
         if ( ! $init) {
             $init = true;
@@ -119,7 +123,8 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
      *
      * @return string
      */
-    final public function getRoot() {
+    final public function getRoot()
+    {
         return $this->root;
     }
     /**
@@ -129,7 +134,8 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
      *
      * @return Doctrine_Manager
      */
-    public static function getInstance() {
+    public static function getInstance()
+    {
         static $instance;
         if ( ! isset($instance)) {
             $instance = new self();
@@ -138,11 +144,11 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
     }
     /**
      * connection
-     * 
+     *
      * if the adapter parameter is set this method acts as
      * a short cut for Doctrine_Manager::getInstance()->openConnection($adapter, $name);
      *
-     * if the adapter paramater is not set this method acts as 
+     * if the adapter paramater is not set this method acts as
      * a short cut for Doctrine_Manager::getInstance()->getCurrentConnection()
      *
      * @param PDO|Doctrine_Adapter_Interface $adapter   database driver
@@ -150,13 +156,14 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
      * @throws Doctrine_Manager_Exception               if trying to bind a connection with an existing name
      * @return Doctrine_Connection
      */
-    public static function connection($adapter = null, $name = null) {
+    public static function connection($adapter = null, $name = null)
+    {
         if ($adapter == null) {
             return Doctrine_Manager::getInstance()->getCurrentConnection();
         } else {
             return Doctrine_Manager::getInstance()->openConnection($adapter, $name);
         }
-    } 
+    }
     /**
      * openConnection
      * opens a new connection and saves it to Doctrine_Manager->connections
@@ -166,7 +173,8 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
      * @throws Doctrine_Manager_Exception               if trying to bind a connection with an existing name
      * @return Doctrine_Connection
      */
-    public function openConnection($adapter, $name = null) {
+    public function openConnection($adapter, $name = null)
+    {
         if ( ! ($adapter instanceof PDO) && ! in_array('Doctrine_Adapter_Interface', class_implements($adapter))) {
             throw new Doctrine_Manager_Exception("First argument should be an instance of PDO or implement Doctrine_Adapter_Interface");
         }
@@ -216,7 +224,8 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
         $this->currIndex = $name;
         return $this->connections[$name];
     }
-    public function openSession(PDO $pdo, $name = null) {
+    public function openSession(PDO $pdo, $name = null)
+    {
         return $this->openConnection($pdo, $name);
     }
     /**
@@ -225,7 +234,8 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
      * @return object Doctrine_Connection
      * @throws Doctrine_Manager_Exception   if trying to get a non-existent connection
      */
-    public function getConnection($name) {
+    public function getConnection($name)
+    {
         if ( ! isset($this->connections[$name])) {
             throw new Doctrine_Manager_Exception('Unknown connection: ' . $name);
         }
@@ -242,7 +252,8 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
      * @param string $connectionName
      * @return boolean
      */
-    public function bindComponent($componentName, $connectionName) {
+    public function bindComponent($componentName, $connectionName)
+    {
         $this->bound[$componentName] = $connectionName;
     }
     /**
@@ -251,13 +262,14 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
      * @param string $componentName
      * @return Doctrine_Connection
      */
-    public function getConnectionForComponent($componentName = null) {
+    public function getConnectionForComponent($componentName = null)
+    {
         if (isset($this->bound[$componentName])) {
             return $this->getConnection($this->bound[$componentName]);
         }
         return $this->getCurrentConnection();
     }
-    /** 
+    /**
      * getTable
      * this is the same as Doctrine_Connection::getTable() except
      * that it works seamlessly in multi-server/connection environment
@@ -266,7 +278,8 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
      * @param string $componentName
      * @return Doctrine_Table
      */
-    public function getTable($componentName) {
+    public function getTable($componentName)
+    {
         return $this->getConnectionForComponent($componentName)->getTable($componentName);
     }
     /**
@@ -275,7 +288,8 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
      * @param Doctrine_Connection $connection
      * @return void
      */
-    public function closeConnection(Doctrine_Connection $connection) {
+    public function closeConnection(Doctrine_Connection $connection)
+    {
         $connection->close();
         unset($connection);
     }
@@ -285,7 +299,8 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
      *
      * @return array
      */
-    public function getConnections() {
+    public function getConnections()
+    {
         return $this->connections;
     }
     /**
@@ -296,7 +311,8 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
      * @throws InvalidKeyException
      * @return void
      */
-    public function setCurrentConnection($key) {
+    public function setCurrentConnection($key)
+    {
         $key = (string) $key;
         if ( ! isset($this->connections[$key])) {
             throw new InvalidKeyException();
@@ -309,7 +325,8 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
      *
      * @return integer
      */
-    public function count() {
+    public function count()
+    {
         return count($this->connections);
     }
     /**
@@ -318,7 +335,8 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
      *
      * @return ArrayIterator
      */
-    public function getIterator() {
+    public function getIterator()
+    {
         return new ArrayIterator($this->connections);
     }
     /**
@@ -328,7 +346,8 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
      * @throws Doctrine_Connection_Exception       if there are no open connections
      * @return Doctrine_Connection
      */
-    public function getCurrentConnection() {
+    public function getCurrentConnection()
+    {
         $i = $this->currIndex;
         if ( ! isset($this->connections[$i])) {
             throw new Doctrine_Connection_Exception();
@@ -341,7 +360,8 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
      *
      * @return string
      */
-    public function __toString() {
+    public function __toString()
+    {
         $r[] = "
";
         $r[] = "Doctrine_Manager";
         $r[] = "Connections : ".count($this->connections);
diff --git a/lib/Doctrine/Manager/Exception.php b/lib/Doctrine/Manager/Exception.php
index 5b87ef65c..939dcadd7 100644
--- a/lib/Doctrine/Manager/Exception.php
+++ b/lib/Doctrine/Manager/Exception.php
@@ -29,4 +29,5 @@
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Manager_Exception extends Doctrine_Exception { }
+class Doctrine_Manager_Exception extends Doctrine_Exception
+{ }
diff --git a/lib/Doctrine/Null.php b/lib/Doctrine/Null.php
index 47742a327..8662f86ec 100644
--- a/lib/Doctrine/Null.php
+++ b/lib/Doctrine/Null.php
@@ -32,4 +32,5 @@
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-final class Doctrine_Null { }
+final class Doctrine_Null
+{ }
diff --git a/lib/Doctrine/Query/Condition.php b/lib/Doctrine/Query/Condition.php
index 72aa98ba2..9c04fc6f4 100644
--- a/lib/Doctrine/Query/Condition.php
+++ b/lib/Doctrine/Query/Condition.php
@@ -1,7 +1,8 @@
 
  */
-class Doctrine_Query_From extends Doctrine_Query_Part {
+class Doctrine_Query_From extends Doctrine_Query_Part
+{
 
     /**
      * DQL FROM PARSER
@@ -39,7 +40,8 @@ class Doctrine_Query_From extends Doctrine_Query_Part {
      * @param string $str
      * @return void
      */
-    final public function parse($str) {
+    final public function parse($str)
+    {
         $str = trim($str);
         $parts = Doctrine_Query::bracketExplode($str, 'JOIN');
 
@@ -82,7 +84,8 @@ class Doctrine_Query_From extends Doctrine_Query_Part {
         }
     }
 
-    public function __toString() {
+    public function __toString()
+    {
         return ( ! empty($this->parts))?implode(", ", $this->parts):'';
     }
 }
diff --git a/lib/Doctrine/Query/Groupby.php b/lib/Doctrine/Query/Groupby.php
index d8ce741d3..11787cdf0 100644
--- a/lib/Doctrine/Query/Groupby.php
+++ b/lib/Doctrine/Query/Groupby.php
@@ -1,7 +1,8 @@
 parts))?implode(", ", $this->parts):'';
     }
 }
diff --git a/lib/Doctrine/Query/Having.php b/lib/Doctrine/Query/Having.php
index ed6ab858d..6c6e462df 100644
--- a/lib/Doctrine/Query/Having.php
+++ b/lib/Doctrine/Query/Having.php
@@ -1,14 +1,16 @@
 parts))?implode(' AND ', $this->parts):'';
     }
 }
diff --git a/lib/Doctrine/Query/Orderby.php b/lib/Doctrine/Query/Orderby.php
index 0ee106db9..6435b30c6 100644
--- a/lib/Doctrine/Query/Orderby.php
+++ b/lib/Doctrine/Query/Orderby.php
@@ -30,7 +30,8 @@ Doctrine::autoload('Doctrine_Query_Part');
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Query_Orderby extends Doctrine_Query_Part {
+class Doctrine_Query_Orderby extends Doctrine_Query_Part
+{
     /**
      * DQL ORDER BY PARSER
      * parses the order by part of the query string
@@ -38,7 +39,8 @@ class Doctrine_Query_Orderby extends Doctrine_Query_Part {
      * @param string $str
      * @return void
      */
-    public function parse($str) {
+    public function parse($str)
+    {
         $ret = array();
 
         foreach (explode(',', trim($str)) as $r) {
@@ -67,7 +69,8 @@ class Doctrine_Query_Orderby extends Doctrine_Query_Part {
 
         return implode(', ', $ret);
     }
-    public function __toString() {
+    public function __toString()
+    {
         return ( ! empty($this->parts))?implode(', ', $this->parts):'';
     }
 }
diff --git a/lib/Doctrine/Query/Part.php b/lib/Doctrine/Query/Part.php
index 02c519c64..761cce571 100644
--- a/lib/Doctrine/Query/Part.php
+++ b/lib/Doctrine/Query/Part.php
@@ -30,7 +30,8 @@ Doctrine::autoload("Doctrine_Access");
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-abstract class Doctrine_Query_Part extends Doctrine_Access {
+abstract class Doctrine_Query_Part extends Doctrine_Access
+{
     /**
      * @var Doctrine_Query $query           the query object associated with this parser
      */
@@ -46,19 +47,22 @@ abstract class Doctrine_Query_Part extends Doctrine_Access {
     /**
      * @param Doctrine_Query $query         the query object associated with this parser
      */
-    public function __construct(Doctrine_Query $query) {
+    public function __construct(Doctrine_Query $query)
+    {
         $this->query = $query;
     }
     /**
      * @return string $name                 the name of this parser
      */
-    public function getName() {
+    public function getName()
+    {
         return $this->name;
     }
     /**
      * @return Doctrine_Query $query        the query object associated with this parser
      */
-    public function getQuery() {
+    public function getQuery()
+    {
         return $this->query;
     }
     /**
@@ -67,11 +71,14 @@ abstract class Doctrine_Query_Part extends Doctrine_Access {
      * @param string $value
      * @return void
      */
-    public function add($value) {
+    public function add($value)
+    {
         $method = "parse".$this->name;
         $this->query->$method($value);
     }
 
-    public function get($name) { }
-    public function set($name, $value) { }
+    public function get($name)
+    { }
+    public function set($name, $value)
+    { }
 }
diff --git a/lib/Doctrine/Query/Set.php b/lib/Doctrine/Query/Set.php
index 5b9fd6242..dfec04206 100644
--- a/lib/Doctrine/Query/Set.php
+++ b/lib/Doctrine/Query/Set.php
@@ -29,8 +29,10 @@
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Query_Set extends Doctrine_Query_Part {
-    public function parse($dql) {
+class Doctrine_Query_Set extends Doctrine_Query_Part
+{
+    public function parse($dql)
+    {
         $parts = Doctrine_Query::sqlExplode($dql, ',');
 
         $result = array();
diff --git a/lib/Doctrine/Query/Where.php b/lib/Doctrine/Query/Where.php
index bb0ff04f7..551880bf4 100644
--- a/lib/Doctrine/Query/Where.php
+++ b/lib/Doctrine/Query/Where.php
@@ -1,7 +1,8 @@
 parts))?implode(' AND ', $this->parts):'';
     }
 }
diff --git a/lib/Doctrine/RawSql.php b/lib/Doctrine/RawSql.php
index 8d083829b..e76824ffb 100644
--- a/lib/Doctrine/RawSql.php
+++ b/lib/Doctrine/RawSql.php
@@ -30,7 +30,8 @@ Doctrine::autoload('Doctrine_Hydrate');
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_RawSql extends Doctrine_Hydrate {
+class Doctrine_RawSql extends Doctrine_Hydrate
+{
     /**
      * @var array $fields
      */
@@ -43,7 +44,8 @@ class Doctrine_RawSql extends Doctrine_Hydrate {
      * @param array $args
      * @return Doctrine_RawSql
      */
-    public function __call($name, $args) {
+    public function __call($name, $args)
+    {
         if ( ! isset($this->parts[$name])) {
             throw new Doctrine_RawSql_Exception("Unknown overload method $name. Availible overload methods are ".implode(" ",array_keys($this->parts)));
         }
@@ -60,7 +62,8 @@ class Doctrine_RawSql extends Doctrine_Hydrate {
     /**
      * get
      */
-    public function get($name) {
+    public function get($name)
+    {
         if ( ! isset($this->parts[$name])) {
             throw new Doctrine_RawSql_Exception('Unknown query part '.$name);
         }
@@ -72,7 +75,8 @@ class Doctrine_RawSql extends Doctrine_Hydrate {
      * @param string $query
      * @return Doctrine_RawSql
      */
-    public function parseQuery($query) {
+    public function parseQuery($query)
+    {
         preg_match_all('/{([^}{]*)}/U', $query, $m);
 
         $this->fields = $m[1];
@@ -128,7 +132,8 @@ class Doctrine_RawSql extends Doctrine_Hydrate {
      *
      * @return string
      */
-    public function getQuery() {
+    public function getQuery()
+    {
         foreach ($this->fields as $field) {
             $e = explode(".", $field);
             if ( ! isset($e[1])) {
@@ -191,7 +196,8 @@ class Doctrine_RawSql extends Doctrine_Hydrate {
      *
      * @return array
      */
-    public function getFields() {
+    public function getFields()
+    {
         return $this->fields;
     }
     /**
@@ -201,7 +207,8 @@ class Doctrine_RawSql extends Doctrine_Hydrate {
      * @param string $componentName
      * @return Doctrine_RawSql
      */
-    public function addComponent($tableAlias, $componentName) {
+    public function addComponent($tableAlias, $componentName)
+    {
         $e = explode('.', $componentName);
 
         $currPath = '';
diff --git a/lib/Doctrine/RawSql/Exception.php b/lib/Doctrine/RawSql/Exception.php
index 32d581ab3..fe465228f 100644
--- a/lib/Doctrine/RawSql/Exception.php
+++ b/lib/Doctrine/RawSql/Exception.php
@@ -30,4 +30,5 @@ Doctrine::autoload('Doctrine_Exception');
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_RawSql_Exception extends Doctrine_Exception { }
+class Doctrine_RawSql_Exception extends Doctrine_Exception
+{ }
diff --git a/lib/Doctrine/Record.php b/lib/Doctrine/Record.php
index 09e3bb9c2..9154c336a 100644
--- a/lib/Doctrine/Record.php
+++ b/lib/Doctrine/Record.php
@@ -31,7 +31,8 @@ Doctrine::autoload('Doctrine_Access');
  * @since       1.0
  * @version     $Revision$
  */
-abstract class Doctrine_Record extends Doctrine_Access implements Countable, IteratorAggregate, Serializable {
+abstract class Doctrine_Record extends Doctrine_Access implements Countable, IteratorAggregate, Serializable
+{
     /**
      * STATE CONSTANTS
      */
@@ -135,7 +136,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      *                                         open connections
      * @throws Doctrine_Record_Exception       if the cleanData operation fails somehow
      */
-    public function __construct($table = null, $isNewEntry = false) {
+    public function __construct($table = null, $isNewEntry = false)
+    {
         if (isset($table) && $table instanceof Doctrine_Table) {
             $this->_table = $table;
             $exists = ( ! $isNewEntry);
@@ -213,13 +215,15 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @param Doctrine_Null $null
      * @return void
      */
-    public static function initNullObject(Doctrine_Null $null) {
+    public static function initNullObject(Doctrine_Null $null)
+    {
         self::$null = $null;
     }
     /**
      * @return Doctrine_Null
      */
-    public static function getNullObject() {
+    public static function getNullObject()
+    {
         return self::$null;
     }
     /**
@@ -229,7 +233,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      *
      * @return void
      */
-    public function setUp() { }
+    public function setUp()
+    { }
     /**
      * construct
      * Empty tempalte method to provide concrete Record classes with the possibility
@@ -237,14 +242,16 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      *
      * @return void
      */
-    public function construct() { }
+    public function construct()
+    { }
     /**
      * getOID
      * returns the object identifier
      *
      * @return integer
      */
-    public function getOID() {
+    public function getOID()
+    {
         return $this->oid;
     }
     /**
@@ -252,7 +259,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      *
      * @return boolean                          whether or not this record passes all column validations
      */
-    public function isValid() {
+    public function isValid()
+    {
         if ( ! $this->_table->getAttribute(Doctrine::ATTR_VLD)) {
             return true;
         }
@@ -276,25 +284,29 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * to hook into the validation procedure, doing any custom / specialized
      * validations that are neccessary.
      */
-    protected function validate() {}
+    protected function validate()
+    {}
     /**
      * Empty tempalte method to provide concrete Record classes with the possibility
      * to hook into the validation procedure only when the record is going to be
      * updated.
      */
-    protected function validateOnUpdate() {}
+    protected function validateOnUpdate()
+    {}
     /**
      * Empty tempalte method to provide concrete Record classes with the possibility
      * to hook into the validation procedure only when the record is going to be
      * inserted into the data store the first time.
      */
-    protected function validateOnInsert() {}
+    protected function validateOnInsert()
+    {}
     /**
      * getErrorStack
      *
      * @return Doctrine_Validator_ErrorStack    returns the errorStack associated with this record
      */
-    public function getErrorStack() {
+    public function getErrorStack()
+    {
         return $this->_errorStack;
     }
     /**
@@ -304,7 +316,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @param boolean $overwrite                whether or not to overwrite the already set values
      * @return boolean
      */
-    public function setDefaultValues($overwrite = false) {
+    public function setDefaultValues($overwrite = false)
+    {
         if ( ! $this->_table->hasDefaultValues()) {
             return false;
         }
@@ -345,7 +358,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      *
      * @return integer
      */
-    private function cleanData($debug = false) {
+    private function cleanData($debug = false)
+    {
         $tmp = $this->_data;
 
         $this->_data = array();
@@ -404,7 +418,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @param boolean $exists               whether or not this record exists in persistent data store
      * @return void
      */
-    private function prepareIdentifiers($exists = true) {
+    private function prepareIdentifiers($exists = true)
+    {
         switch ($this->_table->getIdentifierType()) {
         case Doctrine_Identifier::AUTO_INCREMENT:
         case Doctrine_Identifier::SEQUENCE:
@@ -446,7 +461,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      *
      * @return array
      */
-    public function serialize() {
+    public function serialize()
+    {
         $this->_table->getAttribute(Doctrine::ATTR_LISTENER)->onSleep($this);
 
         $vars = get_object_vars($this);
@@ -483,7 +499,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @throws Doctrine_Record_Exception        if the cleanData operation fails somehow
      * @return void
      */
-    public function unserialize($serialized) {
+    public function unserialize($serialized)
+    {
         $manager    = Doctrine_Manager::getInstance();
         $connection    = $manager->getCurrentConnection();
 
@@ -513,7 +530,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @see Doctrine_Record::STATE_* constants
      * @return integer
      */
-    public function getState() {
+    public function getState()
+    {
         return $this->_state;
     }
     /**
@@ -526,7 +544,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @throws Doctrine_Record_State_Exception      if trying to set an unknown state
      * @return null|integer
      */
-    public function state($state = null) {
+    public function state($state = null)
+    {
         if ($state == null) {
             return $this->_state;
         }
@@ -565,7 +584,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      *                                          this record represents does not exist anymore)
      * @return boolean
      */
-    final public function refresh() {
+    final public function refresh()
+    {
         $id = $this->obtainIdentifier();
         if ( ! is_array($id)) {
             $id = array($id);
@@ -603,7 +623,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @throws Doctrine_Record_Exception        When the primary key of this record doesn't match the primary key fetched from a collection
      * @return void
      */
-    final public function factoryRefresh() {
+    final public function factoryRefresh()
+    {
         $this->_data = $this->_table->getData();
         $old  = $this->_id;
 
@@ -625,7 +646,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      *
      * @return object Doctrine_Table        a Doctrine_Table object
      */
-    final public function getTable() {
+    final public function getTable()
+    {
         return $this->_table;
     }
     /**
@@ -634,7 +656,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      *
      * @return array                        an array containing all the properties
      */
-    final public function getData() {
+    final public function getData()
+    {
         return $this->_data;
     }
     /**
@@ -647,7 +670,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @return mixed
      */
 
-    public function rawGet($name) {
+    public function rawGet($name)
+    {
         if ( ! isset($this->_data[$name])) {
             throw new Doctrine_Record_Exception('Unknown property '. $name);
         }
@@ -663,7 +687,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      *
      * @return boolean
      */
-    public function load() {
+    public function load()
+    {
         // only load the data from database if the Doctrine_Record is in proxy state
         if ($this->_state == Doctrine_Record::STATE_PROXY) {
             $this->refresh();
@@ -683,7 +708,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @throws Doctrine_Record_Exception        if trying to get a value of unknown property / related component
      * @return mixed
      */
-    public function get($name, $invoke = true) {
+    public function get($name, $invoke = true)
+    {
 
         $listener = $this->_table->getAttribute(Doctrine::ATTR_LISTENER);
         $value    = self::$null;
@@ -745,7 +771,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @param mixed $value                  mixed value to be mapped
      * @return void
      */
-    public function mapValue($name, $value) {
+    public function mapValue($name, $value)
+    {
         $name = strtolower($name);
         $this->_values[$name] = $value;
     }
@@ -763,7 +790,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      *
      * @return Doctrine_Record
      */
-    public function set($name, $value, $load = true) {
+    public function set($name, $value, $load = true)
+    {
         $lower = strtolower($name);
 
         if (isset($this->_data[$lower])) {
@@ -808,7 +836,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
         }
     }
 
-    public function coreSetRelated($name, $value) {
+    public function coreSetRelated($name, $value)
+    {
         $rel = $this->_table->getRelation($name);
 
         // one-to-many or one-to-one relation
@@ -847,7 +876,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @param string $name
      * @return boolean
      */
-    public function contains($name) {
+    public function contains($name)
+    {
         $lower = strtolower($name);
 
         if (isset($this->_data[$lower])) {
@@ -865,7 +895,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @param string $name
      * @return void
      */
-    public function __unset($name) {
+    public function __unset($name)
+    {
         if (isset($this->_data[$name])) {
             $this->_data[$name] = array();
         }
@@ -881,7 +912,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @param Doctrine_Connection $conn                 optional connection parameter
      * @return void
      */
-    public function save(Doctrine_Connection $conn = null) {
+    public function save(Doctrine_Connection $conn = null)
+    {
         if ($conn === null) {
             $conn = $this->_table->getConnection();
         }
@@ -930,7 +962,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @throws PDOException                         if something fails at PDO level
      * @return integer                              number of rows affected
      */
-    public function replace(Doctrine_Connection $conn = null) {
+    public function replace(Doctrine_Connection $conn = null)
+    {
         if ($conn === null) {
             $conn = $this->_table->getConnection();
         }
@@ -941,7 +974,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * returns an array of modified fields and associated values
      * @return array
      */
-    public function getModified() {
+    public function getModified()
+    {
         $a = array();
 
         foreach ($this->_modified as $k => $v) {
@@ -1011,7 +1045,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      *
      * @return integer          the number of columns in this record
      */
-    public function count() {
+    public function count()
+    {
         return count($this->_data);
     }
     /**
@@ -1019,7 +1054,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      *
      * @return integer          the number of columns in this record
      */
-    public function columnCount() {
+    public function columnCount()
+    {
         return $this->count();
     }
     /**
@@ -1028,7 +1064,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      *
      * @return array
      */
-    public function toArray() {
+    public function toArray()
+    {
         $a = array();
 
         foreach ($this as $column => $value) {
@@ -1046,7 +1083,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      *
      * @return boolean
      */
-    public function exists() {
+    public function exists()
+    {
         return ($this->_state !== Doctrine_Record::STATE_TCLEAN &&
                 $this->_state !== Doctrine_Record::STATE_TDIRTY);
     }
@@ -1055,7 +1093,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @param mixed $name               name of the property or reference
      * @return boolean
      */
-    public function hasRelation($name) {
+    public function hasRelation($name)
+    {
         if (isset($this->_data[$name]) || isset($this->_id[$name])) {
             return true;
         }
@@ -1065,7 +1104,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * getIterator
      * @return Doctrine_Record_Iterator     a Doctrine_Record_Iterator that iterates through the data
      */
-    public function getIterator() {
+    public function getIterator()
+    {
         return new Doctrine_Record_Iterator($this);
     }
     /**
@@ -1074,7 +1114,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      *
      * @return Doctrine_Collection|false
      */
-    public function obtainOriginals($name) {
+    public function obtainOriginals($name)
+    {
         if (isset($this->originals[$name])) {
             return $this->originals[$name];
         }
@@ -1088,7 +1129,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      *
      * @return boolean      true on success, false on failure
      */
-    public function delete(Doctrine_Connection $conn = null) {
+    public function delete(Doctrine_Connection $conn = null)
+    {
         if ($conn == null) {
             $conn = $this->_table->getConnection();
         }
@@ -1100,7 +1142,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      *
      * @return Doctrine_Record
      */
-    public function copy() {
+    public function copy()
+    {
         $ret = $this->_table->create($this->_data);
         $modified = array();
         foreach ($this->_data as $key => $val) {
@@ -1116,7 +1159,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @param integer $id
      * @return void
      */
-    final public function assignIdentifier($id = false) {
+    final public function assignIdentifier($id = false)
+    {
         if ($id === false) {
             $this->_id       = array();
             $this->cleanData();
@@ -1141,7 +1185,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @param Doctrine_Collection $coll
      * @return void
      */
-    public function assignOriginals($alias, Doctrine_Collection $coll) {
+    public function assignOriginals($alias, Doctrine_Collection $coll)
+    {
         $this->originals[$alias] = $coll;
     }
     /**
@@ -1149,7 +1194,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      *
      * @return array
      */
-    final public function obtainIdentifier() {
+    final public function obtainIdentifier()
+    {
         return $this->_id;
     }
     /**
@@ -1157,7 +1203,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      *
      * @return integer
      */
-    final public function getIncremented() {
+    final public function getIncremented()
+    {
         $id = current($this->_id);
         if ($id === false)
             return null;
@@ -1172,7 +1219,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      *
      * @return Doctrine_Record
      */
-    public function getLast() {
+    public function getLast()
+    {
         return $this;
     }
     /**
@@ -1180,7 +1228,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @param string $name
      * @return boolean
      */
-    public function hasReference($name) {
+    public function hasReference($name)
+    {
         return isset($this->references[$name]);
     }
     /**
@@ -1189,7 +1238,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @param string $name
      * @throws Doctrine_Record_Exception        if trying to get an unknown related component
      */
-    public function obtainReference($name) {
+    public function obtainReference($name)
+    {
         if (isset($this->references[$name])) {
             return $this->references[$name];
         }
@@ -1202,7 +1252,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @param Doctrine_Relation $connector
      * @return boolean
      */
-    public function initReference(Doctrine_Collection $coll, Doctrine_Relation $connector) {
+    public function initReference(Doctrine_Collection $coll, Doctrine_Relation $connector)
+    {
         $alias = $connector->getAlias();
 
         if (isset($this->references[$alias])) {
@@ -1220,7 +1271,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
         return false;
     }
 
-    public function lazyInitRelated(Doctrine_Collection $coll, Doctrine_Relation $connector) {
+    public function lazyInitRelated(Doctrine_Collection $coll, Doctrine_Relation $connector)
+    {
 
     }
     /**
@@ -1229,7 +1281,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @param mixed $key
      * @return void
      */
-    public function addReference(Doctrine_Record $record, Doctrine_Relation $connector, $key = null) {
+    public function addReference(Doctrine_Record $record, Doctrine_Relation $connector, $key = null)
+    {
         $alias = $connector->getAlias();
 
         $this->references[$alias]->add($record, $key);
@@ -1239,7 +1292,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * getReferences
      * @return array    all references
      */
-    public function getReferences() {
+    public function getReferences()
+    {
         return $this->references;
     }
     /**
@@ -1248,7 +1302,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @param string $alias
      * @param Doctrine_Access $coll
      */
-    final public function setRelated($alias, Doctrine_Access $coll) {
+    final public function setRelated($alias, Doctrine_Access $coll)
+    {
         $this->references[$alias] = $coll;
         $this->originals[$alias]  = $coll;
     }
@@ -1260,7 +1315,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @param string $name
      * @return void
      */
-    final public function loadReference($name) {
+    final public function loadReference($name)
+    {
         $fk      = $this->_table->getRelation($name);
 
         if ($fk->isOneToOne()) {
@@ -1279,7 +1335,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @param string $fkField
      * @return void
      */
-    final public function ownsOne($componentName, $foreignKey, $localKey = null) {
+    final public function ownsOne($componentName, $foreignKey, $localKey = null)
+    {
         $this->_table->bind($componentName, $foreignKey, Doctrine_Relation::ONE_COMPOSITE, $localKey);
     }
     /**
@@ -1289,7 +1346,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @param string $fkField
      * @return void
      */
-    final public function ownsMany($componentName,$foreignKey, $localKey = null) {
+    final public function ownsMany($componentName,$foreignKey, $localKey = null)
+    {
         $this->_table->bind($componentName, $foreignKey, Doctrine_Relation::MANY_COMPOSITE, $localKey);
     }
     /**
@@ -1299,7 +1357,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @param string $fkField
      * @return void
      */
-    final public function hasOne($componentName,$foreignKey, $localKey = null) {
+    final public function hasOne($componentName,$foreignKey, $localKey = null)
+    {
         $this->_table->bind($componentName, $foreignKey, Doctrine_Relation::ONE_AGGREGATE, $localKey);
     }
     /**
@@ -1309,14 +1368,16 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @param string $fkField
      * @return void
      */
-    final public function hasMany($componentName,$foreignKey, $localKey = null) {
+    final public function hasMany($componentName,$foreignKey, $localKey = null)
+    {
         $this->_table->bind($componentName, $foreignKey, Doctrine_Relation::MANY_AGGREGATE, $localKey);
     }
     /**
      * setPrimaryKey
      * @param mixed $key
      */
-    final public function setPrimaryKey($key) {
+    final public function setPrimaryKey($key)
+    {
         $this->_table->setPrimaryKey($key);
     }
     /**
@@ -1329,7 +1390,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @param mixed $options
      * @return void
      */
-    final public function hasColumn($name, $type, $length = 2147483647, $options = "") {
+    final public function hasColumn($name, $type, $length = 2147483647, $options = "")
+    {
         $this->_table->setColumn($name, $type, $length, $options);
     }
     /**
@@ -1338,7 +1400,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @param string $name      the name of the related component
      * @return integer
      */
-    public function countRelated($name) {
+    public function countRelated($name)
+    {
         $rel            = $this->_table->getRelation($name);
         $componentName  = $rel->getTable()->getComponentName();
         $alias          = $rel->getTable()->getAlias(get_class($this));
@@ -1354,7 +1417,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @param array $values
      * @return void
      */
-    public function merge(array $values) {
+    public function merge(array $values)
+    {
         foreach ($this->_table->getColumnNames() as $value) {
             try {
                 if (isset($values[$value])) {
@@ -1365,29 +1429,36 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
             }
         }
     }
-    public function setAttribute($attr, $value) {
+    public function setAttribute($attr, $value)
+    {
         $this->_table->setAttribute($attr, $value);
     }
-    public function setTableName($tableName) {
+    public function setTableName($tableName)
+    {
         $this->_table->setTableName($tableName);
     }
-    public function setInheritanceMap($map) {
+    public function setInheritanceMap($map)
+    {
         $this->_table->setOption('inheritanceMap', $map);
     }
-    public function setEnumValues($column, $values) {
+    public function setEnumValues($column, $values)
+    {
         $this->_table->setEnumValues($column, $values);
     }
-    public function option($name, $value = null) {
+    public function option($name, $value = null)
+    {
         if ($value == null) {
             $this->_table->getOption($name);
         } else {
             $this->_table->setOption($name, $value);
         }
     }
-    public function hasIndex($name ) {
+    public function hasIndex($name )
+    {
 
     }
-    public function actsAsTree($treeImplName, $args) {
+    public function actsAsTree($treeImplName, $args)
+    {
 
     }
     /**
@@ -1396,7 +1467,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @param Doctrine_Db_EventListener_Interface|Doctrine_Overloadable $listener
      * @return Doctrine_Db
      */
-    public function addListener($listener, $name = null) {
+    public function addListener($listener, $name = null)
+    {
         $this->_table->addListener($listener, $name = null);
         return $this;
     }
@@ -1405,7 +1477,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      *
      * @return Doctrine_Db_EventListener_Interface|Doctrine_Overloadable
      */
-    public function getListener() {
+    public function getListener()
+    {
         return $this->_table->getListener();
     }
     /**
@@ -1414,7 +1487,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @param Doctrine_Db_EventListener_Interface|Doctrine_Overloadable $listener
      * @return Doctrine_Db
      */
-    public function setListener($listener) {
+    public function setListener($listener)
+    {
         $this->_table->setListener($listener);
         return $this;
     }
@@ -1426,7 +1500,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
      * @param mixed arg1 ... argN       optional callback arguments
      * @return Doctrine_Record
      */
-    public function call($callback, $column) {
+    public function call($callback, $column)
+    {
         $args = func_get_args();
         array_shift($args);
 
@@ -1443,7 +1518,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
     /**
      * returns a string representation of this object
      */
-    public function __toString() {
+    public function __toString()
+    {
         return Doctrine_Lib::getRecordAsString($this);
     }
 }
diff --git a/lib/Doctrine/Record/Exception.php b/lib/Doctrine/Record/Exception.php
index 6cac7e944..346e73462 100644
--- a/lib/Doctrine/Record/Exception.php
+++ b/lib/Doctrine/Record/Exception.php
@@ -30,4 +30,5 @@ Doctrine::autoload('Doctrine_Exception');
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Record_Exception extends Doctrine_Exception { }
+class Doctrine_Record_Exception extends Doctrine_Exception
+{ }
diff --git a/lib/Doctrine/Record/Iterator.php b/lib/Doctrine/Record/Iterator.php
index 596c3c76a..3b258b10c 100644
--- a/lib/Doctrine/Record/Iterator.php
+++ b/lib/Doctrine/Record/Iterator.php
@@ -1,5 +1,6 @@
 record = $record;
         parent::__construct($record->getData());
     }
@@ -22,7 +24,8 @@ class Doctrine_Record_Iterator extends ArrayIterator {
      *
      * @param Doctrine_Null $null
      */
-    public static function initNullObject(Doctrine_Null $null) {
+    public static function initNullObject(Doctrine_Null $null)
+    {
         self::$null = $null;
     }
     /**
@@ -30,7 +33,8 @@ class Doctrine_Record_Iterator extends ArrayIterator {
      *
      * @return mixed
      */
-    public function current() {
+    public function current()
+    {
         $value = parent::current();
 
         if ($value === self::$null) {
diff --git a/lib/Doctrine/Record/State/Exception.php b/lib/Doctrine/Record/State/Exception.php
index 6d2968260..178f53e3d 100644
--- a/lib/Doctrine/Record/State/Exception.php
+++ b/lib/Doctrine/Record/State/Exception.php
@@ -30,4 +30,5 @@ Doctrine::autoload('Doctrine_Record_Exception');
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Record_State_Exception extends Doctrine_Record_Exception { }
+class Doctrine_Record_State_Exception extends Doctrine_Record_Exception
+{ }
diff --git a/lib/Doctrine/Relation.php b/lib/Doctrine/Relation.php
index 9d2469e89..c45d9d6a1 100644
--- a/lib/Doctrine/Relation.php
+++ b/lib/Doctrine/Relation.php
@@ -30,7 +30,8 @@
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-abstract class Doctrine_Relation {
+abstract class Doctrine_Relation
+{
     /**
      * RELATION CONSTANTS
      */
@@ -80,7 +81,8 @@ abstract class Doctrine_Relation {
      * @param integer $type
      * @param string $alias
      */
-    public function __construct(Doctrine_Table $table, $local, $foreign, $type, $alias) {
+    public function __construct(Doctrine_Table $table, $local, $foreign, $type, $alias)
+    {
         $this->table    = $table;
         $this->local    = $local;
         $this->foreign  = $foreign;
@@ -93,7 +95,8 @@ abstract class Doctrine_Relation {
      *
      * @return string
      */
-    final public function getAlias() {
+    final public function getAlias()
+    {
         return $this->alias;
     }
     /**
@@ -103,7 +106,8 @@ abstract class Doctrine_Relation {
      * @see Doctrine_Relation MANY_* and ONE_* constants
      * @return integer
      */
-    final public function getType() {
+    final public function getType()
+    {
         return $this->type;
     }
     /**
@@ -112,7 +116,8 @@ abstract class Doctrine_Relation {
      *
      * @return object Doctrine_Table
      */
-    final public function getTable() {
+    final public function getTable()
+    {
         return $this->table;
     }
     /**
@@ -121,7 +126,8 @@ abstract class Doctrine_Relation {
      *
      * @return string
      */
-    final public function getLocal() {
+    final public function getLocal()
+    {
         return $this->local;
     }
     /**
@@ -131,7 +137,8 @@ abstract class Doctrine_Relation {
      *
      * @return string
      */
-    final public function getForeign() {
+    final public function getForeign()
+    {
         return $this->foreign;
     }
     /**
@@ -140,7 +147,8 @@ abstract class Doctrine_Relation {
      *
      * @return boolean
      */
-    final public function isComposite() {
+    final public function isComposite()
+    {
         return ($this->type == Doctrine_Relation::ONE_COMPOSITE ||
                 $this->type == Doctrine_Relation::MANY_COMPOSITE);
     }
@@ -150,7 +158,8 @@ abstract class Doctrine_Relation {
      *
      * @return boolean
      */
-    final public function isOneToOne() {
+    final public function isOneToOne()
+    {
         return ($this->type == Doctrine_Relation::ONE_AGGREGATE ||
                 $this->type == Doctrine_Relation::ONE_COMPOSITE);
     }
@@ -160,7 +169,8 @@ abstract class Doctrine_Relation {
      * @param integer $count
      * @return string
      */
-    public function getRelationDql($count) {
+    public function getRelationDql($count)
+    {
         $dql  = "FROM ".$this->table->getComponentName().
                 " WHERE ".$this->table->getComponentName(). '.' . $this->foreign.
                 " IN (".substr(str_repeat("?, ", $count),0,-2).")";
@@ -184,7 +194,8 @@ abstract class Doctrine_Relation {
      * @param Doctrine_Collection $new
      * @return array
      */
-    public static function getDeleteOperations(Doctrine_Collection $old, Doctrine_Collection $new) {
+    public static function getDeleteOperations(Doctrine_Collection $old, Doctrine_Collection $new)
+    {
         $r = array();
 
         foreach ($old as $k => $record) {
@@ -226,7 +237,8 @@ abstract class Doctrine_Relation {
      * @param Doctrine_Collection $new
      * @return array
      */
-    public static function getInsertOperations(Doctrine_Collection $old, Doctrine_Collection $new) {
+    public static function getInsertOperations(Doctrine_Collection $old, Doctrine_Collection $new)
+    {
         $r = array();
 
         foreach ($new as $k => $record) {
@@ -263,7 +275,8 @@ abstract class Doctrine_Relation {
      *
      * @return string
      */
-    public function __toString() {
+    public function __toString()
+    {
         $r[] = "
";
         $r[] = "Class       : ".get_class($this);
         $r[] = "Component   : ".$this->table->getComponentName();
diff --git a/lib/Doctrine/Relation/Association.php b/lib/Doctrine/Relation/Association.php
index 16e2663c7..d776a8569 100644
--- a/lib/Doctrine/Relation/Association.php
+++ b/lib/Doctrine/Relation/Association.php
@@ -33,7 +33,8 @@ Doctrine::autoload('Doctrine_Relation');
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Relation_Association extends Doctrine_Relation {
+class Doctrine_Relation_Association extends Doctrine_Relation
+{
     /**
      * @var Doctrine_Table $associationTable
      */
@@ -47,14 +48,16 @@ class Doctrine_Relation_Association extends Doctrine_Relation {
      * @param integer $type                         type of relation
      * @see Doctrine_Table constants
      */
-    public function __construct(Doctrine_Table $table, Doctrine_Table $associationTable, $local, $foreign, $type, $alias) {
+    public function __construct(Doctrine_Table $table, Doctrine_Table $associationTable, $local, $foreign, $type, $alias)
+    {
         parent::__construct($table, $local, $foreign, $type, $alias);
         $this->associationTable = $associationTable;
     }
     /**
      * @return Doctrine_Table
      */
-    public function getAssociationFactory() {
+    public function getAssociationFactory()
+    {
         return $this->associationTable;
     }
     /**
@@ -62,7 +65,8 @@ class Doctrine_Relation_Association extends Doctrine_Relation {
      *
      * @param Doctrine_Record
      */
-    public function processDiff(Doctrine_Record $record) {
+    public function processDiff(Doctrine_Record $record)
+    {
         $asf     = $this->getAssociationFactory();
         $alias   = $this->getAlias();
 
@@ -100,7 +104,8 @@ class Doctrine_Relation_Association extends Doctrine_Relation {
      * @param integer $count
      * @return string
      */
-    public function getRelationDql($count, $context = 'record') {
+    public function getRelationDql($count, $context = 'record')
+    {
         switch ($context) {
         case "record":
             $sub    = 'SQL:SELECT ' . $this->foreign.
@@ -129,7 +134,8 @@ class Doctrine_Relation_Association extends Doctrine_Relation {
      * @param Doctrine_Record $record
      * @return Doctrine_Record|Doctrine_Collection
      */
-    public function fetchRelatedFor(Doctrine_Record $record) {
+    public function fetchRelatedFor(Doctrine_Record $record)
+    {
         $id      = $record->getIncremented();
         if (empty($id)) {
             $coll = new Doctrine_Collection($this->table);
diff --git a/lib/Doctrine/Relation/Association/Self.php b/lib/Doctrine/Relation/Association/Self.php
index 1dd315458..d3a547f20 100644
--- a/lib/Doctrine/Relation/Association/Self.php
+++ b/lib/Doctrine/Relation/Association/Self.php
@@ -30,14 +30,16 @@ Doctrine::autoload('Doctrine_Relation_Association');
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Relation_Association_Self extends Doctrine_Relation_Association {
+class Doctrine_Relation_Association_Self extends Doctrine_Relation_Association
+{
     /**
      * getRelationDql
      *
      * @param integer $count
      * @return string
      */
-    public function getRelationDql($count, $context = 'record') {
+    public function getRelationDql($count, $context = 'record')
+    {
         switch ($context) {
         case 'record':
             $sub    = 'SELECT '.$this->foreign.
@@ -63,7 +65,8 @@ class Doctrine_Relation_Association_Self extends Doctrine_Relation_Association {
         return $dql;
     }
 
-    public function fetchRelatedFor(Doctrine_Record $record) {
+    public function fetchRelatedFor(Doctrine_Record $record)
+    {
         $id      = $record->getIncremented();
 
         $q = new Doctrine_RawSql();
diff --git a/lib/Doctrine/Relation/ForeignKey.php b/lib/Doctrine/Relation/ForeignKey.php
index 8469b4ae7..a1b55498c 100644
--- a/lib/Doctrine/Relation/ForeignKey.php
+++ b/lib/Doctrine/Relation/ForeignKey.php
@@ -31,13 +31,15 @@ Doctrine::autoload('Doctrine_Relation');
  * @since       1.0
  * @version     $Revision$
  */
-class Doctrine_Relation_ForeignKey extends Doctrine_Relation {
+class Doctrine_Relation_ForeignKey extends Doctrine_Relation
+{
     /**
      * processDiff
      *
      * @param Doctrine_Record $record
      */
-    public function processDiff(Doctrine_Record $record) {
+    public function processDiff(Doctrine_Record $record)
+    {
         $alias = $this->getAlias();
 
         if ($this->isOneToOne()) {
@@ -71,7 +73,8 @@ class Doctrine_Relation_ForeignKey extends Doctrine_Relation {
      * @param Doctrine_Record $record
      * @return Doctrine_Record|Doctrine_Collection
      */
-    public function fetchRelatedFor(Doctrine_Record $record) {
+    public function fetchRelatedFor(Doctrine_Record $record)
+    {
         $id = $record->get($this->local);
 
         if ($this->isOneToOne()) {
diff --git a/lib/Doctrine/Relation/LocalKey.php b/lib/Doctrine/Relation/LocalKey.php
index 88c39808d..0b93465c5 100644
--- a/lib/Doctrine/Relation/LocalKey.php
+++ b/lib/Doctrine/Relation/LocalKey.php
@@ -31,13 +31,15 @@ Doctrine::autoload('Doctrine_Relation');
  * @since       1.0
  * @version     $Revision$
  */
-class Doctrine_Relation_LocalKey extends Doctrine_Relation {
+class Doctrine_Relation_LocalKey extends Doctrine_Relation
+{
     /**
      * processDiff
      *
      * @param Doctrine_Record $record
      */
-    public function processDiff(Doctrine_Record $record) {
+    public function processDiff(Doctrine_Record $record)
+    {
         $alias = $this->getAlias();
 
         if ($record->obtainOriginals($alias)
@@ -54,7 +56,8 @@ class Doctrine_Relation_LocalKey extends Doctrine_Relation {
      * @param Doctrine_Record $record
      * @return Doctrine_Record|Doctrine_Collection
      */
-    public function fetchRelatedFor(Doctrine_Record $record) {
+    public function fetchRelatedFor(Doctrine_Record $record)
+    {
         $id      = $record->get($this->local);
 
         if (empty($id)) {
diff --git a/lib/Doctrine/Schema.php b/lib/Doctrine/Schema.php
index 2f3847af3..f75cfeca7 100644
--- a/lib/Doctrine/Schema.php
+++ b/lib/Doctrine/Schema.php
@@ -36,7 +36,8 @@
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Schema extends Doctrine_Schema_Object implements Countable, IteratorAggregate {
+class Doctrine_Schema extends Doctrine_Schema_Object implements Countable, IteratorAggregate
+{
     /**
      * Holds any number of databases contained in the schema
      * @access private
@@ -48,7 +49,8 @@ class Doctrine_Schema extends Doctrine_Schema_Object implements Countable, Itera
      * @param Doctrine_Schema_Database database      * @return
      * @access public
      */
-    public function addDatabase( Doctrine_Schema_Database $database ) {
+    public function addDatabase( Doctrine_Schema_Database $database )
+    {
          $this->childs[] = $database;
     }
 
@@ -66,7 +68,8 @@ class Doctrine_Schema extends Doctrine_Schema_Object implements Countable, Itera
      * @return
      * @access public
      */
-    public function __toString( ) {
+    public function __toString( )
+    {
 
     }
     /**
@@ -74,7 +77,8 @@ class Doctrine_Schema extends Doctrine_Schema_Object implements Countable, Itera
      * @return bool
      * @access public
      */
-    public function isValid( ) {
+    public function isValid( )
+    {
 
     }
 }
diff --git a/lib/Doctrine/Schema/Column.php b/lib/Doctrine/Schema/Column.php
index 72347c2e0..fc465744a 100644
--- a/lib/Doctrine/Schema/Column.php
+++ b/lib/Doctrine/Schema/Column.php
@@ -37,7 +37,8 @@ Doctrine::autoload('Doctrine_Schema_Object');
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Schema_Column extends Doctrine_Schema_Object implements IteratorAggregate {
+class Doctrine_Schema_Column extends Doctrine_Schema_Object implements IteratorAggregate
+{
     /**
      * column definitions
      * @var array $definition
@@ -52,22 +53,28 @@ class Doctrine_Schema_Column extends Doctrine_Schema_Object implements IteratorA
                                   'autoinc' => false
                                   );
 
-    public function getName() {
+    public function getName()
+    {
         return $this->definition['name'];
     }
-    public function getType() {
+    public function getType()
+    {
         return $this->definition['type'];
     }
-    public function isUnique() {
+    public function isUnique()
+    {
         return $this->definition['unique'];
     }
-    public function isPrimaryKey() {
+    public function isPrimaryKey()
+    {
         return $this->definition['primary'];
     }
-    public function defaultValue() {
+    public function defaultValue()
+    {
         return $this->definition['default'];
     }
-    public function isNotNull() {
+    public function isNotNull()
+    {
         return $this->definition['notnull'];
     }
 }
diff --git a/lib/Doctrine/Schema/Database.php b/lib/Doctrine/Schema/Database.php
index e17154e6f..7a918740b 100644
--- a/lib/Doctrine/Schema/Database.php
+++ b/lib/Doctrine/Schema/Database.php
@@ -37,7 +37,8 @@ Doctrine::autoload('Doctrine_Schema_Object');
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Schema_Database extends Doctrine_Schema_Object {
+class Doctrine_Schema_Database extends Doctrine_Schema_Object
+{
 
     protected $definition = array('name'        => null,
                                   'type'        => null,
@@ -53,7 +54,8 @@ class Doctrine_Schema_Database extends Doctrine_Schema_Object {
      * @return
      * @access public
      */
-    public function __clone( ) {
+    public function __clone( )
+    {
 
     }
     /**
@@ -61,7 +63,8 @@ class Doctrine_Schema_Database extends Doctrine_Schema_Object {
      * @return
      * @access public
      */
-    public function __toString( ) {
+    public function __toString( )
+    {
 
     }
     /**
@@ -69,7 +72,8 @@ class Doctrine_Schema_Database extends Doctrine_Schema_Object {
      * @return bool
      * @access public
      */
-    public function isValid( ) {
+    public function isValid( )
+    {
 
     }
     /**
@@ -77,7 +81,8 @@ class Doctrine_Schema_Database extends Doctrine_Schema_Object {
      * @param Doctrine_Schema_Table table      * @return Doctrine_Schema_Table
      * @access public
      */
-    public function addTable( $table = null ) {
+    public function addTable( $table = null )
+    {
         $this->childs[] = $table;
     }
 
@@ -86,7 +91,8 @@ class Doctrine_Schema_Database extends Doctrine_Schema_Object {
      * @return array of Doctrine_Schema_Table
      *
      */
-    public function getTables() {
+    public function getTables()
+    {
         return $this->childs;
     }
 }
diff --git a/lib/Doctrine/Schema/Exception.php b/lib/Doctrine/Schema/Exception.php
index c5dc43222..9a072efd0 100644
--- a/lib/Doctrine/Schema/Exception.php
+++ b/lib/Doctrine/Schema/Exception.php
@@ -1,39 +1,40 @@
-.
- */
-Doctrine::autoload('Doctrine_Exception');
-/**
- * @package     Doctrine
- * @url         http://www.phpdoctrine.com
- * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
- * @author      Jukka Hassinen 
- * @version     $Id$
- */
-/**
- * class Doctrine_Schema_Exception
- * @package     Doctrine
- * @category    Object Relational Mapping
- * @link        www.phpdoctrine.com
- * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
- * @since       1.0
- * @version     $Revision$
- * @author      Konsta Vesterinen 
- */
-class Doctrine_Schema_Exception extends Exception { }
+.
+ */
+Doctrine::autoload('Doctrine_Exception');
+/**
+ * @package     Doctrine
+ * @url         http://www.phpdoctrine.com
+ * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @author      Jukka Hassinen 
+ * @version     $Id$
+ */
+/**
+ * class Doctrine_Schema_Exception
+ * @package     Doctrine
+ * @category    Object Relational Mapping
+ * @link        www.phpdoctrine.com
+ * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @since       1.0
+ * @version     $Revision$
+ * @author      Konsta Vesterinen 
+ */
+class Doctrine_Schema_Exception extends Exception
+{ }
diff --git a/lib/Doctrine/Schema/Object.php b/lib/Doctrine/Schema/Object.php
index 388e45918..b0dd8af03 100644
--- a/lib/Doctrine/Schema/Object.php
+++ b/lib/Doctrine/Schema/Object.php
@@ -32,7 +32,8 @@ Doctrine::autoload('Doctrine_Access');
  * @author      Konsta Vesterinen 
  * @author      Jukka Hassinen 
  */
-abstract class Doctrine_Schema_Object extends Doctrine_Access implements IteratorAggregate, Countable {
+abstract class Doctrine_Schema_Object extends Doctrine_Access implements IteratorAggregate, Countable
+{
 
     protected $children   = array();
 
@@ -46,7 +47,8 @@ abstract class Doctrine_Schema_Object extends Doctrine_Access implements Iterato
         }
     }
 
-    public function get($name) {
+    public function get($name)
+    {
         if ( ! array_key_exists($name, $this->definition)) {
             throw new Doctrine_Schema_Exception('Unknown definition '. $name);
         }
@@ -54,18 +56,21 @@ abstract class Doctrine_Schema_Object extends Doctrine_Access implements Iterato
 
     }
 
-    public function set($name, $value) {
+    public function set($name, $value)
+    {
         if ( ! array_key_exists($name, $this->definition)) {
             throw new Doctrine_Schema_Exception('Unknown definition '. $name);
         }
         $this->definition[$name] = $value;
     }
 
-    public function contains($name) {
+    public function contains($name)
+    {
         return array_key_exists($name, $this->definition);
     }
 
-    public function toArray() {
+    public function toArray()
+    {
         return $this->definition;
     }
     /**
@@ -73,7 +78,8 @@ abstract class Doctrine_Schema_Object extends Doctrine_Access implements Iterato
      * @return int
      * @access public
      */
-    public function count() {
+    public function count()
+    {
         if ( ! empty($this->children)) {
             return count($this->children);
         }
@@ -86,7 +92,8 @@ abstract class Doctrine_Schema_Object extends Doctrine_Access implements Iterato
      * @return ArrayIterator
      * @access public
      */
-    public function getIterator() {
+    public function getIterator()
+    {
         if ( ! empty($this->children)) {
             return new ArrayIterator($this->children);
         }
diff --git a/lib/Doctrine/Schema/Relation.php b/lib/Doctrine/Schema/Relation.php
index 347178329..1ccd15f9d 100644
--- a/lib/Doctrine/Schema/Relation.php
+++ b/lib/Doctrine/Schema/Relation.php
@@ -37,7 +37,8 @@ Doctrine::autoload('Doctrine_Schema_Object');
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Schema_Relation extends Doctrine_Schema_Object {
+class Doctrine_Schema_Relation extends Doctrine_Schema_Object
+{
 
     /**
      * Column that refers to another table
@@ -101,7 +102,8 @@ class Doctrine_Schema_Relation extends Doctrine_Schema_Object {
      * @return
      * @access public
      */
-    public function setRelationBetween( $referencingColumn, $referencedTable, $referencedColumn ) {
+    public function setRelationBetween( $referencingColumn, $referencedTable, $referencedColumn )
+    {
         $this->referencingColumn = $referencingColumn;
         $this->referencedTable = $referencedTable;
         $this->referencedColumn = $referencedColumn;
@@ -109,14 +111,16 @@ class Doctrine_Schema_Relation extends Doctrine_Schema_Object {
     /**
      * @return string
      */
-    public function __toString( ) {
+    public function __toString( )
+    {
         return "Relation between '".$this->referencingColumn."' and '".$this->referencedTable."'.'".$this->referencingColumn."'";
     }
     /**
      *
      * @return bool
      */
-    public function isValid( ) {
+    public function isValid( )
+    {
 
     }
 }
diff --git a/lib/Doctrine/Schema/Table.php b/lib/Doctrine/Schema/Table.php
index ec2f0cc92..0ea636ac5 100644
--- a/lib/Doctrine/Schema/Table.php
+++ b/lib/Doctrine/Schema/Table.php
@@ -37,7 +37,8 @@ Doctrine::autoload('Doctrine_Schema_Object');
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Schema_Table extends Doctrine_Schema_Object implements Countable, IteratorAggregate {
+class Doctrine_Schema_Table extends Doctrine_Schema_Object implements Countable, IteratorAggregate
+{
 
     protected $definition = array('name'        => '',
                                   'check'       => '',
@@ -52,7 +53,8 @@ class Doctrine_Schema_Table extends Doctrine_Schema_Object implements Countable,
      * @return bool
      * @access public
      */
-    public function isValid( ) {
+    public function isValid( )
+    {
 
     }
     /**
@@ -60,13 +62,15 @@ class Doctrine_Schema_Table extends Doctrine_Schema_Object implements Countable,
      *
      * @return array
      */
-    public function getColumns() {
+    public function getColumns()
+    {
         return $this->children;
     }
     /**
      * @return Doctrine_Schema_Column|false
      */
-    public function getColumn($name) {
+    public function getColumn($name)
+    {
         if ( ! isset($this->children[$name])) {
             return false;
         }
@@ -78,7 +82,8 @@ class Doctrine_Schema_Table extends Doctrine_Schema_Object implements Countable,
      * @return Doctrine_Schema_Table
      * @access public
      */
-    public function addColumn(Doctrine_Schema_Column $column) {
+    public function addColumn(Doctrine_Schema_Column $column)
+    {
         $name = $column->get('name');
         $this->children[$name] = $column;
 
diff --git a/lib/Doctrine/Table.php b/lib/Doctrine/Table.php
index 7582b508d..5579d9d05 100644
--- a/lib/Doctrine/Table.php
+++ b/lib/Doctrine/Table.php
@@ -31,7 +31,8 @@
  * @link        www.phpdoctrine.com
  * @since       1.0
  */
-class Doctrine_Table extends Doctrine_Configurable implements Countable {
+class Doctrine_Table extends Doctrine_Configurable implements Countable
+{
     /**
      * @var array $data                                 temporary data which is then loaded into Doctrine_Record::$data
      */
@@ -141,7 +142,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      * @throws Doctrine_Table_Exception         if there is already an instance of this table
      * @return void
      */
-    public function __construct($name, Doctrine_Connection $conn) {
+    public function __construct($name, Doctrine_Connection $conn)
+    {
         $this->conn = $conn;
 
         $this->setParent($this->conn);
@@ -287,7 +289,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      *
      * @return Doctrine_Query
      */
-    public function createQuery() {
+    public function createQuery()
+    {
         return Doctrine_Query::create()->from($this->getComponentName());
     }
     /**
@@ -295,11 +298,13 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      *
      * @return Doctrine_Table_Repository
      */
-    public function getRepository() {
+    public function getRepository()
+    {
         return $this->repository;
     }
 
-    public function setOption($name, $value) {
+    public function setOption($name, $value)
+    {
         switch ($name) {
         case 'name':
         case 'tableName':
@@ -314,10 +319,12 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
         $this->options[$name] = $value;
     }
 
-    public function usesInheritanceMap() {
+    public function usesInheritanceMap()
+    {
         return ( ! empty($this->options['inheritanceMap']));
     }
-    public function getOption($name) {
+    public function getOption($name)
+    {
         if (isset($this->options[$name])) {
             return $this->options[$name];
         }
@@ -363,7 +370,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      *
      * @return boolean
      */
-    public function hasDefaultValues() {
+    public function hasDefaultValues()
+    {
         return $this->hasDefaultValues;
     }
     /**
@@ -373,7 +381,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      * @param string $column
      * @return mixed
      */
-    public function getDefaultValueOf($column) {
+    public function getDefaultValueOf($column)
+    {
         $column = strtolower($column);
         if ( ! isset($this->columns[$column])) {
             throw new Doctrine_Table_Exception("Couldn't get default value. Column ".$column." doesn't exist.");
@@ -387,27 +396,31 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
     /**
      * @return mixed
      */
-    final public function getIdentifier() {
+    final public function getIdentifier()
+    {
         return $this->identifier;
     }
     /**
      * @return integer
      */
-    final public function getIdentifierType() {
+    final public function getIdentifierType()
+    {
         return $this->identifierType;
     }
     /**
      * hasColumn
      * @return boolean
      */
-    final public function hasColumn($name) {
+    final public function hasColumn($name)
+    {
         return isset($this->columns[$name]);
     }
     /**
      * @param mixed $key
      * @return void
      */
-    final public function setPrimaryKey($key) {
+    final public function setPrimaryKey($key)
+    {
         switch (gettype($key)) {
         case "array":
             $this->primaryKeys = array_values($key);
@@ -421,51 +434,59 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      * returns all primary keys
      * @return array
      */
-    final public function getPrimaryKeys() {
+    final public function getPrimaryKeys()
+    {
         return $this->primaryKeys;
     }
     /**
      * @return boolean
      */
-    final public function hasPrimaryKey($key) {
+    final public function hasPrimaryKey($key)
+    {
         return in_array($key,$this->primaryKeys);
     }
     /**
      * @param $sequence
      * @return void
      */
-    final public function setSequenceName($sequence) {
+    final public function setSequenceName($sequence)
+    {
         $this->options['sequenceName'] = $sequence;
     }
     /**
      * @return string   sequence name
      */
-    final public function getSequenceName() {
+    final public function getSequenceName()
+    {
         return $this->options['sequenceName'];
     }
     /**
      * getParents
      */
-    final public function getParents() {
+    final public function getParents()
+    {
         return $this->parents;
     }
     /**
      * @return boolean
      */
-    final public function hasInheritanceMap() {
+    final public function hasInheritanceMap()
+    {
         return (empty($this->options['inheritanceMap']));
     }
     /**
      * @return array        inheritance map (array keys as fields)
      */
-    final public function getInheritanceMap() {
+    final public function getInheritanceMap()
+    {
         return $this->options['inheritanceMap'];
     }
     /**
      * return all composite paths in the form [component1].[component2]. . .[componentN]
      * @return array
      */
-    final public function getCompositePaths() {
+    final public function getCompositePaths()
+    {
         $array = array();
         $name  = $this->getComponentName();
         foreach ($this->bound as $k=>$a) {
@@ -495,7 +516,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      *
      * @return array
      */
-    public function getBounds() {
+    public function getBounds()
+    {
         return $this->bound;
     }
     /**
@@ -504,7 +526,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      * @param string $name
      * @return array
      */
-    public function getBound($name) {
+    public function getBound($name)
+    {
         if ( ! isset($this->bound[$name])) {
             throw new Doctrine_Table_Exception('Unknown bound '.$name);
         }
@@ -516,7 +539,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      * @param string $name
      * @return array
      */
-    public function getBoundForName($name, $component) {
+    public function getBoundForName($name, $component)
+    {
 
         foreach ($this->bound as $k => $bound) {
             $e = explode('.', $bound[0]);
@@ -533,7 +557,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      * @param string $name
      * @return string
      */
-    public function getAlias($name) {
+    public function getAlias($name)
+    {
         if (isset($this->boundAliases[$name])) {
             return $this->boundAliases[$name];
         }
@@ -545,7 +570,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      * @param string $alias
      * @return string
      */
-    public function getAliasName($alias) {
+    public function getAliasName($alias)
+    {
         if ($name = array_search($alias, $this->boundAliases)) {
             return $name;
         }
@@ -556,7 +582,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      *
      * @return void
      */
-    public function unbindAll() {
+    public function unbindAll()
+    {
         $this->bound        = array();
         $this->relations    = array();
         $this->boundAliases = array();
@@ -568,7 +595,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      * @param $name
      * @return boolean
      */
-    public function unbind($name) {
+    public function unbind($name)
+    {
         if ( ! isset($this->bound[$name])) {
             return false;
         }
@@ -589,7 +617,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      * @param string $field
      * @return void
      */
-    public function bind($name, $field, $type, $localKey) {
+    public function bind($name, $field, $type, $localKey)
+    {
         if (isset($this->relations[$name])) {
             unset($this->relations[$name]);
         }
@@ -609,27 +638,31 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      * getComponentName
      * @return string                   the component name
      */
-    public function getComponentName() {
+    public function getComponentName()
+    {
         return $this->options['name'];
     }
     /**
      * @return Doctrine_Connection
      */
-    public function getConnection() {
+    public function getConnection()
+    {
         return $this->conn;
     }
     /**
      * hasRelatedComponent
      * @return boolean
      */
-    final public function hasRelatedComponent($name, $component) {
+    final public function hasRelatedComponent($name, $component)
+    {
          return (strpos($this->bound[$name][0], $component.'.') !== false);
     }
     /**
      * @param string $name              component name of which a foreign key object is bound
      * @return boolean
      */
-    final public function hasRelation($name) {
+    final public function hasRelation($name)
+    {
         if (isset($this->bound[$name])) {
             return true;
         }
@@ -646,7 +679,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      * @param string $name              component name of which a foreign key object is bound
      * @return Doctrine_Relation
      */
-    final public function getRelation($name, $recursive = true) {
+    final public function getRelation($name, $recursive = true)
+    {
         $original = $name;
 
         if (isset($this->relations[$name])) {
@@ -749,7 +783,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      *
      * @return array
      */
-    final public function getRelations() {
+    final public function getRelations()
+    {
         $a = array();
         foreach ($this->bound as $k=>$v) {
             $this->getRelation($k);
@@ -763,7 +798,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      * @param string $name              database table name
      * @return void
      */
-    final public function setTableName($name) {
+    final public function setTableName($name)
+    {
         $this->options['tableName'] = $name;
     }
 
@@ -772,7 +808,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      *
      * @return string
      */
-    final public function getTableName() {
+    final public function getTableName()
+    {
         return $this->options['tableName'];
     }
     /**
@@ -794,7 +831,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      * @param $id                       database row id
      * @return Doctrine_Record|false    a record for given database identifier
      */
-    public function find($id) {
+    public function find($id)
+    {
         if ($id !== null) {
             if ( ! is_array($id)) {
                 $id = array($id);
@@ -823,7 +861,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      * @param $where                    query where part to be modified
      * @return string                   query where part with column aggregation inheritance added
      */
-    final public function applyInheritance($where) {
+    final public function applyInheritance($where)
+    {
         if ( ! empty($this->options['inheritanceMap'])) {
             $a = array();
             foreach ($this->options['inheritanceMap'] as $field => $value) {
@@ -840,7 +879,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      *
      * @return Doctrine_Collection
      */
-    public function findAll() {
+    public function findAll()
+    {
         $graph = new Doctrine_Query($this->conn);
         $users = $graph->query("FROM ".$this->options['name']);
         return $users;
@@ -869,7 +909,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      *
      * @return void
      */
-    public function clear() {
+    public function clear()
+    {
         $this->identityMap = array();
     }
     /**
@@ -879,7 +920,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      *
      * @return Doctrine_Record
      */
-    public function getRecord() {
+    public function getRecord()
+    {
         $this->data = array_change_key_case($this->data, CASE_LOWER);
 
         $key = $this->getIdentifier();
@@ -910,7 +952,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      * @param $id                       database row id
      * @throws Doctrine_Find_Exception
      */
-    final public function getProxy($id = null) {
+    final public function getProxy($id = null)
+    {
         if ($id !== null) {
             $query = "SELECT ".implode(", ",$this->primaryKeys)." FROM ".$this->getTableName()." WHERE ".implode(" = ? && ",$this->primaryKeys)." = ?";
             $query = $this->applyInheritance($query);
@@ -929,14 +972,16 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      *
      * @return integer
      */
-    public function count() {
+    public function count()
+    {
         $a = $this->conn->getDBH()->query("SELECT COUNT(1) FROM ".$this->options['tableName'])->fetch(PDO::FETCH_NUM);
         return current($a);
     }
     /**
      * @return Doctrine_Query                           a Doctrine_Query object
      */
-    public function getQueryObject() {
+    public function getQueryObject()
+    {
         $graph = new Doctrine_Query($this->getConnection());
         $graph->load($this->getComponentName());
         return $graph;
@@ -974,14 +1019,16 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      * @param array $values
      * @return void
      */
-    final public function setEnumValues($field, array $values) {
+    final public function setEnumValues($field, array $values)
+    {
         $this->options['enumMap'][strtolower($field)] = $values;
     }
     /**
      * @param string $field
      * @return array
      */
-    final public function getEnumValues($field) {
+    final public function getEnumValues($field)
+    {
         if (isset($this->options['enumMap'][$field])) {
             return $this->options['enumMap'][$field];
         } else {
@@ -995,7 +1042,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      * @param integer $index
      * @return mixed
      */
-    final public function enumValue($field, $index) {
+    final public function enumValue($field, $index)
+    {
         if ($index instanceof Doctrine_Null)
             return $index;
 
@@ -1006,7 +1054,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      *
      * @param mixed $value
      */
-    public function invokeSet(Doctrine_Record $record, $name, $value) {
+    public function invokeSet(Doctrine_Record $record, $name, $value)
+    {
         if ( ! ($this->getAttribute(Doctrine::ATTR_ACCESSORS) & Doctrine::ACCESSOR_SET)) {
             return $value;
         }
@@ -1027,7 +1076,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      *
      * @param mixed $value
      */
-    public function invokeGet(Doctrine_Record $record, $name, $value) {
+    public function invokeGet(Doctrine_Record $record, $name, $value)
+    {
         if ( ! ($this->getAttribute(Doctrine::ATTR_ACCESSORS) & Doctrine::ACCESSOR_GET)) {
             return $value;
         }
@@ -1050,7 +1100,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      * @param mixed $value
      * @return mixed
      */
-    final public function enumIndex($field, $value) {
+    final public function enumIndex($field, $value)
+    {
         if ( ! isset($this->options['enumMap'][$field])) {
             $values = array();
         } else {
@@ -1064,7 +1115,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      *
      * @return string       ValueWrapper class name on success, false on failure
      */
-    public function getValueWrapperOf($column) {
+    public function getValueWrapperOf($column)
+    {
         if (isset($this->columns[$column][2]['wrapper'])) {
             return $this->columns[$column][2]['wrapper'];
         }
@@ -1075,7 +1127,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      *
      * @return integer      the number of columns in this table
      */
-    final public function getColumnCount() {
+    final public function getColumnCount()
+    {
         return $this->columnCount;
     }
 
@@ -1084,7 +1137,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      *
      * @return array
      */
-    final public function getColumns() {
+    final public function getColumns()
+    {
         return $this->columns;
     }
     /**
@@ -1092,7 +1146,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      *
      * @return array
      */
-    public function getColumnNames() {
+    public function getColumnNames()
+    {
         return array_keys($this->columns);
     }
 
@@ -1101,7 +1156,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      *
      * @return mixed        array on success, false on failure
      */
-    public function getDefinitionOf($column) {
+    public function getDefinitionOf($column)
+    {
         if (isset($this->columns[$column])) {
             return $this->columns[$column];
         }
@@ -1112,7 +1168,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      *
      * @return mixed        string on success, false on failure
      */
-    public function getTypeOf($column) {
+    public function getTypeOf($column)
+    {
         if (isset($this->columns[$column])) {
             return $this->columns[$column][0];
         }
@@ -1126,7 +1183,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      * @param array $data               internal data
      * @return void
      */
-    public function setData(array $data) {
+    public function setData(array $data)
+    {
         $this->data = $data;
     }
     /**
@@ -1134,7 +1192,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      *
      * @return integer
      */
-    final public function getMaxIdentifier() {
+    final public function getMaxIdentifier()
+    {
         $sql  = "SELECT MAX(".$this->getIdentifier().") FROM ".$this->getTableName();
         $stmt = $this->conn->getDBH()->query($sql);
         $data = $stmt->fetch(PDO::FETCH_NUM);
@@ -1145,7 +1204,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      *
      * @return string
      */
-    final public function getQuery() {
+    final public function getQuery()
+    {
         return $this->query;
     }
     /**
@@ -1154,7 +1214,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      *
      * @return array
      */
-    final public function getData() {
+    final public function getData()
+    {
         return $this->data;
     }
     /**
@@ -1162,7 +1223,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
      *
      * @return string
      */
-    public function __toString() {
+    public function __toString()
+    {
         return Doctrine_Lib::getTableAsString($this);
     }
 }
diff --git a/lib/Doctrine/Table/Exception.php b/lib/Doctrine/Table/Exception.php
index c733c75ee..6577dd658 100644
--- a/lib/Doctrine/Table/Exception.php
+++ b/lib/Doctrine/Table/Exception.php
@@ -31,7 +31,8 @@ Doctrine::autoload('Doctrine_Exception');
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Table_Exception extends Doctrine_Exception {
+class Doctrine_Table_Exception extends Doctrine_Exception
+{
     public function __construct($message = "Couldn't initialize table. One instance of this
                             table already exists. Always use Doctrine_Session::getTable(\$name)
                             to get on instance of a Doctrine_Table.") {
diff --git a/lib/Doctrine/Table/Repository.php b/lib/Doctrine/Table/Repository.php
index c3737c4f3..6f5cdbe32 100644
--- a/lib/Doctrine/Table/Repository.php
+++ b/lib/Doctrine/Table/Repository.php
@@ -31,7 +31,8 @@
  * @since       1.0
  * @version     $Revision$
  */
-class Doctrine_Table_Repository implements Countable, IteratorAggregate {
+class Doctrine_Table_Repository implements Countable, IteratorAggregate
+{
     /**
      * @var object Doctrine_Table $table
      */
@@ -47,7 +48,8 @@ class Doctrine_Table_Repository implements Countable, IteratorAggregate {
      *
      * @param Doctrine_Table $table
      */
-    public function __construct(Doctrine_Table $table) {
+    public function __construct(Doctrine_Table $table)
+    {
         $this->table = $table;
     }
     /**
@@ -55,7 +57,8 @@ class Doctrine_Table_Repository implements Countable, IteratorAggregate {
      *
      * @return object Doctrine_Table
      */
-    public function getTable() {
+    public function getTable()
+    {
         return $this->table;
     }
     /**
@@ -64,7 +67,8 @@ class Doctrine_Table_Repository implements Countable, IteratorAggregate {
      * @param Doctrine_Record $record       record to be added into registry
      * @return boolean
      */
-    public function add(Doctrine_Record $record) {
+    public function add(Doctrine_Record $record)
+    {
         $oid = $record->getOID();
 
         if (isset($this->registry[$oid])) {
@@ -79,7 +83,8 @@ class Doctrine_Table_Repository implements Countable, IteratorAggregate {
      * @param integer $oid
      * @throws Doctrine_Table_Repository_Exception
      */
-    public function get($oid) {
+    public function get($oid)
+    {
         if ( ! isset($this->registry[$oid])) {
             throw new Doctrine_Table_Repository_Exception("Unknown object identifier");
         }
@@ -90,14 +95,16 @@ class Doctrine_Table_Repository implements Countable, IteratorAggregate {
      * Doctrine_Registry implements interface Countable
      * @return integer                      the number of records this registry has
      */
-    public function count() {
+    public function count()
+    {
         return count($this->registry);
     }
     /**
      * @param integer $oid                  object identifier
      * @return boolean                      whether ot not the operation was successful
      */
-    public function evict($oid) {
+    public function evict($oid)
+    {
         if ( ! isset($this->registry[$oid])) {
             return false;
         }
@@ -107,7 +114,8 @@ class Doctrine_Table_Repository implements Countable, IteratorAggregate {
     /**
      * @return integer                      number of records evicted
      */
-    public function evictAll() {
+    public function evictAll()
+    {
         $evicted = 0;
         foreach ($this->registry as $oid=>$record) {
             if ($this->evict($oid)) {
@@ -120,21 +128,24 @@ class Doctrine_Table_Repository implements Countable, IteratorAggregate {
      * getIterator
      * @return ArrayIterator
      */
-    public function getIterator() {
+    public function getIterator()
+    {
         return new ArrayIterator($this->registry);
     }
     /**
      * contains
      * @param integer $oid                  object identifier
      */
-    public function contains($oid) {
+    public function contains($oid)
+    {
         return isset($this->registry[$oid]);
     }
     /**
      * loadAll
      * @return void
      */
-    public function loadAll() {
+    public function loadAll()
+    {
         $this->table->findAll();
     }
 }
diff --git a/lib/Doctrine/Table/Repository/Exception.php b/lib/Doctrine/Table/Repository/Exception.php
index 4268a7aee..6b4ab3a40 100644
--- a/lib/Doctrine/Table/Repository/Exception.php
+++ b/lib/Doctrine/Table/Repository/Exception.php
@@ -30,4 +30,5 @@ Doctrine::autoload('Doctrine_Exception');
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Table_Repository_Exception extends Doctrine_Exception { }
+class Doctrine_Table_Repository_Exception extends Doctrine_Exception
+{ }
diff --git a/lib/Doctrine/Transaction.php b/lib/Doctrine/Transaction.php
index b4afb1d94..692843995 100644
--- a/lib/Doctrine/Transaction.php
+++ b/lib/Doctrine/Transaction.php
@@ -30,7 +30,8 @@ Doctrine::autoload('Doctrine_Connection_Module');
  * @since       1.0
  * @version     $Revision$
  */
-class Doctrine_Transaction extends Doctrine_Connection_Module {
+class Doctrine_Transaction extends Doctrine_Connection_Module
+{
     /**
      * Doctrine_Transaction is in sleep state when it has no active transactions
      */
@@ -67,7 +68,8 @@ class Doctrine_Transaction extends Doctrine_Connection_Module {
      * @see Doctrine_Connection_Transaction::STATE_* constants
      * @return integer          the connection state
      */
-    public function getState() {
+    public function getState()
+    {
         switch ($this->transactionLevel) {
         case 0:
             return Doctrine_Transaction::STATE_SLEEP;
@@ -83,7 +85,8 @@ class Doctrine_Transaction extends Doctrine_Connection_Module {
      * adds record into pending delete list
      * @param Doctrine_Record $record
      */
-    public function addDelete(Doctrine_Record $record) {
+    public function addDelete(Doctrine_Record $record)
+    {
         $name = $record->getTable()->getComponentName();
         $this->delete[$name][] = $record;
     }
@@ -95,7 +98,8 @@ class Doctrine_Transaction extends Doctrine_Connection_Module {
      * @return boolean        false if record already existed in invalid records list,
      *                        otherwise true
      */
-    public function addInvalid(Doctrine_Record $record) {
+    public function addInvalid(Doctrine_Record $record)
+    {
         if (in_array($record, $this->invalid)) {
             return false;
         }
@@ -108,7 +112,8 @@ class Doctrine_Transaction extends Doctrine_Connection_Module {
      *
      * @return array
      */
-    public function getDeletes() {
+    public function getDeletes()
+    {
         return $this->delete;
     }
     /**
@@ -117,7 +122,8 @@ class Doctrine_Transaction extends Doctrine_Connection_Module {
      *
      * @return void
      */
-    public function bulkDelete() {
+    public function bulkDelete()
+    {
         foreach ($this->delete as $name => $deletes) {
             $record = false;
             $ids    = array();
@@ -146,7 +152,8 @@ class Doctrine_Transaction extends Doctrine_Connection_Module {
      *
      * @return integer
      */
-    public function getTransactionLevel() {
+    public function getTransactionLevel()
+    {
         return $this->transactionLevel;
     }
     /**
@@ -161,7 +168,8 @@ class Doctrine_Transaction extends Doctrine_Connection_Module {
      * @param string $savepoint                 name of a savepoint to set
      * @return integer                          current transaction nesting level
      */
-    public function beginTransaction($savepoint = null) {
+    public function beginTransaction($savepoint = null)
+    {
         if ( ! is_null($savepoint)) {
             $this->beginTransaction();
 
@@ -195,7 +203,8 @@ class Doctrine_Transaction extends Doctrine_Connection_Module {
      * @throws Doctrine_Validator_Exception     if the transaction fails due to record validations
      * @return boolean                          false if commit couldn't be performed, true otherwise
      */
-    public function commit($savepoint = null) {
+    public function commit($savepoint = null)
+    {
         if ($this->transactionLevel == 0)
             return false;
 
@@ -249,7 +258,8 @@ class Doctrine_Transaction extends Doctrine_Connection_Module {
      * @param string $savepoint                 name of a savepoint to rollback to
      * @return boolean                          false if rollback couldn't be performed, true otherwise
      */
-    public function rollback($savepoint = null) {
+    public function rollback($savepoint = null)
+    {
         if ($this->transactionLevel == 0)
             return false;
 
@@ -278,7 +288,8 @@ class Doctrine_Transaction extends Doctrine_Connection_Module {
      * @param string $savepoint     name of a savepoint to create
      * @return void
      */
-    protected function createSavePoint($savepoint) {
+    protected function createSavePoint($savepoint)
+    {
         throw new Doctrine_Transaction_Exception('Savepoints not supported by this driver.');
     }
     /**
@@ -288,7 +299,8 @@ class Doctrine_Transaction extends Doctrine_Connection_Module {
      * @param string $savepoint     name of a savepoint to release
      * @return void
      */
-    protected function releaseSavePoint($savepoint) {
+    protected function releaseSavePoint($savepoint)
+    {
         throw new Doctrine_Transaction_Exception('Savepoints not supported by this driver.');
     }
     /**
@@ -298,7 +310,8 @@ class Doctrine_Transaction extends Doctrine_Connection_Module {
      * @param string $savepoint     name of a savepoint to rollback to
      * @return void
      */
-    protected function rollbackSavePoint($savepoint) {
+    protected function rollbackSavePoint($savepoint)
+    {
         throw new Doctrine_Transaction_Exception('Savepoints not supported by this driver.');
     }
     /**
@@ -309,7 +322,8 @@ class Doctrine_Transaction extends Doctrine_Connection_Module {
      * @param sring $savepoint      name of the savepoint to remove
      * @return integer              the current transaction level
      */
-    private function removeSavePoints($savepoint) {
+    private function removeSavePoints($savepoint)
+    {
         $i = array_search($savepoint, $this->savePoints);
 
         $c = count($this->savePoints);
@@ -341,7 +355,8 @@ class Doctrine_Transaction extends Doctrine_Connection_Module {
      * @throws PDOException                             if something fails at the PDO level
      * @return void
      */
-    public function setIsolation($isolation) {
+    public function setIsolation($isolation)
+    {
         throw new Doctrine_Transaction_Exception('Transaction isolation levels not supported by this driver.');
     }
 
@@ -357,7 +372,8 @@ class Doctrine_Transaction extends Doctrine_Connection_Module {
      * @throws PDOException                             if something fails at the PDO level
      * @return string                                   returns the current session transaction isolation level
      */
-    public function getIsolation() {
+    public function getIsolation()
+    {
         throw new Doctrine_Transaction_Exception('Fetching transaction isolation level not supported by this driver.');
     }
 }
diff --git a/lib/Doctrine/Transaction/Exception.php b/lib/Doctrine/Transaction/Exception.php
index 540d27fd3..98a071f36 100644
--- a/lib/Doctrine/Transaction/Exception.php
+++ b/lib/Doctrine/Transaction/Exception.php
@@ -30,4 +30,5 @@ Doctrine::autoload('Doctrine_Exception');
  * @category    Object Relational Mapping
  * @link        www.phpdoctrine.com
  */
-class Doctrine_Transaction_Exception extends Doctrine_Exception { }
+class Doctrine_Transaction_Exception extends Doctrine_Exception
+{ }
diff --git a/lib/Doctrine/Transaction/Firebird.php b/lib/Doctrine/Transaction/Firebird.php
index b5bcecdf7..710f4f9e4 100644
--- a/lib/Doctrine/Transaction/Firebird.php
+++ b/lib/Doctrine/Transaction/Firebird.php
@@ -30,7 +30,8 @@ Doctrine::autoload('Doctrine_Transaction');
  * @since       1.0
  * @version     $Revision$
  */
-class Doctrine_Transaction_Firebird extends Doctrine_Transaction {
+class Doctrine_Transaction_Firebird extends Doctrine_Transaction
+{
     /**
      * createSavepoint
      * creates a new savepoint
@@ -38,7 +39,8 @@ class Doctrine_Transaction_Firebird extends Doctrine_Transaction {
      * @param string $savepoint     name of a savepoint to set
      * @return void
      */
-    protected function createSavePoint($savepoint) {
+    protected function createSavePoint($savepoint)
+    {
         $query = 'SAVEPOINT '.$savepoint;
 
         return $this->conn->getDbh()->query($query);
@@ -50,7 +52,8 @@ class Doctrine_Transaction_Firebird extends Doctrine_Transaction {
      * @param string $savepoint     name of a savepoint to release
      * @return void
      */
-    protected function releaseSavePoint($savepoint) {
+    protected function releaseSavePoint($savepoint)
+    {
         $query = 'RELEASE SAVEPOINT '.$savepoint;
 
         return $this->conn->getDbh()->query($query);
@@ -62,7 +65,8 @@ class Doctrine_Transaction_Firebird extends Doctrine_Transaction {
      * @param string $savepoint     name of a savepoint to rollback to
      * @return void
      */
-    protected function rollbackSavePoint($savepoint) {
+    protected function rollbackSavePoint($savepoint)
+    {
         $query = 'ROLLBACK TO SAVEPOINT '.$savepoint;
 
         return $this->conn->getDbh()->query($query);
diff --git a/lib/Doctrine/Transaction/Informix.php b/lib/Doctrine/Transaction/Informix.php
index 99d484698..4685aa377 100644
--- a/lib/Doctrine/Transaction/Informix.php
+++ b/lib/Doctrine/Transaction/Informix.php
@@ -30,4 +30,5 @@ Doctrine::autoload('Doctrine_Transaction');
  * @since       1.0
  * @version     $Revision$
  */
-class Doctrine_Transaction_Informix extends Doctrine_Transaction { }
+class Doctrine_Transaction_Informix extends Doctrine_Transaction
+{ }
diff --git a/lib/Doctrine/Transaction/Mssql.php b/lib/Doctrine/Transaction/Mssql.php
index aadc6119f..e7d72bf7c 100644
--- a/lib/Doctrine/Transaction/Mssql.php
+++ b/lib/Doctrine/Transaction/Mssql.php
@@ -30,7 +30,8 @@ Doctrine::autoload('Doctrine_Transaction');
  * @since       1.0
  * @version     $Revision$
  */
-class Doctrine_Transaction_Mssql extends Doctrine_Transaction {
+class Doctrine_Transaction_Mssql extends Doctrine_Transaction
+{
     /**
      * Set the transacton isolation level.
      *
diff --git a/lib/Doctrine/Transaction/Mysql.php b/lib/Doctrine/Transaction/Mysql.php
index cd342ddc6..de70f6d3f 100644
--- a/lib/Doctrine/Transaction/Mysql.php
+++ b/lib/Doctrine/Transaction/Mysql.php
@@ -30,7 +30,8 @@ Doctrine::autoload('Doctrine_Transaction');
  * @since       1.0
  * @version     $Revision$
  */
-class Doctrine_Transaction_Mysql extends Doctrine_Transaction {
+class Doctrine_Transaction_Mysql extends Doctrine_Transaction
+{
     /**
      * createSavepoint
      * creates a new savepoint
@@ -38,7 +39,8 @@ class Doctrine_Transaction_Mysql extends Doctrine_Transaction {
      * @param string $savepoint     name of a savepoint to set
      * @return void
      */
-    protected function createSavePoint($savepoint) {
+    protected function createSavePoint($savepoint)
+    {
         $query = 'SAVEPOINT '.$savepoint;
 
         return $this->conn->getDbh()->query($query);
@@ -50,7 +52,8 @@ class Doctrine_Transaction_Mysql extends Doctrine_Transaction {
      * @param string $savepoint     name of a savepoint to release
      * @return void
      */
-    protected function releaseSavePoint($savepoint) {
+    protected function releaseSavePoint($savepoint)
+    {
         $query = 'RELEASE SAVEPOINT '.$savepoint;
 
         return $this->conn->getDbh()->query($query);
@@ -62,7 +65,8 @@ class Doctrine_Transaction_Mysql extends Doctrine_Transaction {
      * @param string $savepoint     name of a savepoint to rollback to
      * @return void
      */
-    protected function rollbackSavePoint($savepoint) {
+    protected function rollbackSavePoint($savepoint)
+    {
         $query = 'ROLLBACK TO SAVEPOINT '.$savepoint;
 
         return $this->conn->getDbh()->query($query);
@@ -80,7 +84,8 @@ class Doctrine_Transaction_Mysql extends Doctrine_Transaction {
      * @throws PDOException                             if something fails at the PDO level
      * @return void
      */
-    public function setIsolation($isolation) {
+    public function setIsolation($isolation)
+    {
         switch ($isolation) {
             case 'READ UNCOMMITTED':
             case 'READ COMMITTED':
@@ -101,7 +106,8 @@ class Doctrine_Transaction_Mysql extends Doctrine_Transaction {
      *
      * @return string               returns the current session transaction isolation level
      */
-    public function getIsolation() {
+    public function getIsolation()
+    {
         $ret = $this->conn->getDbh()->query('SELECT @@tx_isolation')->fetch(PDO::FETCH_NUM);
         return current($ret);
     }
diff --git a/lib/Doctrine/Transaction/Oracle.php b/lib/Doctrine/Transaction/Oracle.php
index d433207f1..8ace36fdd 100644
--- a/lib/Doctrine/Transaction/Oracle.php
+++ b/lib/Doctrine/Transaction/Oracle.php
@@ -30,7 +30,8 @@ Doctrine::autoload('Doctrine_Transaction');
  * @since       1.0
  * @version     $Revision$
  */
-class Doctrine_Transaction_Oracle extends Doctrine_Transaction {
+class Doctrine_Transaction_Oracle extends Doctrine_Transaction
+{
     /**
      * createSavepoint
      * creates a new savepoint
@@ -38,7 +39,8 @@ class Doctrine_Transaction_Oracle extends Doctrine_Transaction {
      * @param string $savepoint     name of a savepoint to set
      * @return void
      */
-    protected function createSavePoint($savepoint) {
+    protected function createSavePoint($savepoint)
+    {
         $query = 'SAVEPOINT '.$savepoint;
 
         return $this->conn->getDbh()->query($query);
@@ -50,7 +52,8 @@ class Doctrine_Transaction_Oracle extends Doctrine_Transaction {
      * @param string $savepoint     name of a savepoint to release
      * @return void
      */
-    protected function releaseSavePoint($savepoint) {
+    protected function releaseSavePoint($savepoint)
+    {
         // oracle doesn't support manual releasing of savepoints
         return true;
     }
@@ -61,7 +64,8 @@ class Doctrine_Transaction_Oracle extends Doctrine_Transaction {
      * @param string $savepoint     name of a savepoint to rollback to
      * @return void
      */
-    protected function rollbackSavePoint($savepoint) {
+    protected function rollbackSavePoint($savepoint)
+    {
         $query = 'ROLLBACK TO SAVEPOINT '.$savepoint;
 
         return $this->conn->getDbh()->query($query);
@@ -78,7 +82,8 @@ class Doctrine_Transaction_Oracle extends Doctrine_Transaction {
      * @throws Doctrine_Transaction_Exception       if using unknown isolation level
      * @return void
      */
-    public function setIsolation($isolation) {
+    public function setIsolation($isolation)
+    {
         switch ($isolation) {
         case 'READ UNCOMMITTED':
             $isolation = 'READ COMMITTED';
diff --git a/lib/Doctrine/Transaction/Pgsql.php b/lib/Doctrine/Transaction/Pgsql.php
index d683631f3..1f85462da 100644
--- a/lib/Doctrine/Transaction/Pgsql.php
+++ b/lib/Doctrine/Transaction/Pgsql.php
@@ -31,7 +31,8 @@ Doctrine::autoload('Doctrine_Transaction');
  * @since       1.0
  * @version     $Revision$
  */
-class Doctrine_Transaction_Pgsql extends Doctrine_Transaction {
+class Doctrine_Transaction_Pgsql extends Doctrine_Transaction
+{
     /**
      * createSavepoint
      * creates a new savepoint
@@ -39,7 +40,8 @@ class Doctrine_Transaction_Pgsql extends Doctrine_Transaction {
      * @param string $savepoint     name of a savepoint to set
      * @return void
      */
-    protected function createSavePoint($savepoint) {
+    protected function createSavePoint($savepoint)
+    {
         $query = 'SAVEPOINT '.$savepoint;
 
         return $this->conn->getDbh()->query($query);
@@ -51,7 +53,8 @@ class Doctrine_Transaction_Pgsql extends Doctrine_Transaction {
      * @param string $savepoint     name of a savepoint to release
      * @return void
      */
-    protected function releaseSavePoint($savepoint) {
+    protected function releaseSavePoint($savepoint)
+    {
         $query = 'RELEASE SAVEPOINT '.$savepoint;
 
         return $this->conn->getDbh()->query($query);
@@ -63,7 +66,8 @@ class Doctrine_Transaction_Pgsql extends Doctrine_Transaction {
      * @param string $savepoint     name of a savepoint to rollback to
      * @return void
      */
-    protected function rollbackSavePoint($savepoint) {
+    protected function rollbackSavePoint($savepoint)
+    {
         $query = 'ROLLBACK TO SAVEPOINT '.$savepoint;
 
         return $this->conn->getDbh()->query($query);
@@ -80,7 +84,8 @@ class Doctrine_Transaction_Pgsql extends Doctrine_Transaction {
      * @throws Doctrine_Transaction_Exception       if using unknown isolation level or unknown wait option
      * @return void
      */
-    public function setIsolation($isolation) {
+    public function setIsolation($isolation)
+    {
         switch ($isolation) {
             case 'READ UNCOMMITTED':
             case 'READ COMMITTED':
diff --git a/lib/Doctrine/Transaction/Sqlite.php b/lib/Doctrine/Transaction/Sqlite.php
index 9eb62499e..0b9820a6f 100644
--- a/lib/Doctrine/Transaction/Sqlite.php
+++ b/lib/Doctrine/Transaction/Sqlite.php
@@ -30,7 +30,8 @@ Doctrine::autoload('Doctrine_Transaction');
  * @since       1.0
  * @version     $Revision$
  */
-class Doctrine_Transaction_Sqlite extends Doctrine_Transaction {
+class Doctrine_Transaction_Sqlite extends Doctrine_Transaction
+{
     /**
      * Set the transacton isolation level.
      *
@@ -43,7 +44,8 @@ class Doctrine_Transaction_Sqlite extends Doctrine_Transaction {
      * @throws Doctrine_Transaction_Exception       if using unknown isolation level
      * @return void
      */
-    public function setIsolation($isolation) {
+    public function setIsolation($isolation)
+    {
         switch ($isolation) {
             case 'READ UNCOMMITTED':
                 $isolation = 0;
diff --git a/lib/Doctrine/Validator.php b/lib/Doctrine/Validator.php
index 74cc57e29..2d9801d07 100644
--- a/lib/Doctrine/Validator.php
+++ b/lib/Doctrine/Validator.php
@@ -30,7 +30,8 @@
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Validator {
+class Doctrine_Validator
+{
     /**
      * @var array $validators           an array of validator objects
      */
@@ -46,7 +47,8 @@ class Doctrine_Validator {
      * @param Doctrine_Null $null
      * @return void
      */
-    public static function initNullObject(Doctrine_Null $null) {
+    public static function initNullObject(Doctrine_Null $null)
+    {
         self::$null = $null;
     }
     /**
@@ -55,7 +57,8 @@ class Doctrine_Validator {
      * @param string $name
      * @return Doctrine_Validator_Interface
      */
-    public static function getValidator($name) {
+    public static function getValidator($name)
+    {
         if ( ! isset(self::$validators[$name])) {
             $class = "Doctrine_Validator_".ucwords(strtolower($name));
             if (class_exists($class)) {
@@ -74,7 +77,8 @@ class Doctrine_Validator {
      * @param Doctrine_Record $record
      * @return void
      */
-    public function validateRecord(Doctrine_Record $record) {
+    public function validateRecord(Doctrine_Record $record)
+    {
         $columns   = $record->getTable()->getColumns();
         $component = $record->getTable()->getComponentName();
 
@@ -176,7 +180,8 @@ class Doctrine_Validator {
      * Enter description here...
      *
      */
-    private function validateLength($column, $key, $value) {
+    private function validateLength($column, $key, $value)
+    {
         if ($column[0] == "array" || $column[0] == "object") {
             $length = strlen(serialize($value));
         } else {
@@ -193,7 +198,8 @@ class Doctrine_Validator {
      *
      * @return boolean
      */
-    public function hasErrors() {
+    public function hasErrors()
+    {
         return (count($this->stack) > 0);
     }
     /**
@@ -202,7 +208,8 @@ class Doctrine_Validator {
      * @param $doctrineType
      * @return string
      */
-    public static function phpType($doctrineType) {
+    public static function phpType($doctrineType)
+    {
         switch ($doctrineType) {
         case 'enum':
             return 'integer';
@@ -226,7 +233,8 @@ class Doctrine_Validator {
      * @param string $type
      * @return boolean
      */
-    public static function isValidType($var, $type) {
+    public static function isValidType($var, $type)
+    {
         if ($type == 'boolean')
             return true;
 
@@ -255,7 +263,8 @@ class Doctrine_Validator {
      * @param mixed $var
      * @return string
      */
-    public static function gettype($var) {
+    public static function gettype($var)
+    {
         $type = gettype($var);
         switch ($type) {
         case 'string':
diff --git a/lib/Doctrine/Validator/Country.php b/lib/Doctrine/Validator/Country.php
index c17ae4bb9..9cbabb95e 100644
--- a/lib/Doctrine/Validator/Country.php
+++ b/lib/Doctrine/Validator/Country.php
@@ -30,7 +30,8 @@
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Validator_Country {
+class Doctrine_Validator_Country
+{
     private static $countries = array(
         "ad" =>	"Andorra",
         "ae" =>	"United Arab Emirates",
@@ -278,7 +279,8 @@ class Doctrine_Validator_Country {
     /**
      * @return array
      */
-    public static function getCountries() {
+    public static function getCountries()
+    {
         return self::$countries;
     }
     /**
@@ -288,7 +290,8 @@ class Doctrine_Validator_Country {
      * @param string $args
      * @return boolean
      */
-    public function validate(Doctrine_Record $record, $key, $value, $args) {
+    public function validate(Doctrine_Record $record, $key, $value, $args)
+    {
         $value = strtolower($value);
         return isset(self::$countries[$value]);
     }
diff --git a/lib/Doctrine/Validator/Creditcard.php b/lib/Doctrine/Validator/Creditcard.php
index 77ec54127..91768c382 100644
--- a/lib/Doctrine/Validator/Creditcard.php
+++ b/lib/Doctrine/Validator/Creditcard.php
@@ -30,7 +30,8 @@
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Validator_Creditcard {
+class Doctrine_Validator_Creditcard
+{
 
     /**
      * @link http://www.owasp.org/index.php/OWASP_Validation_Regex_Repository
@@ -40,7 +41,8 @@ class Doctrine_Validator_Creditcard {
      * @param string $args
      * @return boolean
      */
-    public function validate(Doctrine_Record $record, $key, $value, $args) {
+    public function validate(Doctrine_Record $record, $key, $value, $args)
+    {
         return preg_match('#^((4\d{3})|(5[1-5]\d{2})|(6011)|(7\d{3}))-?\d{4}-?\d{4}-?\d{4}|3[4,7]\d{13}$#', $value);
     }
 
diff --git a/lib/Doctrine/Validator/Date.php b/lib/Doctrine/Validator/Date.php
index 1160a7ab2..9bf455b70 100644
--- a/lib/Doctrine/Validator/Date.php
+++ b/lib/Doctrine/Validator/Date.php
@@ -30,7 +30,8 @@
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Validator_Date {
+class Doctrine_Validator_Date
+{
     /**
      * @param Doctrine_Record $record
      * @param string $key
@@ -38,7 +39,8 @@ class Doctrine_Validator_Date {
      * @param string $args
      * @return boolean
      */
-    public function validate(Doctrine_Record $record, $key, $value, $args) {
+    public function validate(Doctrine_Record $record, $key, $value, $args)
+    {
         if (empty($value)) {
             return true;
         }
diff --git a/lib/Doctrine/Validator/Email.php b/lib/Doctrine/Validator/Email.php
index a9e250834..483bdaeff 100644
--- a/lib/Doctrine/Validator/Email.php
+++ b/lib/Doctrine/Validator/Email.php
@@ -30,8 +30,8 @@
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Validator_Email {
-
+class Doctrine_Validator_Email
+{
     /**
      * @link http://iamcal.com/publish/articles/php/parsing_email/pdf/
      * @param Doctrine_Record $record
@@ -40,7 +40,8 @@ class Doctrine_Validator_Email {
      * @param string $args
      * @return boolean
      */
-    public function validate(Doctrine_Record $record, $key, $value, $args) {
+    public function validate(Doctrine_Record $record, $key, $value, $args)
+    {
         if (empty($value)) {
             return true;
         }
diff --git a/lib/Doctrine/Validator/Enum.php b/lib/Doctrine/Validator/Enum.php
index d7ed4a45c..608994c8d 100644
--- a/lib/Doctrine/Validator/Enum.php
+++ b/lib/Doctrine/Validator/Enum.php
@@ -30,7 +30,8 @@
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Validator_Enum {
+class Doctrine_Validator_Enum
+{
     /**
      * @param Doctrine_Record $record
      * @param string $key
@@ -38,7 +39,8 @@ class Doctrine_Validator_Enum {
      * @param string $args
      * @return boolean
      */
-    public function validate(Doctrine_Record $record, $key, $value, $args) {
+    public function validate(Doctrine_Record $record, $key, $value, $args)
+    {
         $max = substr_count($args, '-');
         $int = (int) $value;
 
diff --git a/lib/Doctrine/Validator/ErrorStack.php b/lib/Doctrine/Validator/ErrorStack.php
index b268e2693..cb0e368c3 100644
--- a/lib/Doctrine/Validator/ErrorStack.php
+++ b/lib/Doctrine/Validator/ErrorStack.php
@@ -30,7 +30,8 @@
  * @since       1.0
  * @version     $Revision$
  */
-class Doctrine_Validator_ErrorStack extends Doctrine_Access implements Countable, IteratorAggregate {
+class Doctrine_Validator_ErrorStack extends Doctrine_Access implements Countable, IteratorAggregate
+{
 
     /**
      * The errors of the error stack.
@@ -52,7 +53,8 @@ class Doctrine_Validator_ErrorStack extends Doctrine_Access implements Countable
      * @param string $invalidFieldName
      * @param string $errorType
      */
-    public function add($invalidFieldName, $errorCode = 'general') {
+    public function add($invalidFieldName, $errorCode = 'general')
+    {
         $this->errors[$invalidFieldName][] = $errorCode;
     }
 
@@ -61,7 +63,8 @@ class Doctrine_Validator_ErrorStack extends Doctrine_Access implements Countable
      *
      * @param string $fieldName
      */
-    public function remove($fieldName) {
+    public function remove($fieldName)
+    {
         if (isset($this->errors[$fieldName])) {
             unset($this->errors[$fieldName]);
         }
@@ -73,7 +76,8 @@ class Doctrine_Validator_ErrorStack extends Doctrine_Access implements Countable
      * @param unknown_type $name
      * @return unknown
      */
-    public function get($fieldName) {
+    public function get($fieldName)
+    {
         return isset($this->errors[$fieldName]) ? $this->errors[$fieldName] : null;
     }
 
@@ -82,7 +86,8 @@ class Doctrine_Validator_ErrorStack extends Doctrine_Access implements Countable
      *
      * @param unknown_type $name
      */
-    public function set($fieldName, $errorCode) {
+    public function set($fieldName, $errorCode)
+    {
         $this->add($fieldName, $errorCode);
     }
 
@@ -91,14 +96,16 @@ class Doctrine_Validator_ErrorStack extends Doctrine_Access implements Countable
      *
      * @return unknown
      */
-    public function contains($fieldName) {
+    public function contains($fieldName)
+    {
         return array_key_exists($fieldName, $this->errors);
     }
 
     /**
      * Removes all errors from the stack.
      */
-    public function clear() {
+    public function clear()
+    {
         $this->errors = array();
     }
 
@@ -109,7 +116,8 @@ class Doctrine_Validator_ErrorStack extends Doctrine_Access implements Countable
      *
      * @return unknown
      */
-    public function getIterator() {
+    public function getIterator()
+    {
         return new ArrayIterator($this->errors);
     }
 
@@ -120,7 +128,8 @@ class Doctrine_Validator_ErrorStack extends Doctrine_Access implements Countable
      *
      * @return unknown
      */
-    public function count() {
+    public function count()
+    {
         return count($this->errors);
     }
 }
diff --git a/lib/Doctrine/Validator/Exception.php b/lib/Doctrine/Validator/Exception.php
index 9cd7b8787..bcad7cacc 100644
--- a/lib/Doctrine/Validator/Exception.php
+++ b/lib/Doctrine/Validator/Exception.php
@@ -30,7 +30,8 @@ Doctrine::autoload('Doctrine_Exception');
  * @since       1.0
  * @version     $Revision$
  */
-class Doctrine_Validator_Exception extends Doctrine_Exception implements Countable, IteratorAggregate {
+class Doctrine_Validator_Exception extends Doctrine_Exception implements Countable, IteratorAggregate
+{
     /**
      * @var array $invalid
      */
@@ -38,19 +39,23 @@ class Doctrine_Validator_Exception extends Doctrine_Exception implements Countab
     /**
      * @param Doctrine_Validator $validator
      */
-    public function __construct(array $invalid) {
+    public function __construct(array $invalid)
+    {
         $this->invalid = $invalid;
     }
 
-    public function getInvalidRecords() {
+    public function getInvalidRecords()
+    {
         return $this->invalid;
     }
 
-    public function getIterator() {
+    public function getIterator()
+    {
         return new ArrayIterator($this->invalid);
     }
 
-    public function count() {
+    public function count()
+    {
         return count($this->invalid);
     }
     /**
@@ -58,7 +63,8 @@ class Doctrine_Validator_Exception extends Doctrine_Exception implements Countab
      *
      * @return string
      */
-    public function __toString() {
+    public function __toString()
+    {
 
         return parent::__toString();
     }
diff --git a/lib/Doctrine/Validator/Htmlcolor.php b/lib/Doctrine/Validator/Htmlcolor.php
index 1cd7c3de0..2628aa2d6 100644
--- a/lib/Doctrine/Validator/Htmlcolor.php
+++ b/lib/Doctrine/Validator/Htmlcolor.php
@@ -30,7 +30,8 @@
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Validator_HtmlColor {
+class Doctrine_Validator_HtmlColor
+{
     /**
      * @param Doctrine_Record $record
      * @param string $key
@@ -38,7 +39,8 @@ class Doctrine_Validator_HtmlColor {
      * @param string $args
      * @return boolean
      */
-    public function validate(Doctrine_Record $record, $key, $value, $args) {
+    public function validate(Doctrine_Record $record, $key, $value, $args)
+    {
         if ( ! preg_match("/^#{0,1}[0-9]{6}$/",$color)) {
             return false;
         }
diff --git a/lib/Doctrine/Validator/Ip.php b/lib/Doctrine/Validator/Ip.php
index 694d65ec6..f4b10c0b6 100644
--- a/lib/Doctrine/Validator/Ip.php
+++ b/lib/Doctrine/Validator/Ip.php
@@ -30,7 +30,8 @@
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Validator_Ip {
+class Doctrine_Validator_Ip
+{
     /**
      * @param Doctrine_Record $record
      * @param string $key
@@ -38,7 +39,8 @@ class Doctrine_Validator_Ip {
      * @param string $args
      * @return boolean
      */
-    public function validate(Doctrine_Record $record, $key, $value, $args) {
+    public function validate(Doctrine_Record $record, $key, $value, $args)
+    {
         return (bool) ip2long(str_replace("\0", '', $value));
     }
 }
diff --git a/lib/Doctrine/Validator/Nospace.php b/lib/Doctrine/Validator/Nospace.php
index 60d03df56..8fbfb6afc 100644
--- a/lib/Doctrine/Validator/Nospace.php
+++ b/lib/Doctrine/Validator/Nospace.php
@@ -30,7 +30,8 @@
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Validator_Nospace {
+class Doctrine_Validator_Nospace
+{
     /**
      * @param Doctrine_Record $record
      * @param string $key
@@ -38,7 +39,8 @@ class Doctrine_Validator_Nospace {
      * @param string $args
      * @return boolean
      */
-    public function validate(Doctrine_Record $record, $key, $value, $args) {
+    public function validate(Doctrine_Record $record, $key, $value, $args)
+    {
         return ($value === null || ! preg_match('/\s\t\r\n/',$value));
     }
 }
diff --git a/lib/Doctrine/Validator/Notblank.php b/lib/Doctrine/Validator/Notblank.php
index daebd5781..003ed767b 100644
--- a/lib/Doctrine/Validator/Notblank.php
+++ b/lib/Doctrine/Validator/Notblank.php
@@ -30,7 +30,8 @@
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Validator_Notblank {
+class Doctrine_Validator_Notblank
+{
     /**
      * @param Doctrine_Record $record
      * @param string $key
@@ -38,7 +39,8 @@ class Doctrine_Validator_Notblank {
      * @param string $args
      * @return boolean
      */
-    public function validate(Doctrine_Record $record, $key, $value, $args) {
+    public function validate(Doctrine_Record $record, $key, $value, $args)
+    {
         return (trim($value) != "");
     }
 }
diff --git a/lib/Doctrine/Validator/Notnull.php b/lib/Doctrine/Validator/Notnull.php
index 62f2a0f2f..2ceb11a08 100644
--- a/lib/Doctrine/Validator/Notnull.php
+++ b/lib/Doctrine/Validator/Notnull.php
@@ -30,14 +30,16 @@
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Validator_Notnull {
+class Doctrine_Validator_Notnull
+{
     /**
      * @param Doctrine_Record $record
      * @param string $key
      * @param mixed $value
      * @return boolean
      */
-    public function validate(Doctrine_Record $record, $key, $value) {
+    public function validate(Doctrine_Record $record, $key, $value)
+    {
         if ($value === null || $value === '') {
             return false;
         }
diff --git a/lib/Doctrine/Validator/Range.php b/lib/Doctrine/Validator/Range.php
index dea994333..b103c255c 100644
--- a/lib/Doctrine/Validator/Range.php
+++ b/lib/Doctrine/Validator/Range.php
@@ -30,7 +30,8 @@
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Validator_Range {
+class Doctrine_Validator_Range
+{
     /**
      * @param Doctrine_Record $record
      * @param string $key
@@ -38,7 +39,8 @@ class Doctrine_Validator_Range {
      * @param string $args
      * @return boolean
      */
-    public function validate(Doctrine_Record $record, $key, $value, $args) {
+    public function validate(Doctrine_Record $record, $key, $value, $args)
+    {
         if (isset($args[0]) && $value < $args[0]) {
             return false;
         }
diff --git a/lib/Doctrine/Validator/Regexp.php b/lib/Doctrine/Validator/Regexp.php
index 8464dfc68..18d00c264 100644
--- a/lib/Doctrine/Validator/Regexp.php
+++ b/lib/Doctrine/Validator/Regexp.php
@@ -30,7 +30,8 @@
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Validator_Regexp {
+class Doctrine_Validator_Regexp
+{
     /**
      * @param Doctrine_Record $record
      * @param string $key
@@ -38,7 +39,8 @@ class Doctrine_Validator_Regexp {
      * @param string $args
      * @return boolean
      */
-    public function validate(Doctrine_Record $record, $key, $value, $args) {
+    public function validate(Doctrine_Record $record, $key, $value, $args)
+    {
         if (is_array($args)) {
             foreach ($args as $regexp) {
                 if ( ! preg_match($args, $value)) {
diff --git a/lib/Doctrine/Validator/Unique.php b/lib/Doctrine/Validator/Unique.php
index 967b3c578..f5748c5db 100644
--- a/lib/Doctrine/Validator/Unique.php
+++ b/lib/Doctrine/Validator/Unique.php
@@ -30,7 +30,8 @@
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Validator_Unique {
+class Doctrine_Validator_Unique
+{
     /**
      * @param Doctrine_Record $record
      * @param string $key
@@ -38,7 +39,8 @@ class Doctrine_Validator_Unique {
      * @param string $args
      * @return boolean
      */
-    public function validate(Doctrine_Record $record, $key, $value, $args) {
+    public function validate(Doctrine_Record $record, $key, $value, $args)
+    {
         $table = $record->getTable();
         $sql   = 'SELECT ' . $table->getIdentifier() . ' FROM ' . $table->getTableName() . ' WHERE ' . $key . ' = ?';
         $stmt  = $table->getConnection()->getDbh()->prepare($sql);
diff --git a/lib/Doctrine/Validator/Usstate.php b/lib/Doctrine/Validator/Usstate.php
index 48175ad87..31f001994 100644
--- a/lib/Doctrine/Validator/Usstate.php
+++ b/lib/Doctrine/Validator/Usstate.php
@@ -30,7 +30,8 @@
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_Validator_Usstate {
+class Doctrine_Validator_Usstate
+{
     private static $states = array (
                 "AK" =>	true,
                 "AL" => true,
@@ -86,7 +87,8 @@ class Doctrine_Validator_Usstate {
                 "WV" =>	true,
                 "WY" =>	true
             );
-    public function getStates() {
+    public function getStates()
+    {
         return self::$states;
     }
     /**
@@ -96,7 +98,8 @@ class Doctrine_Validator_Usstate {
      * @param string $args
      * @return boolean
      */
-    public function validate(Doctrine_Record $record, $key, $value, $args) {
+    public function validate(Doctrine_Record $record, $key, $value, $args)
+    {
         return isset(self::$states[$value]);
     }
 }
diff --git a/lib/Doctrine/ValueHolder.php b/lib/Doctrine/ValueHolder.php
index 5051212e0..16fa65d5e 100644
--- a/lib/Doctrine/ValueHolder.php
+++ b/lib/Doctrine/ValueHolder.php
@@ -33,35 +33,42 @@ Doctrine::autoload('Doctrine_Access');
  * @version     $Revision$
  * @author      Konsta Vesterinen 
  */
-class Doctrine_ValueHolder extends Doctrine_Access implements Countable {
+class Doctrine_ValueHolder extends Doctrine_Access implements Countable
+{
 
     public $data = array();
 
     private $table;
 
-    public function __construct(Doctrine_Table $table) {
+    public function __construct(Doctrine_Table $table)
+    {
         $this->table = $table;
     }
 
-    public function set($name, $value) {
+    public function set($name, $value)
+    {
         $this->data[$name] = $value;
     }
 
-    public function get($name) {
+    public function get($name)
+    {
         if ( ! isset($this->data[$name])) {
             throw new Doctrine_Exception("Unknown property $name.");
         }
         return $this->data[$name];
     }
-    public function count() {
+    public function count()
+    {
         return count($this->data);
     }
 
-    public function delete() {
+    public function delete()
+    {
         throw new Doctrine_Exception("Method 'delete' not availible on Doctrine_ValueHolder.");
     }
 
-    public function save() {
+    public function save()
+    {
         throw new Doctrine_Exception("Method 'save' not availible on Doctrine_ValueHolder.");
     }
 }
diff --git a/lib/Doctrine/View.php b/lib/Doctrine/View.php
index ad65e5eb4..68b3812ae 100644
--- a/lib/Doctrine/View.php
+++ b/lib/Doctrine/View.php
@@ -31,7 +31,8 @@
  * @since       1.0
  * @version     $Revision$
  */
-class Doctrine_View {
+class Doctrine_View
+{
     /**
      * SQL DROP constant
      */
@@ -63,7 +64,8 @@ class Doctrine_View {
      *
      * @param Doctrine_Query $query
      */
-    public function __construct(Doctrine_Query $query, $viewName) {
+    public function __construct(Doctrine_Query $query, $viewName)
+    {
         $this->name  = $viewName;
         $this->query = $query;
         $this->query->setView($this);
@@ -75,7 +77,8 @@ class Doctrine_View {
      *
      * @return Doctrine_Query
      */
-    public function getQuery() {
+    public function getQuery()
+    {
         return $this->query;
     }
     /**
@@ -84,7 +87,8 @@ class Doctrine_View {
      *
      * @return string
      */
-    public function getName() {
+    public function getName()
+    {
         return $this->name;
     }
     /**
@@ -93,7 +97,8 @@ class Doctrine_View {
      *
      * @return Doctrine_Connection
      */
-    public function getConnection() {
+    public function getConnection()
+    {
         return $this->conn;
     }
     /**
@@ -103,7 +108,8 @@ class Doctrine_View {
      * @throws Doctrine_View_Exception
      * @return void
      */
-    public function create() {
+    public function create()
+    {
         $sql = sprintf(self::CREATE, $this->name, $this->query->getQuery());
         try {
             $this->conn->execute($sql);
@@ -118,7 +124,8 @@ class Doctrine_View {
      * @throws Doctrine_View_Exception
      * @return void
      */
-    public function drop() {
+    public function drop()
+    {
         try {
             $this->conn->execute(sprintf(self::DROP, $this->name));
         } catch(Doctrine_Exception $e) {
@@ -132,7 +139,8 @@ class Doctrine_View {
      *
      * @return Doctrine_Collection
      */
-    public function execute() {
+    public function execute()
+    {
         return $this->query->execute();
     }
     /**
@@ -141,7 +149,8 @@ class Doctrine_View {
      *
      * @return string
      */
-    public function getSelectSql() {
+    public function getSelectSql()
+    {
         return sprintf(self::SELECT, $this->name);
     }
 }
diff --git a/lib/Doctrine/View/Exception.php b/lib/Doctrine/View/Exception.php
index 67f1a6262..ecfd5494d 100644
--- a/lib/Doctrine/View/Exception.php
+++ b/lib/Doctrine/View/Exception.php
@@ -30,4 +30,5 @@ Doctrine::autoload('Doctrine_View_Exception');
  * @since       1.0
  * @version     $Revision$
  */
-class Doctrine_View_Exception extends Doctrine_Exception { }
+class Doctrine_View_Exception extends Doctrine_Exception
+{ }