From 514e17ea70ae55e198d5f0ff3c6b8b6bbdb4eecc Mon Sep 17 00:00:00 2001 From: jwage Date: Fri, 22 Feb 2008 18:11:35 +0000 Subject: [PATCH] Changed all references from phpdoctrine.com to phpdoctrine.org --- lib/Doctrine.php | 2 +- lib/Doctrine/Access.php | 2 +- lib/Doctrine/Adapter.php | 2 +- lib/Doctrine/Adapter/Db2.php | 2 +- lib/Doctrine/Adapter/Db2/Exception.php | 2 +- lib/Doctrine/Adapter/Exception.php | 2 +- lib/Doctrine/Adapter/Interface.php | 2 +- lib/Doctrine/Adapter/Mock.php | 2 +- lib/Doctrine/Adapter/Mysqli.php | 2 +- lib/Doctrine/Adapter/Oracle.php | 2 +- lib/Doctrine/Adapter/Resource.php | 2 +- lib/Doctrine/Adapter/Statement.php | 2 +- lib/Doctrine/Adapter/Statement/Interface.php | 2 +- lib/Doctrine/Adapter/Statement/Mock.php | 2 +- lib/Doctrine/AuditLog.php | 2 +- lib/Doctrine/AuditLog/Listener.php | 2 +- lib/Doctrine/Builder.php | 2 +- lib/Doctrine/Builder/Exception.php | 2 +- lib/Doctrine/Builder/Migration.php | 2 +- lib/Doctrine/Builder/Record.php | 2 +- lib/Doctrine/Cache.php | 2 +- lib/Doctrine/Cache/Apc.php | 2 +- lib/Doctrine/Cache/Array.php | 2 +- lib/Doctrine/Cache/Db.php | 2 +- lib/Doctrine/Cache/Driver.php | 2 +- lib/Doctrine/Cache/Exception.php | 2 +- lib/Doctrine/Cache/Interface.php | 2 +- lib/Doctrine/Cache/Memcache.php | 2 +- lib/Doctrine/Cache/Xcache.php | 2 +- lib/Doctrine/Cli.php | 2 +- lib/Doctrine/Cli/Exception.php | 2 +- lib/Doctrine/Collection.php | 2 +- lib/Doctrine/Collection/Exception.php | 2 +- lib/Doctrine/Collection/Iterator.php | 2 +- .../Collection/Iterator/Expandable.php | 2 +- lib/Doctrine/Collection/Iterator/Normal.php | 2 +- lib/Doctrine/Collection/Iterator/Offset.php | 2 +- lib/Doctrine/Collection/Offset.php | 2 +- lib/Doctrine/Compiler/Exception.php | 2 +- lib/Doctrine/Configurable.php | 2 +- lib/Doctrine/Connection.php | 2 +- lib/Doctrine/Connection/Common.php | 2 +- lib/Doctrine/Connection/Db2.php | 2 +- lib/Doctrine/Connection/Exception.php | 2 +- lib/Doctrine/Connection/Firebird.php | 2 +- .../Connection/Firebird/Exception.php | 2 +- lib/Doctrine/Connection/Informix.php | 2 +- .../Connection/Informix/Exception.php | 2 +- lib/Doctrine/Connection/Mock.php | 2 +- lib/Doctrine/Connection/Module.php | 2 +- lib/Doctrine/Connection/Mssql.php | 2 +- lib/Doctrine/Connection/Mssql/Exception.php | 2 +- lib/Doctrine/Connection/Mysql.php | 2 +- lib/Doctrine/Connection/Mysql/Exception.php | 2 +- lib/Doctrine/Connection/Oracle.php | 2 +- lib/Doctrine/Connection/Oracle/Exception.php | 2 +- lib/Doctrine/Connection/Pgsql.php | 2 +- lib/Doctrine/Connection/Pgsql/Exception.php | 2 +- lib/Doctrine/Connection/Profiler.php | 2 +- .../Connection/Profiler/Exception.php | 2 +- lib/Doctrine/Connection/Sqlite.php | 2 +- lib/Doctrine/Connection/Sqlite/Exception.php | 2 +- lib/Doctrine/Connection/Statement.php | 2 +- lib/Doctrine/Connection/UnitOfWork.php | 2 +- lib/Doctrine/Data.php | 2 +- lib/Doctrine/Data/Exception.php | 2 +- lib/Doctrine/Data/Export.php | 2 +- lib/Doctrine/Data/Import.php | 2 +- lib/Doctrine/DataDict.php | 2 +- lib/Doctrine/DataDict/Exception.php | 2 +- lib/Doctrine/DataDict/Firebird.php | 2 +- lib/Doctrine/DataDict/Informix.php | 2 +- lib/Doctrine/DataDict/Mssql.php | 2 +- lib/Doctrine/DataDict/Mysql.php | 2 +- lib/Doctrine/DataDict/Oracle.php | 2 +- lib/Doctrine/DataDict/Pgsql.php | 2 +- lib/Doctrine/DataDict/Sqlite.php | 2 +- lib/Doctrine/Event.php | 2 +- lib/Doctrine/EventListener.php | 2 +- lib/Doctrine/EventListener/Chain.php | 2 +- lib/Doctrine/EventListener/Exception.php | 2 +- lib/Doctrine/EventListener/Interface.php | 2 +- lib/Doctrine/Exception.php | 2 +- lib/Doctrine/Export.php | 2 +- lib/Doctrine/Export/Exception.php | 2 +- lib/Doctrine/Export/Firebird.php | 2 +- lib/Doctrine/Export/Frontbase.php | 2 +- lib/Doctrine/Export/Mssql.php | 2 +- lib/Doctrine/Export/Mysql.php | 2 +- lib/Doctrine/Export/Oracle.php | 2 +- lib/Doctrine/Export/Pgsql.php | 2 +- lib/Doctrine/Export/Reporter.php | 2 +- lib/Doctrine/Export/Schema.php | 2 +- lib/Doctrine/Export/Sqlite.php | 2 +- lib/Doctrine/Expression.php | 2 +- lib/Doctrine/Expression/Driver.php | 2 +- lib/Doctrine/Expression/Exception.php | 2 +- lib/Doctrine/Expression/Firebird.php | 2 +- lib/Doctrine/Expression/Informix.php | 2 +- lib/Doctrine/Expression/Mock.php | 2 +- lib/Doctrine/Expression/Mssql.php | 2 +- lib/Doctrine/Expression/Mysql.php | 2 +- lib/Doctrine/Expression/Oracle.php | 2 +- lib/Doctrine/Expression/Pgsql.php | 2 +- lib/Doctrine/Expression/Sqlite.php | 2 +- lib/Doctrine/File.php | 2 +- lib/Doctrine/File/Index.php | 2 +- lib/Doctrine/Formatter.php | 2 +- lib/Doctrine/Hook.php | 2 +- lib/Doctrine/Hook/Equal.php | 2 +- lib/Doctrine/Hook/Integer.php | 2 +- lib/Doctrine/Hook/Parser.php | 2 +- lib/Doctrine/Hook/Parser/Complex.php | 2 +- lib/Doctrine/Hook/WordLike.php | 2 +- lib/Doctrine/Hydrator.php | 2 +- lib/Doctrine/Hydrator/Abstract.php | 2 +- lib/Doctrine/Hydrator/ArrayDriver.php | 2 +- lib/Doctrine/Hydrator/Exception.php | 2 +- lib/Doctrine/Hydrator/RecordDriver.php | 2 +- lib/Doctrine/I18n.php | 2 +- lib/Doctrine/I18n/Exception.php | 2 +- lib/Doctrine/Import.php | 2 +- lib/Doctrine/Import/Exception.php | 2 +- lib/Doctrine/Import/Firebird.php | 2 +- lib/Doctrine/Import/Informix.php | 2 +- lib/Doctrine/Import/Mssql.php | 2 +- lib/Doctrine/Import/Mysql.php | 2 +- lib/Doctrine/Import/Oracle.php | 2 +- lib/Doctrine/Import/Pgsql.php | 2 +- lib/Doctrine/Import/Reader.php | 2 +- lib/Doctrine/Import/Reader/Db.php | 2 +- lib/Doctrine/Import/Reader/Exception.php | 2 +- lib/Doctrine/Import/Reader/Propel.php | 2 +- lib/Doctrine/Import/Schema.php | 2 +- lib/Doctrine/Import/Sqlite.php | 2 +- lib/Doctrine/Inflector.php | 2 +- lib/Doctrine/IntegrityMapper.php | 2 +- lib/Doctrine/Lib.php | 2 +- lib/Doctrine/Locking/Exception.php | 2 +- lib/Doctrine/Locking/Manager/Pessimistic.php | 2 +- lib/Doctrine/Log.php | 2 +- lib/Doctrine/Log/Exception.php | 2 +- lib/Doctrine/Log/Filter/Interface.php | 2 +- lib/Doctrine/Log/Filter/Message.php | 2 +- lib/Doctrine/Log/Filter/Priority.php | 2 +- lib/Doctrine/Log/Filter/Suppress.php | 2 +- lib/Doctrine/Log/Formatter/Interface.php | 2 +- lib/Doctrine/Log/Formatter/Simple.php | 2 +- lib/Doctrine/Log/Formatter/Xml.php | 2 +- lib/Doctrine/Log/Writer/Abstract.php | 2 +- lib/Doctrine/Log/Writer/Db.php | 2 +- lib/Doctrine/Log/Writer/Mock.php | 2 +- lib/Doctrine/Log/Writer/Null.php | 2 +- lib/Doctrine/Log/Writer/Stream.php | 2 +- lib/Doctrine/Manager.php | 2 +- lib/Doctrine/Manager/Exception.php | 2 +- lib/Doctrine/Migration.php | 2 +- lib/Doctrine/Migration/Diff.php | 2 +- lib/Doctrine/Migration/Exception.php | 2 +- .../IrreversibleMigrationException.php | 2 +- lib/Doctrine/Migration/Process.php | 2 +- lib/Doctrine/Node.php | 2 +- lib/Doctrine/Node/AdjacencyList.php | 2 +- .../Node/AdjacencyList/LevelOrderIterator.php | 2 +- .../Node/AdjacencyList/PostOrderIterator.php | 2 +- .../Node/AdjacencyList/PreOrderIterator.php | 2 +- lib/Doctrine/Node/Exception.php | 2 +- lib/Doctrine/Node/Interface.php | 2 +- lib/Doctrine/Node/MaterializedPath.php | 2 +- .../MaterializedPath/LevelOrderIterator.php | 2 +- .../MaterializedPath/PostOrderIterator.php | 2 +- .../MaterializedPath/PreOrderIterator.php | 2 +- lib/Doctrine/Node/NestedSet.php | 2 +- .../Node/NestedSet/LevelOrderIterator.php | 2 +- .../Node/NestedSet/PostOrderIterator.php | 2 +- .../Node/NestedSet/PreOrderIterator.php | 2 +- lib/Doctrine/Null.php | 2 +- lib/Doctrine/Overloadable.php | 2 +- lib/Doctrine/Parser.php | 2 +- lib/Doctrine/Parser/Exception.php | 2 +- lib/Doctrine/Parser/Json.php | 2 +- lib/Doctrine/Parser/Serialize.php | 2 +- lib/Doctrine/Parser/Xml.php | 2 +- lib/Doctrine/Parser/Yml.php | 2 +- lib/Doctrine/Query.php | 2 +- lib/Doctrine/Query/Abstract.php | 2 +- lib/Doctrine/Query/Check.php | 2 +- lib/Doctrine/Query/Condition.php | 2 +- lib/Doctrine/Query/Exception.php | 2 +- lib/Doctrine/Query/Filter.php | 2 +- lib/Doctrine/Query/Filter/Chain.php | 2 +- lib/Doctrine/Query/Filter/Interface.php | 2 +- lib/Doctrine/Query/From.php | 2 +- lib/Doctrine/Query/Groupby.php | 2 +- lib/Doctrine/Query/Having.php | 2 +- lib/Doctrine/Query/JoinCondition.php | 2 +- lib/Doctrine/Query/Limit.php | 2 +- lib/Doctrine/Query/Offset.php | 2 +- lib/Doctrine/Query/Orderby.php | 2 +- lib/Doctrine/Query/Parser.php | 2 +- lib/Doctrine/Query/Part.php | 2 +- lib/Doctrine/Query/Registry.php | 2 +- lib/Doctrine/Query/Registry/Exception.php | 2 +- lib/Doctrine/Query/Select.php | 2 +- lib/Doctrine/Query/Set.php | 2 +- lib/Doctrine/Query/Tokenizer.php | 2 +- lib/Doctrine/Query/Tokenizer/Exception.php | 2 +- lib/Doctrine/Query/Where.php | 2 +- lib/Doctrine/RawSql.php | 2 +- lib/Doctrine/RawSql/Exception.php | 2 +- lib/Doctrine/Record.php | 2 +- lib/Doctrine/Record/Abstract.php | 2 +- lib/Doctrine/Record/Exception.php | 2 +- lib/Doctrine/Record/Filter.php | 2 +- lib/Doctrine/Record/Filter/Compound.php | 2 +- lib/Doctrine/Record/Filter/Standard.php | 2 +- lib/Doctrine/Record/Generator.php | 2 +- lib/Doctrine/Record/Iterator.php | 2 +- lib/Doctrine/Record/Listener.php | 2 +- lib/Doctrine/Record/Listener/Chain.php | 2 +- lib/Doctrine/Record/Listener/Interface.php | 2 +- lib/Doctrine/Record/State/Exception.php | 2 +- lib/Doctrine/Relation.php | 2 +- lib/Doctrine/Relation/Association.php | 2 +- lib/Doctrine/Relation/Association/Self.php | 2 +- lib/Doctrine/Relation/Exception.php | 2 +- lib/Doctrine/Relation/ForeignKey.php | 2 +- lib/Doctrine/Relation/LocalKey.php | 2 +- lib/Doctrine/Relation/Nest.php | 2 +- lib/Doctrine/Relation/Parser.php | 2 +- lib/Doctrine/Relation/Parser/Exception.php | 2 +- lib/Doctrine/Search.php | 2 +- lib/Doctrine/Search/Analyzer.php | 2 +- lib/Doctrine/Search/Analyzer/Exception.php | 2 +- lib/Doctrine/Search/Analyzer/Interface.php | 2 +- lib/Doctrine/Search/Analyzer/Standard.php | 2 +- lib/Doctrine/Search/Exception.php | 2 +- lib/Doctrine/Search/File.php | 2 +- lib/Doctrine/Search/Indexer.php | 2 +- lib/Doctrine/Search/Indexer/Dir.php | 2 +- lib/Doctrine/Search/Indexer/Exception.php | 2 +- lib/Doctrine/Search/Listener.php | 2 +- lib/Doctrine/Search/Parser.php | 2 +- lib/Doctrine/Search/Query.php | 2 +- lib/Doctrine/Search/Record.php | 2 +- lib/Doctrine/Search/Scorer.php | 2 +- lib/Doctrine/Sequence.php | 2 +- lib/Doctrine/Sequence/Db2.php | 2 +- lib/Doctrine/Sequence/Exception.php | 2 +- lib/Doctrine/Sequence/Firebird.php | 2 +- lib/Doctrine/Sequence/Informix.php | 2 +- lib/Doctrine/Sequence/Mssql.php | 2 +- lib/Doctrine/Sequence/Mysql.php | 2 +- lib/Doctrine/Sequence/Oracle.php | 2 +- lib/Doctrine/Sequence/Pgsql.php | 2 +- lib/Doctrine/Sequence/Sqlite.php | 2 +- lib/Doctrine/Table/Exception.php | 2 +- lib/Doctrine/Table/Repository.php | 2 +- lib/Doctrine/Table/Repository/Exception.php | 2 +- lib/Doctrine/Task.php | 2 +- lib/Doctrine/Task/BuildAll.php | 2 +- lib/Doctrine/Task/BuildAllLoad.php | 2 +- lib/Doctrine/Task/BuildAllReload.php | 2 +- lib/Doctrine/Task/Compile.php | 2 +- lib/Doctrine/Task/CreateDb.php | 2 +- lib/Doctrine/Task/CreateTables.php | 2 +- lib/Doctrine/Task/Dql.php | 2 +- lib/Doctrine/Task/DropDb.php | 2 +- lib/Doctrine/Task/DumpData.php | 2 +- lib/Doctrine/Task/Exception.php | 2 +- lib/Doctrine/Task/GenerateMigration.php | 2 +- lib/Doctrine/Task/GenerateMigrationsDb.php | 2 +- .../Task/GenerateMigrationsModels.php | 2 +- lib/Doctrine/Task/GenerateModelsDb.php | 2 +- lib/Doctrine/Task/GenerateModelsYaml.php | 2 +- lib/Doctrine/Task/GenerateSql.php | 2 +- lib/Doctrine/Task/GenerateYamlDb.php | 2 +- lib/Doctrine/Task/GenerateYamlModels.php | 2 +- lib/Doctrine/Task/LoadData.php | 2 +- lib/Doctrine/Task/LoadDummyData.php | 2 +- lib/Doctrine/Task/Migrate.php | 2 +- lib/Doctrine/Task/RebuildDb.php | 2 +- lib/Doctrine/Template.php | 2 +- lib/Doctrine/Template/Geographical.php | 2 +- lib/Doctrine/Template/I18n.php | 2 +- lib/Doctrine/Template/Listener/Sluggable.php | 2 +- .../Template/Listener/Timestampable.php | 2 +- lib/Doctrine/Template/NestedSet.php | 2 +- lib/Doctrine/Template/Searchable.php | 2 +- lib/Doctrine/Template/Sluggable.php | 2 +- lib/Doctrine/Template/Taggable.php | 2 +- lib/Doctrine/Template/Timestampable.php | 2 +- lib/Doctrine/Template/Versionable.php | 2 +- lib/Doctrine/Transaction.php | 2 +- lib/Doctrine/Transaction/Exception.php | 2 +- lib/Doctrine/Transaction/Firebird.php | 2 +- lib/Doctrine/Transaction/Informix.php | 2 +- lib/Doctrine/Transaction/Mock.php | 2 +- lib/Doctrine/Transaction/Mssql.php | 2 +- lib/Doctrine/Transaction/Mysql.php | 2 +- lib/Doctrine/Transaction/Oracle.php | 2 +- lib/Doctrine/Transaction/Pgsql.php | 2 +- lib/Doctrine/Transaction/Sqlite.php | 2 +- lib/Doctrine/Tree.php | 2 +- lib/Doctrine/Tree/AdjacencyList.php | 2 +- lib/Doctrine/Tree/Exception.php | 2 +- lib/Doctrine/Tree/Interface.php | 2 +- lib/Doctrine/Tree/MaterializedPath.php | 2 +- lib/Doctrine/Tree/NestedSet.php | 2 +- lib/Doctrine/Util.php | 2 +- lib/Doctrine/Validator.php | 2 +- lib/Doctrine/Validator/Country.php | 2 +- lib/Doctrine/Validator/Creditcard.php | 2 +- lib/Doctrine/Validator/Date.php | 2 +- lib/Doctrine/Validator/Driver.php | 2 +- lib/Doctrine/Validator/Email.php | 2 +- lib/Doctrine/Validator/ErrorStack.php | 2 +- lib/Doctrine/Validator/Exception.php | 2 +- lib/Doctrine/Validator/Future.php | 2 +- lib/Doctrine/Validator/Htmlcolor.php | 2 +- lib/Doctrine/Validator/Ip.php | 2 +- lib/Doctrine/Validator/Minlength.php | 2 +- lib/Doctrine/Validator/Nospace.php | 2 +- lib/Doctrine/Validator/Notblank.php | 2 +- lib/Doctrine/Validator/Notnull.php | 2 +- lib/Doctrine/Validator/Past.php | 2 +- lib/Doctrine/Validator/Range.php | 2 +- lib/Doctrine/Validator/Readonly.php | 4 +- lib/Doctrine/Validator/Regexp.php | 2 +- lib/Doctrine/Validator/Unique.php | 2 +- lib/Doctrine/Validator/Unsigned.php | 2 +- lib/Doctrine/Validator/Usstate.php | 2 +- lib/Doctrine/View.php | 2 +- lib/Doctrine/View/Exception.php | 2 +- tests/Orm/Component/AccessTest.php | 2 +- tests/Orm/Component/CollectionTest.php | 2 +- tests_old/AccessTestCase.php | 4 +- tests_old/AuditLogTestCase.php | 4 +- tests_old/BatchIteratorTestCase.php | 4 +- tests_old/Cache/ApcTestCase.php | 4 +- tests_old/Cache/MemcacheTestCase.php | 4 +- tests_old/Cache/SqliteTestCase.php | 4 +- tests_old/CacheTestCase.php | 4 +- tests_old/CascadingDeleteTestCase.php | 4 +- tests_old/ClassTableInheritanceTestCase.php | 4 +- tests_old/Collection/SnapshotTestCase.php | 4 +- tests_old/CollectionTestCase.php | 4 +- .../ColumnAggregationInheritanceTestCase.php | 4 +- tests_old/ColumnAliasTestCase.php | 4 +- tests_old/Connection/MssqlTestCase.php | 4 +- tests_old/Connection/MysqlTestCase.php | 4 +- tests_old/Connection/OracleTestCase.php | 4 +- tests_old/Connection/PgsqlTestCase.php | 4 +- tests_old/Connection/ProfilerTestCase.php | 4 +- tests_old/Connection/SqliteTestCase.php | 4 +- tests_old/Connection/UnitOfWork.php | 4 +- tests_old/ConnectionTestCase.php | 4 +- tests_old/CtiColumnAggregationTestCase.php | 4 +- tests_old/CustomPrimaryKeyTestCase.php | 4 +- tests_old/CustomResultSetOrderTestCase.php | 4 +- .../CustomResultSetOrderTestCaseTestCase.php | 4 +- tests_old/DBTestCase.php | 4 +- tests_old/Data/ExportTestCase.php | 4 +- tests_old/Data/ImportTestCase.php | 4 +- tests_old/DataDict/FirebirdTestCase.php | 4 +- tests_old/DataDict/InformixTestCase.php | 4 +- tests_old/DataDict/MssqlTestCase.php | 4 +- tests_old/DataDict/MysqlTestCase.php | 4 +- tests_old/DataDict/OracleTestCase.php | 4 +- tests_old/DataDict/PgsqlTestCase.php | 4 +- tests_old/DataDict/SqliteTestCase.php | 4 +- tests_old/DataDictTestCase.php | 4 +- tests_old/DataType/BooleanTestCase.php | 4 +- tests_old/DataType/EnumTestCase.php | 4 +- tests_old/Db/ProfilerTestCase.php | 4 +- tests_old/DoctrineTest.php | 4 +- tests_old/DoctrineTest/Coverage.php | 4 +- .../DoctrineTest/Doctrine_UnitTestCase.php | 4 +- tests_old/EventListener/ChainTestCase.php | 4 +- tests_old/EventListenerTestCase.php | 4 +- tests_old/Export/CheckConstraintTestCase.php | 4 +- tests_old/Export/FirebirdTestCase.php | 4 +- tests_old/Export/InformixTestCase.php | 4 +- tests_old/Export/MssqlTestCase.php | 4 +- tests_old/Export/MysqlTestCase.php | 4 +- tests_old/Export/OracleTestCase.php | 4 +- tests_old/Export/PgsqlTestCase.php | 4 +- tests_old/Export/RecordTestCase.php | 4 +- tests_old/Export/SchemaTestCase.php | 4 +- tests_old/Export/SqliteTestCase.php | 4 +- tests_old/ExportTestCase.php | 4 +- tests_old/Expression/DriverTestCase.php | 4 +- tests_old/Expression/FirebirdTestCase.php | 4 +- tests_old/Expression/InformixTestCase.php | 4 +- tests_old/Expression/MssqlTestCase.php | 4 +- tests_old/Expression/MysqlTestCase.php | 4 +- tests_old/Expression/OracleTestCase.php | 4 +- tests_old/Expression/PgsqlTestCase.php | 4 +- tests_old/Expression/SqliteTestCase.php | 4 +- tests_old/ExpressionTestCase.php | 4 +- tests_old/ForeignKeyTestCase.php | 4 +- tests_old/HookTestCase.php | 4 +- tests_old/Hydrate/FetchModeTestCase.php | 4 +- tests_old/HydrateTestCase.php | 4 +- tests_old/I18nTestCase.php | 4 +- tests_old/Import/BuilderTestCase.php | 4 +- tests_old/Import/FirebirdTestCase.php | 4 +- tests_old/Import/InformixTestCase.php | 4 +- tests_old/Import/MssqlTestCase.php | 4 +- tests_old/Import/MysqlTestCase.php | 4 +- tests_old/Import/OracleTestCase.php | 4 +- tests_old/Import/PgsqlTestCase.php | 4 +- tests_old/Import/SchemaTestCase.php | 4 +- tests_old/Import/SqliteTestCase.php | 4 +- tests_old/ImportTestCase.php | 4 +- tests_old/IntegrityActionTestCase.php | 4 +- tests_old/ManagerTestCase.php | 4 +- tests_old/Migration/MysqlTestCase.php | 4 +- tests_old/MigrationTestCase.php | 4 +- tests_old/NestedSet/LoadInSetUpTestCase.php | 4 +- tests_old/NestedSet/SingleRootTestCase.php | 4 +- tests_old/NewCoreTestCase.php | 4 +- .../OneTableOneClassInheritanceTestCase.php | 4 +- tests_old/ParserTestCase.php | 4 +- tests_old/PessimisticLockingTestCase.php | 4 +- tests_old/PluginTestCase.php | 4 +- tests_old/Query/AggregateValueTestCase.php | 4 +- tests_old/Query/ApplyInheritanceTestCase.php | 4 +- tests_old/Query/CacheTestCase.php | 4 +- tests_old/Query/CheckTestCase.php | 4 +- tests_old/Query/ComponentAliasTestCase.php | 4 +- tests_old/Query/ConditionTestCase.php | 4 +- tests_old/Query/DeleteTestCase.php | 4 +- tests_old/Query/DriverTestCase.php | 4 +- tests_old/Query/ExpressionTestCase.php | 4 +- tests_old/Query/FromTestCase.php | 4 +- tests_old/Query/GroupbyTestCase.php | 4 +- tests_old/Query/HavingTestCase.php | 4 +- tests_old/Query/IdentifierQuotingTestCase.php | 4 +- tests_old/Query/JoinCondition2TestCase.php | 4 +- tests_old/Query/JoinConditionTestCase.php | 4 +- tests_old/Query/JoinTestCase.php | 4 +- tests_old/Query/LimitTestCase.php | 4 +- tests_old/Query/MultiJoin2TestCase.php | 4 +- tests_old/Query/MultiJoinTestCase.php | 4 +- .../Query/MultipleAggregateValueTestCase.php | 4 +- .../Query/MysqlSubqueryHavingTestCase.php | 4 +- tests_old/Query/MysqlSubqueryTestCase.php | 4 +- tests_old/Query/OneToOneFetchingTestCase.php | 4 +- tests_old/Query/OrderbyTestCase.php | 4 +- tests_old/Query/PgsqlSubqueryTestCase.php | 4 +- tests_old/Query/ReferenceModelTestCase.php | 4 +- tests_old/Query/RegistryTestCase.php | 4 +- tests_old/Query/SelectExpressionTestCase.php | 4 +- tests_old/Query/SelectTestCase.php | 4 +- tests_old/Query/SubqueryTestCase.php | 4 +- tests_old/Query/UpdateTestCase.php | 4 +- tests_old/Query/WhereTestCase.php | 4 +- tests_old/QueryTestCase.php | 4 +- tests_old/RawSqlTestCase.php | 4 +- tests_old/Record/FilterTestCase.php | 4 +- tests_old/Record/HookTestCase.php | 4 +- tests_old/Record/InheritanceTestCase.php | 2 +- tests_old/Record/SaveBlankRecordTestCase.php | 4 +- .../Record/SerializeUnserializeTestCase.php | 4 +- tests_old/Record/StateTestCase.php | 4 +- tests_old/Record/SynchronizeTestCase.php | 4 +- tests_old/Record/ZeroValuesTestCase.php | 4 +- tests_old/RecordTestCase.php | 4 +- tests_old/Relation/CircularSavingTestCase.php | 4 +- tests_old/Relation/ManyToMany2TestCase.php | 4 +- tests_old/Relation/NestTestCase.php | 4 +- tests_old/Relation/OneToManyTestCase.php | 4 +- tests_old/Relation/OneToOneTestCase.php | 4 +- tests_old/Relation/ParserTestCase.php | 4 +- tests_old/RelationTestCase.php | 4 +- tests_old/Search/FileTestCase.php | 4 +- tests_old/Search/IndexerTestCase.php | 4 +- tests_old/Search/QueryTestCase.php | 6 +- tests_old/Search/QueryWeightTestCase.php | 4 +- tests_old/SearchTestCase.php | 4 +- tests_old/Sequence/FirebirdTestCase.php | 4 +- tests_old/Sequence/InformixTestCase.php | 4 +- tests_old/Sequence/MssqlTestCase.php | 4 +- tests_old/Sequence/MysqlTestCase.php | 4 +- tests_old/Sequence/OracleTestCase.php | 4 +- tests_old/Sequence/PgsqlTestCase.php | 4 +- tests_old/Sequence/SqliteTestCase.php | 4 +- tests_old/SequenceTestCase.php | 4 +- tests_old/TableTestCase.php | 4 +- tests_old/TemplateTestCase.php | 4 +- tests_old/Ticket/381TestCase.php | 4 +- tests_old/Ticket/424BTestCase.php | 4 +- tests_old/Ticket/424CTestCase.php | 4 +- tests_old/Ticket/428TestCase.php | 2 +- tests_old/Ticket/438TestCase.php | 4 +- tests_old/Ticket/480TestCase.php | 4 +- tests_old/Ticket/576TestCase.php | 2 +- tests_old/Ticket/583TestCase.php | 2 +- tests_old/Ticket/587TestCase.php | 2 +- tests_old/Ticket/626BTestCase.php | 2 +- tests_old/Ticket/626CTestCase.php | 2 +- tests_old/Ticket/626DTestCase.php | 2 +- tests_old/Ticket/638TestCase.php | 2 +- tests_old/Ticket/642TestCase.php | 4 +- tests_old/Ticket/673TestCase.php | 2 +- tests_old/Ticket/697TestCase.php | 2 +- tests_old/Ticket/749TestCase.php | 2 +- tests_old/Ticket/NjeroTestCase.php | 2 +- tests_old/TokenizerTestCase.php | 4 +- tests_old/Transaction/FirebirdTestCase.php | 4 +- tests_old/Transaction/InformixTestCase.php | 4 +- tests_old/Transaction/MssqlTestCase.php | 4 +- tests_old/Transaction/MysqlTestCase.php | 4 +- tests_old/Transaction/OracleTestCase.php | 4 +- tests_old/Transaction/PgsqlTestCase.php | 4 +- tests_old/Transaction/SqliteTestCase.php | 4 +- tests_old/TransactionTestCase.php | 4 +- tests_old/TreeStructureTestCase.php | 4 +- tests_old/UnitOfWorkTestCase.php | 4 +- tests_old/Validator/FutureTestCase.php | 4 +- tests_old/Validator/PastTestCase.php | 4 +- tests_old/ValidatorTestCase.php | 4 +- tests_old/ViewTestCase.php | 4 +- tests_old/coverage/Doctrine.html | 4 +- tests_old/coverage/Doctrine_Access.html | 306 ++-- tests_old/coverage/Doctrine_Adapter_Mock.html | 324 ++-- .../Doctrine_Adapter_Statement_Mock.html | 698 ++++---- tests_old/coverage/Doctrine_AuditLog.html | 242 +-- .../coverage/Doctrine_AuditLog_Listener.html | 174 +- tests_old/coverage/Doctrine_Cache_Array.html | 226 +-- tests_old/coverage/Doctrine_Collection.html | 4 +- tests_old/coverage/Doctrine_Configurable.html | 4 +- tests_old/coverage/Doctrine_Connection.html | 4 +- .../coverage/Doctrine_Connection_Common.html | 112 +- .../Doctrine_Connection_Exception.html | 232 +-- .../Doctrine_Connection_Firebird.html | 220 +-- ...octrine_Connection_Firebird_Exception.html | 270 +-- .../coverage/Doctrine_Connection_Module.html | 164 +- .../coverage/Doctrine_Connection_Mssql.html | 386 ++--- .../Doctrine_Connection_Mssql_Exception.html | 148 +- .../coverage/Doctrine_Connection_Mysql.html | 418 ++--- .../Doctrine_Connection_Mysql_Exception.html | 168 +- .../coverage/Doctrine_Connection_Oracle.html | 234 +-- .../Doctrine_Connection_Oracle_Exception.html | 158 +- .../coverage/Doctrine_Connection_Pgsql.html | 388 ++--- .../Doctrine_Connection_Pgsql_Exception.html | 214 +-- .../Doctrine_Connection_Profiler.html | 364 ++--- .../coverage/Doctrine_Connection_Sqlite.html | 220 +-- .../Doctrine_Connection_Sqlite_Exception.html | 154 +- .../Doctrine_Connection_Statement.html | 918 +++++------ .../Doctrine_Connection_UnitOfWork.html | 4 +- tests_old/coverage/Doctrine_DataDict.html | 4 +- .../coverage/Doctrine_DataDict_Exception.html | 66 +- .../coverage/Doctrine_DataDict_Firebird.html | 434 ++--- .../coverage/Doctrine_DataDict_Mssql.html | 378 ++--- .../coverage/Doctrine_DataDict_Mysql.html | 14 +- .../coverage/Doctrine_DataDict_Oracle.html | 398 ++--- .../coverage/Doctrine_DataDict_Pgsql.html | 4 +- .../coverage/Doctrine_DataDict_Sqlite.html | 598 +++---- tests_old/coverage/Doctrine_Event.html | 658 ++++---- .../coverage/Doctrine_EventListener.html | 240 +-- .../Doctrine_EventListener_Chain.html | 812 ++++----- tests_old/coverage/Doctrine_Exception.html | 184 +-- tests_old/coverage/Doctrine_Export.html | 4 +- .../coverage/Doctrine_Export_Exception.html | 66 +- .../coverage/Doctrine_Export_Firebird.html | 4 +- tests_old/coverage/Doctrine_Export_Mysql.html | 4 +- .../coverage/Doctrine_Export_Oracle.html | 4 +- tests_old/coverage/Doctrine_Export_Pgsql.html | 4 +- .../coverage/Doctrine_Export_Schema.html | 4 +- .../coverage/Doctrine_Export_Sqlite.html | 4 +- tests_old/coverage/Doctrine_Expression.html | 288 ++-- .../coverage/Doctrine_Expression_Driver.html | 1456 ++++++++--------- .../Doctrine_Expression_Exception.html | 66 +- .../coverage/Doctrine_Expression_Mock.html | 68 +- .../coverage/Doctrine_Expression_Mysql.html | 4 +- .../coverage/Doctrine_Expression_Pgsql.html | 4 +- .../coverage/Doctrine_Expression_Sqlite.html | 342 ++-- tests_old/coverage/Doctrine_Formatter.html | 484 +++--- tests_old/coverage/Doctrine_Hook.html | 460 +++--- tests_old/coverage/Doctrine_Hook_Equal.html | 102 +- tests_old/coverage/Doctrine_Hook_Integer.html | 148 +- tests_old/coverage/Doctrine_Hook_Parser.html | 132 +- .../Doctrine_Hook_Parser_Complex.html | 212 +-- .../coverage/Doctrine_Hook_WordLike.html | 132 +- tests_old/coverage/Doctrine_Hydrate.html | 4 +- .../coverage/Doctrine_Hydrate_Array.html | 146 +- .../coverage/Doctrine_Hydrate_Record.html | 252 +-- tests_old/coverage/Doctrine_Hydrator.html | 4 +- .../coverage/Doctrine_Hydrator_Abstract.html | 4 +- .../Doctrine_Hydrator_ArrayDriver.html | 4 +- .../Doctrine_Hydrator_RecordDriver.html | 4 +- tests_old/coverage/Doctrine_I18n.html | 224 +-- tests_old/coverage/Doctrine_Import.html | 452 ++--- .../coverage/Doctrine_Import_Builder.html | 4 +- .../coverage/Doctrine_Import_Firebird.html | 254 +-- tests_old/coverage/Doctrine_Import_Mssql.html | 4 +- .../coverage/Doctrine_Import_Oracle.html | 478 +++--- tests_old/coverage/Doctrine_Import_Pgsql.html | 480 +++--- .../coverage/Doctrine_Import_Schema.html | 4 +- .../coverage/Doctrine_Import_Sqlite.html | 4 +- tests_old/coverage/Doctrine_Lib.html | 534 +++--- tests_old/coverage/Doctrine_Manager.html | 1380 ++++++++-------- .../coverage/Doctrine_Manager_Exception.html | 66 +- tests_old/coverage/Doctrine_Migration.html | 4 +- .../coverage/Doctrine_Migration_Process.html | 18 +- tests_old/coverage/Doctrine_Node.html | 4 +- .../coverage/Doctrine_Node_NestedSet.html | 4 +- tests_old/coverage/Doctrine_Null.html | 90 +- tests_old/coverage/Doctrine_Parser.html | 4 +- tests_old/coverage/Doctrine_Parser_Yml.html | 4 +- tests_old/coverage/Doctrine_Plugin.html | 478 +++--- tests_old/coverage/Doctrine_Query.html | 4 +- .../coverage/Doctrine_Query_Abstract.html | 4 +- tests_old/coverage/Doctrine_Query_Check.html | 336 ++-- .../coverage/Doctrine_Query_Condition.html | 224 +-- .../coverage/Doctrine_Query_Exception.html | 66 +- tests_old/coverage/Doctrine_Query_From.html | 176 +- .../coverage/Doctrine_Query_Groupby.html | 130 +- tests_old/coverage/Doctrine_Query_Having.html | 196 +-- .../Doctrine_Query_JoinCondition.html | 206 +-- tests_old/coverage/Doctrine_Query_Limit.html | 76 +- tests_old/coverage/Doctrine_Query_Offset.html | 76 +- .../coverage/Doctrine_Query_Orderby.html | 106 +- tests_old/coverage/Doctrine_Query_Part.html | 122 +- .../coverage/Doctrine_Query_Registry.html | 138 +- tests_old/coverage/Doctrine_Query_Select.html | 76 +- tests_old/coverage/Doctrine_Query_Set.html | 118 +- .../coverage/Doctrine_Query_Tokenizer.html | 4 +- tests_old/coverage/Doctrine_Query_Where.html | 340 ++-- tests_old/coverage/Doctrine_RawSql.html | 660 ++++---- .../coverage/Doctrine_RawSql_Exception.html | 66 +- tests_old/coverage/Doctrine_Record.html | 4 +- .../coverage/Doctrine_Record_Abstract.html | 668 ++++---- .../coverage/Doctrine_Record_Exception.html | 66 +- .../coverage/Doctrine_Record_Filter.html | 122 +- .../Doctrine_Record_Filter_Compound.html | 198 +-- .../Doctrine_Record_Filter_Standard.html | 112 +- .../coverage/Doctrine_Record_Iterator.html | 160 +- .../coverage/Doctrine_Record_Listener.html | 152 +- .../Doctrine_Record_Listener_Chain.html | 378 ++--- tests_old/coverage/Doctrine_Relation.html | 658 ++++---- .../Doctrine_Relation_Association.html | 194 +-- .../coverage/Doctrine_Relation_Exception.html | 66 +- .../Doctrine_Relation_ForeignKey.html | 196 +-- .../coverage/Doctrine_Relation_LocalKey.html | 160 +- .../coverage/Doctrine_Relation_Nest.html | 284 ++-- .../coverage/Doctrine_Relation_Parser.html | 978 +++++------ .../Doctrine_Relation_Parser_Exception.html | 66 +- tests_old/coverage/Doctrine_Search.html | 586 +++---- .../Doctrine_Search_Analyzer_Standard.html | 596 +++---- .../coverage/Doctrine_Search_Exception.html | 66 +- tests_old/coverage/Doctrine_Search_File.html | 136 +- .../coverage/Doctrine_Search_Listener.html | 112 +- tests_old/coverage/Doctrine_Search_Query.html | 470 +++--- tests_old/coverage/Doctrine_Sequence.html | 146 +- .../coverage/Doctrine_Sequence_Firebird.html | 212 +-- .../coverage/Doctrine_Sequence_Mssql.html | 312 ++-- .../coverage/Doctrine_Sequence_Mysql.html | 222 +-- .../coverage/Doctrine_Sequence_Oracle.html | 190 +-- .../coverage/Doctrine_Sequence_Pgsql.html | 186 +-- .../coverage/Doctrine_Sequence_Sqlite.html | 226 +-- tests_old/coverage/Doctrine_Table.html | 4 +- .../coverage/Doctrine_Table_Exception.html | 80 +- .../coverage/Doctrine_Table_Repository.html | 324 ++-- tests_old/coverage/Doctrine_Template.html | 310 ++-- .../coverage/Doctrine_Template_I18n.html | 144 +- ...trine_Template_Listener_Timestampable.html | 4 +- .../coverage/Doctrine_Template_NestedSet.html | 4 +- .../Doctrine_Template_Searchable.html | 134 +- .../coverage/Doctrine_Template_Sluggable.html | 4 +- .../Doctrine_Template_Timestampable.html | 4 +- .../Doctrine_Template_Versionable.html | 104 +- tests_old/coverage/Doctrine_Tokenizer.html | 626 +++---- tests_old/coverage/Doctrine_Transaction.html | 906 +++++----- .../Doctrine_Transaction_Exception.html | 66 +- .../Doctrine_Transaction_Firebird.html | 278 ++-- .../coverage/Doctrine_Transaction_Mock.html | 70 +- .../coverage/Doctrine_Transaction_Mssql.html | 134 +- .../coverage/Doctrine_Transaction_Mysql.html | 230 +-- .../coverage/Doctrine_Transaction_Oracle.html | 210 +-- .../coverage/Doctrine_Transaction_Pgsql.html | 208 +-- .../coverage/Doctrine_Transaction_Sqlite.html | 130 +- tests_old/coverage/Doctrine_Tree.html | 4 +- .../coverage/Doctrine_Tree_NestedSet.html | 4 +- tests_old/coverage/Doctrine_Validator.html | 4 +- .../coverage/Doctrine_Validator_Date.html | 4 +- .../coverage/Doctrine_Validator_Driver.html | 230 +-- .../coverage/Doctrine_Validator_Email.html | 4 +- .../Doctrine_Validator_ErrorStack.html | 298 ++-- .../Doctrine_Validator_Exception.html | 198 +-- .../coverage/Doctrine_Validator_Future.html | 4 +- .../coverage/Doctrine_Validator_Notblank.html | 90 +- .../coverage/Doctrine_Validator_Notnull.html | 88 +- .../coverage/Doctrine_Validator_Past.html | 4 +- .../coverage/Doctrine_Validator_Range.html | 100 +- .../coverage/Doctrine_Validator_Regexp.html | 122 +- .../coverage/Doctrine_Validator_Unique.html | 4 +- .../coverage/Doctrine_Validator_Unsigned.html | 98 +- .../coverage/Doctrine_Validator_Usstate.html | 208 +-- tests_old/coverage/Doctrine_View.html | 334 ++-- tests_old/coverage/index.php | 2 +- tests_old/template.tpl | 4 +- tools/sandbox/config.php | 4 +- vendor/Sensei/Sensei.php | 2 +- 706 files changed, 18840 insertions(+), 18840 deletions(-) diff --git a/lib/Doctrine.php b/lib/Doctrine.php index a96e973dd..055c7c4fc 100644 --- a/lib/Doctrine.php +++ b/lib/Doctrine.php @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @author Lukas Smith (PEAR MDB2 library) * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Access.php b/lib/Doctrine/Access.php index 7dd845399..601826188 100644 --- a/lib/Doctrine/Access.php +++ b/lib/Doctrine/Access.php @@ -28,7 +28,7 @@ * @package Doctrine * @subpackage Access * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Adapter.php b/lib/Doctrine/Adapter.php index ad0b7382c..1ca9c01df 100644 --- a/lib/Doctrine/Adapter.php +++ b/lib/Doctrine/Adapter.php @@ -26,7 +26,7 @@ * @package Doctrine * @subpackage Adapter * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Adapter/Db2.php b/lib/Doctrine/Adapter/Db2.php index eadd30f5c..3483d8276 100644 --- a/lib/Doctrine/Adapter/Db2.php +++ b/lib/Doctrine/Adapter/Db2.php @@ -27,7 +27,7 @@ Doctrine::autoload('Doctrine_Adapter'); * @subpackage Adapter * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1080 $ */ diff --git a/lib/Doctrine/Adapter/Db2/Exception.php b/lib/Doctrine/Adapter/Db2/Exception.php index 7bf6122e6..589d2468d 100644 --- a/lib/Doctrine/Adapter/Db2/Exception.php +++ b/lib/Doctrine/Adapter/Db2/Exception.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Adapter_Exception'); * @package Doctrine * @subpackage Adapter * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Adapter/Exception.php b/lib/Doctrine/Adapter/Exception.php index d561115fd..9dbacf002 100644 --- a/lib/Doctrine/Adapter/Exception.php +++ b/lib/Doctrine/Adapter/Exception.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Exception'); * @package Doctrine * @subpackage Adapter * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Adapter/Interface.php b/lib/Doctrine/Adapter/Interface.php index 8d04fdf48..ea91e3e77 100644 --- a/lib/Doctrine/Adapter/Interface.php +++ b/lib/Doctrine/Adapter/Interface.php @@ -27,7 +27,7 @@ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @package Doctrine * @subpackage Adapter - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Adapter/Mock.php b/lib/Doctrine/Adapter/Mock.php index 087063a83..0c097cf56 100644 --- a/lib/Doctrine/Adapter/Mock.php +++ b/lib/Doctrine/Adapter/Mock.php @@ -27,7 +27,7 @@ * @subpackage Adapter * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Adapter/Mysqli.php b/lib/Doctrine/Adapter/Mysqli.php index b69757eb1..ccffbfead 100644 --- a/lib/Doctrine/Adapter/Mysqli.php +++ b/lib/Doctrine/Adapter/Mysqli.php @@ -27,7 +27,7 @@ * @subpackage Adapter * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1080 $ */ diff --git a/lib/Doctrine/Adapter/Oracle.php b/lib/Doctrine/Adapter/Oracle.php index 7f27e027d..25fe348a1 100644 --- a/lib/Doctrine/Adapter/Oracle.php +++ b/lib/Doctrine/Adapter/Oracle.php @@ -27,7 +27,7 @@ Doctrine::autoload('Doctrine_Adapter'); * @subpackage Adapter * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1080 $ */ diff --git a/lib/Doctrine/Adapter/Resource.php b/lib/Doctrine/Adapter/Resource.php index 3342f3a82..15d89c483 100644 --- a/lib/Doctrine/Adapter/Resource.php +++ b/lib/Doctrine/Adapter/Resource.php @@ -26,7 +26,7 @@ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @package Doctrine * @subpackage Adapter - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2702 $ */ diff --git a/lib/Doctrine/Adapter/Statement.php b/lib/Doctrine/Adapter/Statement.php index 5a30d3cbc..682d04331 100644 --- a/lib/Doctrine/Adapter/Statement.php +++ b/lib/Doctrine/Adapter/Statement.php @@ -26,7 +26,7 @@ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @package Doctrine * @subpackage Adapter - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Adapter/Statement/Interface.php b/lib/Doctrine/Adapter/Statement/Interface.php index b32f52946..3f8f897e1 100644 --- a/lib/Doctrine/Adapter/Statement/Interface.php +++ b/lib/Doctrine/Adapter/Statement/Interface.php @@ -26,7 +26,7 @@ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @package Doctrine * @subpackage Adapter - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Adapter/Statement/Mock.php b/lib/Doctrine/Adapter/Statement/Mock.php index 853729636..6ba46b249 100644 --- a/lib/Doctrine/Adapter/Statement/Mock.php +++ b/lib/Doctrine/Adapter/Statement/Mock.php @@ -27,7 +27,7 @@ * @subpackage Adapter * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/AuditLog.php b/lib/Doctrine/AuditLog.php index 5e7634749..23fc598eb 100644 --- a/lib/Doctrine/AuditLog.php +++ b/lib/Doctrine/AuditLog.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage AuditLog * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/AuditLog/Listener.php b/lib/Doctrine/AuditLog/Listener.php index 0b4c5b2b6..dcea2a9d6 100644 --- a/lib/Doctrine/AuditLog/Listener.php +++ b/lib/Doctrine/AuditLog/Listener.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Record_Listener'); * @package Doctrine * @subpackage AuditLog * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Builder.php b/lib/Doctrine/Builder.php index 881dfaffe..708825fdf 100644 --- a/lib/Doctrine/Builder.php +++ b/lib/Doctrine/Builder.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Builder * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 3570 $ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Builder/Exception.php b/lib/Doctrine/Builder/Exception.php index 8c524ce06..c8728ce7e 100644 --- a/lib/Doctrine/Builder/Exception.php +++ b/lib/Doctrine/Builder/Exception.php @@ -33,7 +33,7 @@ Doctrine::autoload('Doctrine_Exception'); * * @package Doctrine * @subpackage Builder - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @since 1.0 * @version $Revision: 3570 $ diff --git a/lib/Doctrine/Builder/Migration.php b/lib/Doctrine/Builder/Migration.php index 957d73ce2..c5dff41bd 100644 --- a/lib/Doctrine/Builder/Migration.php +++ b/lib/Doctrine/Builder/Migration.php @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @author Jonathan H. Wage * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2939 $ */ diff --git a/lib/Doctrine/Builder/Record.php b/lib/Doctrine/Builder/Record.php index f2b370467..196651541 100644 --- a/lib/Doctrine/Builder/Record.php +++ b/lib/Doctrine/Builder/Record.php @@ -27,7 +27,7 @@ * * @package Doctrine * @subpackage Builder - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @since 1.0 * @version $Revision$ diff --git a/lib/Doctrine/Cache.php b/lib/Doctrine/Cache.php index 24de40c47..83f9a1c1c 100644 --- a/lib/Doctrine/Cache.php +++ b/lib/Doctrine/Cache.php @@ -26,7 +26,7 @@ Doctrine::autoload('Doctrine_EventListener'); * @subpackage Cache * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Cache/Apc.php b/lib/Doctrine/Cache/Apc.php index aea3168e4..9246d6c59 100644 --- a/lib/Doctrine/Cache/Apc.php +++ b/lib/Doctrine/Cache/Apc.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Cache * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Cache/Array.php b/lib/Doctrine/Cache/Array.php index 9d7607c28..0f4977aa1 100644 --- a/lib/Doctrine/Cache/Array.php +++ b/lib/Doctrine/Cache/Array.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Cache * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Cache/Db.php b/lib/Doctrine/Cache/Db.php index 6a3cd741c..ac07207a2 100644 --- a/lib/Doctrine/Cache/Db.php +++ b/lib/Doctrine/Cache/Db.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Cache * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Cache/Driver.php b/lib/Doctrine/Cache/Driver.php index 8afbc6f23..60f636eb7 100644 --- a/lib/Doctrine/Cache/Driver.php +++ b/lib/Doctrine/Cache/Driver.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Cache * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Cache/Exception.php b/lib/Doctrine/Cache/Exception.php index f06aad276..71c4ec1bf 100644 --- a/lib/Doctrine/Cache/Exception.php +++ b/lib/Doctrine/Cache/Exception.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Exception'); * @package Doctrine * @subpackage Cache * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Cache/Interface.php b/lib/Doctrine/Cache/Interface.php index 0615ee4f0..adf56035f 100644 --- a/lib/Doctrine/Cache/Interface.php +++ b/lib/Doctrine/Cache/Interface.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Cache * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Cache/Memcache.php b/lib/Doctrine/Cache/Memcache.php index 0cf8ce072..cb21ccf21 100644 --- a/lib/Doctrine/Cache/Memcache.php +++ b/lib/Doctrine/Cache/Memcache.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Cache_Driver'); * @package Doctrine * @subpackage Cache * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Cache/Xcache.php b/lib/Doctrine/Cache/Xcache.php index b9659ac72..74b173a29 100644 --- a/lib/Doctrine/Cache/Xcache.php +++ b/lib/Doctrine/Cache/Xcache.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Cache_Driver'); * @package Doctrine * @subpackage Cache * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: $ * @author Dmitry Bakaleinik (dima@snaiper.net) diff --git a/lib/Doctrine/Cli.php b/lib/Doctrine/Cli.php index 0e8f287e3..3430e19d8 100644 --- a/lib/Doctrine/Cli.php +++ b/lib/Doctrine/Cli.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Cli * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2761 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Cli/Exception.php b/lib/Doctrine/Cli/Exception.php index bbc695b8e..108275abb 100644 --- a/lib/Doctrine/Cli/Exception.php +++ b/lib/Doctrine/Cli/Exception.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Cli * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2761 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Collection.php b/lib/Doctrine/Collection.php index baa7a901c..99236e642 100644 --- a/lib/Doctrine/Collection.php +++ b/lib/Doctrine/Collection.php @@ -27,7 +27,7 @@ Doctrine::autoload('Doctrine_Access'); * @package Doctrine * @subpackage Collection * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Collection/Exception.php b/lib/Doctrine/Collection/Exception.php index 5b23c9bb3..afa0ea373 100644 --- a/lib/Doctrine/Collection/Exception.php +++ b/lib/Doctrine/Collection/Exception.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Collection * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Collection/Iterator.php b/lib/Doctrine/Collection/Iterator.php index 2683a2fb0..1afccee97 100644 --- a/lib/Doctrine/Collection/Iterator.php +++ b/lib/Doctrine/Collection/Iterator.php @@ -26,7 +26,7 @@ * @package Doctrine * @subpackage Collection * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Collection/Iterator/Expandable.php b/lib/Doctrine/Collection/Iterator/Expandable.php index f56b6980d..70562e5a0 100644 --- a/lib/Doctrine/Collection/Iterator/Expandable.php +++ b/lib/Doctrine/Collection/Iterator/Expandable.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Collection_Iterator'); * @package Doctrine * @subpackage Collection * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Collection/Iterator/Normal.php b/lib/Doctrine/Collection/Iterator/Normal.php index 7cfb0e9d1..3306c784f 100644 --- a/lib/Doctrine/Collection/Iterator/Normal.php +++ b/lib/Doctrine/Collection/Iterator/Normal.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Collection_Iterator'); * @package Doctrine * @subpackage Collection * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Collection/Iterator/Offset.php b/lib/Doctrine/Collection/Iterator/Offset.php index b7986fd58..28dd40499 100644 --- a/lib/Doctrine/Collection/Iterator/Offset.php +++ b/lib/Doctrine/Collection/Iterator/Offset.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Collection_Iterator'); * @package Doctrine * @subpackage Collection * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Collection/Offset.php b/lib/Doctrine/Collection/Offset.php index e93a6f5a7..eed595fb8 100644 --- a/lib/Doctrine/Collection/Offset.php +++ b/lib/Doctrine/Collection/Offset.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Collection * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Compiler/Exception.php b/lib/Doctrine/Compiler/Exception.php index fab76caa3..c16b1b362 100644 --- a/lib/Doctrine/Compiler/Exception.php +++ b/lib/Doctrine/Compiler/Exception.php @@ -26,7 +26,7 @@ * @subpackage Compiler * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Configurable.php b/lib/Doctrine/Configurable.php index 1e5ec20b7..ddda0f36a 100644 --- a/lib/Doctrine/Configurable.php +++ b/lib/Doctrine/Configurable.php @@ -27,7 +27,7 @@ * @package Doctrine * @subpackage Configurable * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Connection.php b/lib/Doctrine/Connection.php index 7d604b038..e7379309c 100644 --- a/lib/Doctrine/Connection.php +++ b/lib/Doctrine/Connection.php @@ -47,7 +47,7 @@ Doctrine::autoload('Doctrine_Configurable'); * @package Doctrine * @subpackage Connection * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Connection/Common.php b/lib/Doctrine/Connection/Common.php index ae37599f1..9587a9332 100644 --- a/lib/Doctrine/Connection/Common.php +++ b/lib/Doctrine/Connection/Common.php @@ -24,7 +24,7 @@ Doctrine::autoload('Doctrine_Connection'); * * @package Doctrine * @subpackage Connection - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @since 1.0 * @version $Revision$ diff --git a/lib/Doctrine/Connection/Db2.php b/lib/Doctrine/Connection/Db2.php index 9a9213668..c7df64435 100644 --- a/lib/Doctrine/Connection/Db2.php +++ b/lib/Doctrine/Connection/Db2.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Connection'); * @package Doctrine * @subpackage Connection * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Connection/Exception.php b/lib/Doctrine/Connection/Exception.php index 1718addbc..0039a5d8a 100644 --- a/lib/Doctrine/Connection/Exception.php +++ b/lib/Doctrine/Connection/Exception.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Exception'); * @package Doctrine * @subpackage Connection * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Connection/Firebird.php b/lib/Doctrine/Connection/Firebird.php index 4c83b355d..5755712a7 100644 --- a/lib/Doctrine/Connection/Firebird.php +++ b/lib/Doctrine/Connection/Firebird.php @@ -29,7 +29,7 @@ Doctrine::autoload('Doctrine_Connection'); * @author Lukas Smith (PEAR MDB2 library) * @author Lorenzo Alberton (PEAR MDB2 Interbase driver) * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Connection_Firebird extends Doctrine_Connection diff --git a/lib/Doctrine/Connection/Firebird/Exception.php b/lib/Doctrine/Connection/Firebird/Exception.php index f35afce64..753775c48 100644 --- a/lib/Doctrine/Connection/Firebird/Exception.php +++ b/lib/Doctrine/Connection/Firebird/Exception.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Connection_Exception'); * @package Doctrine * @subpackage Connection * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Connection/Informix.php b/lib/Doctrine/Connection/Informix.php index bf34e9f4a..6de77865e 100644 --- a/lib/Doctrine/Connection/Informix.php +++ b/lib/Doctrine/Connection/Informix.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Connection'); * @package Doctrine * @subpackage Connection * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Connection/Informix/Exception.php b/lib/Doctrine/Connection/Informix/Exception.php index 700af5dfb..7b9797bff 100644 --- a/lib/Doctrine/Connection/Informix/Exception.php +++ b/lib/Doctrine/Connection/Informix/Exception.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Connection_Exception'); * @package Doctrine * @subpackage Connection * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Connection/Mock.php b/lib/Doctrine/Connection/Mock.php index 64e611077..1df240779 100644 --- a/lib/Doctrine/Connection/Mock.php +++ b/lib/Doctrine/Connection/Mock.php @@ -28,7 +28,7 @@ Doctrine::autoload('Doctrine_Connection_Common'); * @author Konsta Vesterinen * @author Lukas Smith (PEAR MDB2 library) * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Connection_Mock extends Doctrine_Connection_Common diff --git a/lib/Doctrine/Connection/Module.php b/lib/Doctrine/Connection/Module.php index c7a97464e..ae2faebb8 100644 --- a/lib/Doctrine/Connection/Module.php +++ b/lib/Doctrine/Connection/Module.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Connection * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Connection/Mssql.php b/lib/Doctrine/Connection/Mssql.php index 12c6427b3..ed4630f16 100644 --- a/lib/Doctrine/Connection/Mssql.php +++ b/lib/Doctrine/Connection/Mssql.php @@ -28,7 +28,7 @@ Doctrine::autoload('Doctrine_Connection'); * @author Konsta Vesterinen * @author Lukas Smith (PEAR MDB2 library) * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Connection_Mssql extends Doctrine_Connection diff --git a/lib/Doctrine/Connection/Mssql/Exception.php b/lib/Doctrine/Connection/Mssql/Exception.php index bbbdbf5c1..1f5e3520a 100644 --- a/lib/Doctrine/Connection/Mssql/Exception.php +++ b/lib/Doctrine/Connection/Mssql/Exception.php @@ -29,7 +29,7 @@ Doctrine::autoload('Doctrine_Connection_Exception'); * @author Lukas Smith (PEAR MDB2 library) * @since 1.0 * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org */ class Doctrine_Connection_Mssql_Exception extends Doctrine_Connection_Exception { diff --git a/lib/Doctrine/Connection/Mysql.php b/lib/Doctrine/Connection/Mysql.php index df78b967a..0eb72ebea 100644 --- a/lib/Doctrine/Connection/Mysql.php +++ b/lib/Doctrine/Connection/Mysql.php @@ -28,7 +28,7 @@ Doctrine::autoload('Doctrine_Connection_Common'); * @author Konsta Vesterinen * @author Lukas Smith (PEAR MDB2 library) * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Connection_Mysql extends Doctrine_Connection_Common diff --git a/lib/Doctrine/Connection/Mysql/Exception.php b/lib/Doctrine/Connection/Mysql/Exception.php index 6a779c698..13272e1c1 100644 --- a/lib/Doctrine/Connection/Mysql/Exception.php +++ b/lib/Doctrine/Connection/Mysql/Exception.php @@ -29,7 +29,7 @@ Doctrine::autoload('Doctrine_Connection_Exception'); * @author Lukas Smith (PEAR MDB2 library) * @since 1.0 * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org */ class Doctrine_Connection_Mysql_Exception extends Doctrine_Connection_Exception { diff --git a/lib/Doctrine/Connection/Oracle.php b/lib/Doctrine/Connection/Oracle.php index 5fbe25636..44d695dd9 100644 --- a/lib/Doctrine/Connection/Oracle.php +++ b/lib/Doctrine/Connection/Oracle.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Connection'); * @package Doctrine * @subpackage Connection * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Connection/Oracle/Exception.php b/lib/Doctrine/Connection/Oracle/Exception.php index b45446dcc..202ac6c0f 100644 --- a/lib/Doctrine/Connection/Oracle/Exception.php +++ b/lib/Doctrine/Connection/Oracle/Exception.php @@ -29,7 +29,7 @@ Doctrine::autoload('Doctrine_Connection_Exception'); * @author Lukas Smith (PEAR MDB2 library) * @since 1.0 * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org */ class Doctrine_Connection_Oracle_Exception extends Doctrine_Connection_Exception { diff --git a/lib/Doctrine/Connection/Pgsql.php b/lib/Doctrine/Connection/Pgsql.php index f93687908..a350409c5 100644 --- a/lib/Doctrine/Connection/Pgsql.php +++ b/lib/Doctrine/Connection/Pgsql.php @@ -28,7 +28,7 @@ Doctrine::autoload("Doctrine_Connection_Common"); * @author Konsta Vesterinen * @author Lukas Smith (PEAR MDB2 library) * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Connection_Pgsql extends Doctrine_Connection_Common diff --git a/lib/Doctrine/Connection/Pgsql/Exception.php b/lib/Doctrine/Connection/Pgsql/Exception.php index 412bc34cf..d137b4fa1 100644 --- a/lib/Doctrine/Connection/Pgsql/Exception.php +++ b/lib/Doctrine/Connection/Pgsql/Exception.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Connection_Exception'); * @package Doctrine * @subpackage Connection * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @author Konsta Vesterinen * @author Paul Cooper (PEAR MDB2 Pgsql driver) * @author Lukas Smith (PEAR MDB2 library) diff --git a/lib/Doctrine/Connection/Profiler.php b/lib/Doctrine/Connection/Profiler.php index c6a16f218..6a474445f 100644 --- a/lib/Doctrine/Connection/Profiler.php +++ b/lib/Doctrine/Connection/Profiler.php @@ -26,7 +26,7 @@ Doctrine::autoload('Doctrine_Overloadable'); * @subpackage Connection * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Connection/Profiler/Exception.php b/lib/Doctrine/Connection/Profiler/Exception.php index 44a57c122..d2945c158 100644 --- a/lib/Doctrine/Connection/Profiler/Exception.php +++ b/lib/Doctrine/Connection/Profiler/Exception.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Connection_Profiler_Exception'); * @package Doctrine * @subpackage Connection * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1345 $ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Connection/Sqlite.php b/lib/Doctrine/Connection/Sqlite.php index 9bcd14511..64d367ff9 100644 --- a/lib/Doctrine/Connection/Sqlite.php +++ b/lib/Doctrine/Connection/Sqlite.php @@ -30,7 +30,7 @@ Doctrine::autoload("Doctrine_Connection_Common"); * @author Konsta Vesterinen * @author Lukas Smith (PEAR MDB2 library) * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Connection_Sqlite extends Doctrine_Connection_Common diff --git a/lib/Doctrine/Connection/Sqlite/Exception.php b/lib/Doctrine/Connection/Sqlite/Exception.php index 1431be342..52c845709 100644 --- a/lib/Doctrine/Connection/Sqlite/Exception.php +++ b/lib/Doctrine/Connection/Sqlite/Exception.php @@ -29,7 +29,7 @@ Doctrine::autoload('Doctrine_Connection_Exception'); * @author Lukas Smith (PEAR MDB2 library) * @since 1.0 * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org */ class Doctrine_Connection_Sqlite_Exception extends Doctrine_Connection_Exception { diff --git a/lib/Doctrine/Connection/Statement.php b/lib/Doctrine/Connection/Statement.php index 04763f56c..029213bb2 100644 --- a/lib/Doctrine/Connection/Statement.php +++ b/lib/Doctrine/Connection/Statement.php @@ -26,7 +26,7 @@ Doctrine::autoload('Doctrine_Adapter_Statement_Interface'); * @subpackage Connection * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1532 $ */ diff --git a/lib/Doctrine/Connection/UnitOfWork.php b/lib/Doctrine/Connection/UnitOfWork.php index 6f67a2d8e..26e6775ad 100644 --- a/lib/Doctrine/Connection/UnitOfWork.php +++ b/lib/Doctrine/Connection/UnitOfWork.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Connection_Module'); * @package Doctrine * @subpackage Connection * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Data.php b/lib/Doctrine/Data.php index 35a18d0ad..6b850937e 100644 --- a/lib/Doctrine/Data.php +++ b/lib/Doctrine/Data.php @@ -29,7 +29,7 @@ * @subpackage Data * @author Jonathan H. Wage * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2552 $ */ diff --git a/lib/Doctrine/Data/Exception.php b/lib/Doctrine/Data/Exception.php index f9e6fb72a..05a4b8c1f 100644 --- a/lib/Doctrine/Data/Exception.php +++ b/lib/Doctrine/Data/Exception.php @@ -26,7 +26,7 @@ * @subpackage Data * @author Jonathan H. Wage * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2552 $ */ diff --git a/lib/Doctrine/Data/Export.php b/lib/Doctrine/Data/Export.php index e7630c090..9191d0f96 100644 --- a/lib/Doctrine/Data/Export.php +++ b/lib/Doctrine/Data/Export.php @@ -26,7 +26,7 @@ * @subpackage Data * @author Jonathan H. Wage * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2552 $ */ diff --git a/lib/Doctrine/Data/Import.php b/lib/Doctrine/Data/Import.php index 28f469328..219f5b2ca 100644 --- a/lib/Doctrine/Data/Import.php +++ b/lib/Doctrine/Data/Import.php @@ -26,7 +26,7 @@ * @package Data * @author Jonathan H. Wage * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2552 $ */ diff --git a/lib/Doctrine/DataDict.php b/lib/Doctrine/DataDict.php index 2c7eed7af..74844acbb 100644 --- a/lib/Doctrine/DataDict.php +++ b/lib/Doctrine/DataDict.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage DataDict * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/DataDict/Exception.php b/lib/Doctrine/DataDict/Exception.php index de712ae0c..dc6eab5aa 100644 --- a/lib/Doctrine/DataDict/Exception.php +++ b/lib/Doctrine/DataDict/Exception.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Exception'); * @package Doctrine * @subpackage DataDict * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/DataDict/Firebird.php b/lib/Doctrine/DataDict/Firebird.php index d160b7dba..f576f9bc7 100644 --- a/lib/Doctrine/DataDict/Firebird.php +++ b/lib/Doctrine/DataDict/Firebird.php @@ -27,7 +27,7 @@ Doctrine::autoload('Doctrine_DataDict'); * @author Lorenzo Alberton (PEAR MDB2 Interbase driver) * @author Lukas Smith (PEAR MDB2 library) * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_DataDict_Firebird extends Doctrine_DataDict diff --git a/lib/Doctrine/DataDict/Informix.php b/lib/Doctrine/DataDict/Informix.php index 8f83ab76d..7ef21e1ee 100644 --- a/lib/Doctrine/DataDict/Informix.php +++ b/lib/Doctrine/DataDict/Informix.php @@ -26,7 +26,7 @@ Doctrine::autoload('Doctrine_DataDict'); * @author Konsta Vesterinen * @author Lukas Smith (PEAR MDB2 library) * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_DataDict_Informix extends Doctrine_DataDict diff --git a/lib/Doctrine/DataDict/Mssql.php b/lib/Doctrine/DataDict/Mssql.php index 21afdcf2c..c911127fe 100644 --- a/lib/Doctrine/DataDict/Mssql.php +++ b/lib/Doctrine/DataDict/Mssql.php @@ -28,7 +28,7 @@ Doctrine::autoload('Doctrine_DataDict'); * @author Frank M. Kromann (PEAR MDB2 Mssql driver) * @author David Coallier (PEAR MDB2 Mssql driver) * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_DataDict_Mssql extends Doctrine_DataDict diff --git a/lib/Doctrine/DataDict/Mysql.php b/lib/Doctrine/DataDict/Mysql.php index 9567c8072..e2afd01d0 100644 --- a/lib/Doctrine/DataDict/Mysql.php +++ b/lib/Doctrine/DataDict/Mysql.php @@ -26,7 +26,7 @@ Doctrine::autoload('Doctrine_DataDict'); * @author Konsta Vesterinen * @author Lukas Smith (PEAR MDB2 library) * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_DataDict_Mysql extends Doctrine_DataDict diff --git a/lib/Doctrine/DataDict/Oracle.php b/lib/Doctrine/DataDict/Oracle.php index 798f211bd..2f179e0fe 100644 --- a/lib/Doctrine/DataDict/Oracle.php +++ b/lib/Doctrine/DataDict/Oracle.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_DataDict'); * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @author Konsta Vesterinen * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_DataDict_Oracle extends Doctrine_DataDict diff --git a/lib/Doctrine/DataDict/Pgsql.php b/lib/Doctrine/DataDict/Pgsql.php index da16d45ae..27d4928d5 100644 --- a/lib/Doctrine/DataDict/Pgsql.php +++ b/lib/Doctrine/DataDict/Pgsql.php @@ -27,7 +27,7 @@ Doctrine::autoload('Doctrine_DataDict'); * @author Paul Cooper * @author Lukas Smith (PEAR MDB2 library) * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_DataDict_Pgsql extends Doctrine_DataDict diff --git a/lib/Doctrine/DataDict/Sqlite.php b/lib/Doctrine/DataDict/Sqlite.php index bff264645..eb95d649c 100644 --- a/lib/Doctrine/DataDict/Sqlite.php +++ b/lib/Doctrine/DataDict/Sqlite.php @@ -26,7 +26,7 @@ Doctrine::autoload('Doctrine_DataDict'); * @author Konsta Vesterinen * @author Lukas Smith (PEAR MDB2 library) * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_DataDict_Sqlite extends Doctrine_DataDict diff --git a/lib/Doctrine/Event.php b/lib/Doctrine/Event.php index efa1f41ce..3151b68af 100644 --- a/lib/Doctrine/Event.php +++ b/lib/Doctrine/Event.php @@ -26,7 +26,7 @@ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @package Doctrine * @subpackage Event - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/EventListener.php b/lib/Doctrine/EventListener.php index 8e0f0c1c5..5aff65ee9 100644 --- a/lib/Doctrine/EventListener.php +++ b/lib/Doctrine/EventListener.php @@ -28,7 +28,7 @@ Doctrine::autoload('Doctrine_EventListener_Interface'); * @package Doctrine * @subpackage EventListener * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/EventListener/Chain.php b/lib/Doctrine/EventListener/Chain.php index 24991df1b..b52521794 100644 --- a/lib/Doctrine/EventListener/Chain.php +++ b/lib/Doctrine/EventListener/Chain.php @@ -29,7 +29,7 @@ Doctrine::autoload('Doctrine_Access'); * @package Doctrine * @subpackage EventListener * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/EventListener/Exception.php b/lib/Doctrine/EventListener/Exception.php index 56bf6e79b..2bb034538 100644 --- a/lib/Doctrine/EventListener/Exception.php +++ b/lib/Doctrine/EventListener/Exception.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage EventListener * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1344 $ * @author Konsta Vesterinen diff --git a/lib/Doctrine/EventListener/Interface.php b/lib/Doctrine/EventListener/Interface.php index 7ec76eb68..e79d5a5ff 100644 --- a/lib/Doctrine/EventListener/Interface.php +++ b/lib/Doctrine/EventListener/Interface.php @@ -28,7 +28,7 @@ Doctrine::autoload('Doctrine_EventListener_Interface'); * @package Doctrine * @subpackage EventListener * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Exception.php b/lib/Doctrine/Exception.php index 3600f8f9c..a2f91c608 100644 --- a/lib/Doctrine/Exception.php +++ b/lib/Doctrine/Exception.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Exception * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Export.php b/lib/Doctrine/Export.php index 109f575d9..9506606d4 100644 --- a/lib/Doctrine/Export.php +++ b/lib/Doctrine/Export.php @@ -27,7 +27,7 @@ Doctrine::autoload('Doctrine_Connection_Module'); * @author Konsta Vesterinen * @author Lukas Smith (PEAR MDB2 library) * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Export/Exception.php b/lib/Doctrine/Export/Exception.php index f5cc79c86..190bc2d6d 100644 --- a/lib/Doctrine/Export/Exception.php +++ b/lib/Doctrine/Export/Exception.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Exception'); * @package Doctrine * @subpackage Export * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Export/Firebird.php b/lib/Doctrine/Export/Firebird.php index b9d65a357..3c9015a59 100644 --- a/lib/Doctrine/Export/Firebird.php +++ b/lib/Doctrine/Export/Firebird.php @@ -28,7 +28,7 @@ Doctrine::autoload('Doctrine_Export'); * @author Lukas Smith (PEAR MDB2 library) * @author Lorenzo Alberton (PEAR MDB2 Interbase driver) * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Export/Frontbase.php b/lib/Doctrine/Export/Frontbase.php index cc8bf5e41..50b5abbd5 100644 --- a/lib/Doctrine/Export/Frontbase.php +++ b/lib/Doctrine/Export/Frontbase.php @@ -27,7 +27,7 @@ Doctrine::autoload('Doctrine_Export'); * @author Konsta Vesterinen * @author Lukas Smith (PEAR MDB2 library) * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Export/Mssql.php b/lib/Doctrine/Export/Mssql.php index eba5fd919..fe81403c3 100644 --- a/lib/Doctrine/Export/Mssql.php +++ b/lib/Doctrine/Export/Mssql.php @@ -28,7 +28,7 @@ Doctrine::autoload('Doctrine_Export'); * @author Lukas Smith (PEAR MDB2 library) * @author Frank M. Kromann (PEAR MDB2 Mssql driver) * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Export/Mysql.php b/lib/Doctrine/Export/Mysql.php index 6f460868c..e2bc50e13 100644 --- a/lib/Doctrine/Export/Mysql.php +++ b/lib/Doctrine/Export/Mysql.php @@ -27,7 +27,7 @@ Doctrine::autoload('Doctrine_Export'); * @author Konsta Vesterinen * @author Lukas Smith (PEAR MDB2 library) * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Export/Oracle.php b/lib/Doctrine/Export/Oracle.php index a9c819ae6..6fb97abd9 100644 --- a/lib/Doctrine/Export/Oracle.php +++ b/lib/Doctrine/Export/Oracle.php @@ -27,7 +27,7 @@ Doctrine::autoload('Doctrine_Export'); * @author Konsta Vesterinen * @author Lukas Smith (PEAR MDB2 library) * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Export/Pgsql.php b/lib/Doctrine/Export/Pgsql.php index 5baa5f21d..97929c1c4 100644 --- a/lib/Doctrine/Export/Pgsql.php +++ b/lib/Doctrine/Export/Pgsql.php @@ -27,7 +27,7 @@ Doctrine::autoload('Doctrine_Export'); * @author Konsta Vesterinen * @author Lukas Smith (PEAR MDB2 library) * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Export/Reporter.php b/lib/Doctrine/Export/Reporter.php index 66c1e7477..8bb3289aa 100644 --- a/lib/Doctrine/Export/Reporter.php +++ b/lib/Doctrine/Export/Reporter.php @@ -26,7 +26,7 @@ * @subpackage Export * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Export/Schema.php b/lib/Doctrine/Export/Schema.php index 91f8fdb17..3749ff775 100644 --- a/lib/Doctrine/Export/Schema.php +++ b/lib/Doctrine/Export/Schema.php @@ -26,7 +26,7 @@ * * @package Doctrine * @subpackage Export - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version $Revision: 1838 $ * @author Nicolas Bérard-Nault diff --git a/lib/Doctrine/Export/Sqlite.php b/lib/Doctrine/Export/Sqlite.php index fc52b2b4e..4a806e708 100644 --- a/lib/Doctrine/Export/Sqlite.php +++ b/lib/Doctrine/Export/Sqlite.php @@ -27,7 +27,7 @@ Doctrine::autoload('Doctrine_Export'); * @author Konsta Vesterinen * @author Lukas Smith (PEAR MDB2 library) * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Expression.php b/lib/Doctrine/Expression.php index 769eb1ffd..7970c6d9e 100644 --- a/lib/Doctrine/Expression.php +++ b/lib/Doctrine/Expression.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Connection_Module'); * @package Doctrine * @subpackage Expression * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Expression/Driver.php b/lib/Doctrine/Expression/Driver.php index 88b676e01..47a2fc4ec 100644 --- a/lib/Doctrine/Expression/Driver.php +++ b/lib/Doctrine/Expression/Driver.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Connection_Module'); * @package Doctrine * @subpackage Expression * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Expression/Exception.php b/lib/Doctrine/Expression/Exception.php index 4585a4be9..e26f81fb4 100644 --- a/lib/Doctrine/Expression/Exception.php +++ b/lib/Doctrine/Expression/Exception.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Exception'); * @package Doctrine * @subpackage Expression * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Expression/Firebird.php b/lib/Doctrine/Expression/Firebird.php index 41048edd1..07224ba2c 100644 --- a/lib/Doctrine/Expression/Firebird.php +++ b/lib/Doctrine/Expression/Firebird.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Expression_Driver'); * @package Doctrine * @subpackage Expression * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Expression/Informix.php b/lib/Doctrine/Expression/Informix.php index 95ab865ca..f946b90fb 100644 --- a/lib/Doctrine/Expression/Informix.php +++ b/lib/Doctrine/Expression/Informix.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Expression'); * @package Doctrine * @subpackage Expression * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Expression/Mock.php b/lib/Doctrine/Expression/Mock.php index b0da88f90..590010b45 100644 --- a/lib/Doctrine/Expression/Mock.php +++ b/lib/Doctrine/Expression/Mock.php @@ -26,7 +26,7 @@ Doctrine::autoload('Doctrine_Connection_Module'); * @package Doctrine * @subpackage Expression * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Expression/Mssql.php b/lib/Doctrine/Expression/Mssql.php index 6c721115d..b7abef542 100644 --- a/lib/Doctrine/Expression/Mssql.php +++ b/lib/Doctrine/Expression/Mssql.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Expression_Driver'); * @package Doctrine * @subpackage Expression * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Expression/Mysql.php b/lib/Doctrine/Expression/Mysql.php index 0c87f3d28..cc3879def 100644 --- a/lib/Doctrine/Expression/Mysql.php +++ b/lib/Doctrine/Expression/Mysql.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Expression_Driver'); * @package Doctrine * @subpackage Expression * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Expression/Oracle.php b/lib/Doctrine/Expression/Oracle.php index 5c9a2790f..91c12d732 100644 --- a/lib/Doctrine/Expression/Oracle.php +++ b/lib/Doctrine/Expression/Oracle.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Expression_Driver'); * @package Doctrine * @subpackage Expression * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Expression/Pgsql.php b/lib/Doctrine/Expression/Pgsql.php index 8ff0adbac..c5fb7cc35 100644 --- a/lib/Doctrine/Expression/Pgsql.php +++ b/lib/Doctrine/Expression/Pgsql.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Expression_Driver'); * @package Doctrine * @subpackage Expression * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Expression/Sqlite.php b/lib/Doctrine/Expression/Sqlite.php index f7860de17..ef2e41b6d 100644 --- a/lib/Doctrine/Expression/Sqlite.php +++ b/lib/Doctrine/Expression/Sqlite.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Expression_Driver'); * @package Doctrine * @subpackage Expression * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/File.php b/lib/Doctrine/File.php index 8e2198715..7021c95c7 100644 --- a/lib/Doctrine/File.php +++ b/lib/Doctrine/File.php @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_File extends Doctrine_Record diff --git a/lib/Doctrine/File/Index.php b/lib/Doctrine/File/Index.php index 853492e93..daeef0ffe 100644 --- a/lib/Doctrine/File/Index.php +++ b/lib/Doctrine/File/Index.php @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_File_Index extends Doctrine_Record diff --git a/lib/Doctrine/Formatter.php b/lib/Doctrine/Formatter.php index 542322400..8aa44d7b2 100644 --- a/lib/Doctrine/Formatter.php +++ b/lib/Doctrine/Formatter.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Connection_Module'); * @package Doctrine * @subpackage Formatter * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Hook.php b/lib/Doctrine/Hook.php index ebfa183f7..6a7c718cd 100644 --- a/lib/Doctrine/Hook.php +++ b/lib/Doctrine/Hook.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Hook * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Hook/Equal.php b/lib/Doctrine/Hook/Equal.php index 9214ee484..f6a100a72 100644 --- a/lib/Doctrine/Hook/Equal.php +++ b/lib/Doctrine/Hook/Equal.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Hook_Parser'); * @package Doctrine * @subpackage Hook * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Hook/Integer.php b/lib/Doctrine/Hook/Integer.php index ccef6d8e0..141641ec2 100644 --- a/lib/Doctrine/Hook/Integer.php +++ b/lib/Doctrine/Hook/Integer.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Hook_Parser_Complex'); * @package Doctrine * @subpackage Hook * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Hook/Parser.php b/lib/Doctrine/Hook/Parser.php index 0410e729d..b97bb246f 100644 --- a/lib/Doctrine/Hook/Parser.php +++ b/lib/Doctrine/Hook/Parser.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Hook * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Hook/Parser/Complex.php b/lib/Doctrine/Hook/Parser/Complex.php index 7dab35877..826a4cd8a 100644 --- a/lib/Doctrine/Hook/Parser/Complex.php +++ b/lib/Doctrine/Hook/Parser/Complex.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Hook_Parser'); * @package Doctrine * @subpackage Hook * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Hook/WordLike.php b/lib/Doctrine/Hook/WordLike.php index 6bdcbcd47..9d9d1dd00 100644 --- a/lib/Doctrine/Hook/WordLike.php +++ b/lib/Doctrine/Hook/WordLike.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Hook_Parser'); * @package Doctrine * @subpackage Hook * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Hydrator.php b/lib/Doctrine/Hydrator.php index 18227ec8d..1b363cba9 100644 --- a/lib/Doctrine/Hydrator.php +++ b/lib/Doctrine/Hydrator.php @@ -26,7 +26,7 @@ * @package Doctrine * @subpackage Hydrate * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 3192 $ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Hydrator/Abstract.php b/lib/Doctrine/Hydrator/Abstract.php index 841606eeb..287fd17aa 100644 --- a/lib/Doctrine/Hydrator/Abstract.php +++ b/lib/Doctrine/Hydrator/Abstract.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Hydrate * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 3192 $ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Hydrator/ArrayDriver.php b/lib/Doctrine/Hydrator/ArrayDriver.php index a05eea4f1..7aa592379 100644 --- a/lib/Doctrine/Hydrator/ArrayDriver.php +++ b/lib/Doctrine/Hydrator/ArrayDriver.php @@ -26,7 +26,7 @@ * @package Doctrine * @subpackage Hydrate * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Hydrator/Exception.php b/lib/Doctrine/Hydrator/Exception.php index 1786dcbcb..a69b1d021 100644 --- a/lib/Doctrine/Hydrator/Exception.php +++ b/lib/Doctrine/Hydrator/Exception.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Exception'); * @package Doctrine * @subpackage Hydrate * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1080 $ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Hydrator/RecordDriver.php b/lib/Doctrine/Hydrator/RecordDriver.php index 8e02a03a9..4a79b4b9f 100644 --- a/lib/Doctrine/Hydrator/RecordDriver.php +++ b/lib/Doctrine/Hydrator/RecordDriver.php @@ -26,7 +26,7 @@ * @package Doctrine * @subpackage Hydrate * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/I18n.php b/lib/Doctrine/I18n.php index bc4149dee..d4d7f2e1f 100644 --- a/lib/Doctrine/I18n.php +++ b/lib/Doctrine/I18n.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage I18n * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/I18n/Exception.php b/lib/Doctrine/I18n/Exception.php index 436adcfb2..cb5abd460 100644 --- a/lib/Doctrine/I18n/Exception.php +++ b/lib/Doctrine/I18n/Exception.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage I18n * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Import.php b/lib/Doctrine/Import.php index 339988ea3..11f3b0bed 100644 --- a/lib/Doctrine/Import.php +++ b/lib/Doctrine/Import.php @@ -27,7 +27,7 @@ Doctrine::autoload('Doctrine_Connection_Module'); * * @package Doctrine * @subpackage Import - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @since 1.0 * @version $Revision$ diff --git a/lib/Doctrine/Import/Exception.php b/lib/Doctrine/Import/Exception.php index 84f42b47e..ec4cf78f7 100644 --- a/lib/Doctrine/Import/Exception.php +++ b/lib/Doctrine/Import/Exception.php @@ -24,7 +24,7 @@ Doctrine::autoload('Doctrine_Exception'); * * @package Doctrine * @subpackage Import - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @since 1.0 * @version $Revision$ diff --git a/lib/Doctrine/Import/Firebird.php b/lib/Doctrine/Import/Firebird.php index 8c67c2b27..a4c48eeaf 100644 --- a/lib/Doctrine/Import/Firebird.php +++ b/lib/Doctrine/Import/Firebird.php @@ -27,7 +27,7 @@ Doctrine::autoload('Doctrine_Import'); * @author Lorenzo Alberton (PEAR MDB2 Interbase driver) * @author Lukas Smith (PEAR MDB2 library) * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Import_Firebird extends Doctrine_Import diff --git a/lib/Doctrine/Import/Informix.php b/lib/Doctrine/Import/Informix.php index 6c21a92fb..2e7f34ea3 100644 --- a/lib/Doctrine/Import/Informix.php +++ b/lib/Doctrine/Import/Informix.php @@ -26,7 +26,7 @@ Doctrine::autoload('Doctrine_Import'); * @author Konsta Vesterinen * @author Lukas Smith (PEAR MDB2 library) * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Import_Informix extends Doctrine_Import diff --git a/lib/Doctrine/Import/Mssql.php b/lib/Doctrine/Import/Mssql.php index a2535eae7..c30b96883 100644 --- a/lib/Doctrine/Import/Mssql.php +++ b/lib/Doctrine/Import/Mssql.php @@ -28,7 +28,7 @@ Doctrine::autoload('Doctrine_Import'); * @author Frank M. Kromann (PEAR MDB2 Mssql driver) * @author David Coallier (PEAR MDB2 Mssql driver) * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Import_Mssql extends Doctrine_Import diff --git a/lib/Doctrine/Import/Mysql.php b/lib/Doctrine/Import/Mysql.php index 69de7b8fc..0bb93b577 100644 --- a/lib/Doctrine/Import/Mysql.php +++ b/lib/Doctrine/Import/Mysql.php @@ -26,7 +26,7 @@ Doctrine::autoload('Doctrine_Import'); * @author Konsta Vesterinen * @author Lukas Smith (PEAR MDB2 library) * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Import_Mysql extends Doctrine_Import diff --git a/lib/Doctrine/Import/Oracle.php b/lib/Doctrine/Import/Oracle.php index 7b8589864..2b2c5d19a 100644 --- a/lib/Doctrine/Import/Oracle.php +++ b/lib/Doctrine/Import/Oracle.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Import'); * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @author Konsta Vesterinen * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Import_Oracle extends Doctrine_Import diff --git a/lib/Doctrine/Import/Pgsql.php b/lib/Doctrine/Import/Pgsql.php index 52a3739d6..06b84fcea 100644 --- a/lib/Doctrine/Import/Pgsql.php +++ b/lib/Doctrine/Import/Pgsql.php @@ -27,7 +27,7 @@ Doctrine::autoload('Doctrine_Import'); * @author Paul Cooper * @author Lukas Smith (PEAR MDB2 library) * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Import_Pgsql extends Doctrine_Import diff --git a/lib/Doctrine/Import/Reader.php b/lib/Doctrine/Import/Reader.php index fa525933b..1096a4fe1 100644 --- a/lib/Doctrine/Import/Reader.php +++ b/lib/Doctrine/Import/Reader.php @@ -26,7 +26,7 @@ * * @package Doctrine * @subpackage Import - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @since 1.0 * @version $Revision$ diff --git a/lib/Doctrine/Import/Reader/Db.php b/lib/Doctrine/Import/Reader/Db.php index 6ab88ec65..ace22f802 100644 --- a/lib/Doctrine/Import/Reader/Db.php +++ b/lib/Doctrine/Import/Reader/Db.php @@ -26,7 +26,7 @@ Doctrine::autoload('Doctrine_Import_Reader'); * * @package Doctrine * @subpackage Import - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @since 1.0 * @version $Revision$ diff --git a/lib/Doctrine/Import/Reader/Exception.php b/lib/Doctrine/Import/Reader/Exception.php index 9fdd2c734..9440c25a7 100644 --- a/lib/Doctrine/Import/Reader/Exception.php +++ b/lib/Doctrine/Import/Reader/Exception.php @@ -24,7 +24,7 @@ * * @package Doctrine * @subpackage Import - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @since 1.0 * @version $Revision$ diff --git a/lib/Doctrine/Import/Reader/Propel.php b/lib/Doctrine/Import/Reader/Propel.php index e39c737a3..1f411d12f 100644 --- a/lib/Doctrine/Import/Reader/Propel.php +++ b/lib/Doctrine/Import/Reader/Propel.php @@ -24,7 +24,7 @@ Doctrine::autoload('Doctrine_Import_Reader'); * * @package Doctrine * @subpackage Import - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @since 1.0 * @version $Revision$ diff --git a/lib/Doctrine/Import/Schema.php b/lib/Doctrine/Import/Schema.php index 036281439..28eea1e68 100644 --- a/lib/Doctrine/Import/Schema.php +++ b/lib/Doctrine/Import/Schema.php @@ -31,7 +31,7 @@ * * @package Doctrine * @subpackage Import - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version $Revision: 1838 $ * @author Nicolas Bérard-Nault diff --git a/lib/Doctrine/Import/Sqlite.php b/lib/Doctrine/Import/Sqlite.php index 3911eb9c1..760d5e33c 100644 --- a/lib/Doctrine/Import/Sqlite.php +++ b/lib/Doctrine/Import/Sqlite.php @@ -26,7 +26,7 @@ Doctrine::autoload('Doctrine_Import'); * @author Konsta Vesterinen * @author Lukas Smith (PEAR MDB2 library) * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Import_Sqlite extends Doctrine_Import diff --git a/lib/Doctrine/Inflector.php b/lib/Doctrine/Inflector.php index e523409f9..08fd352da 100644 --- a/lib/Doctrine/Inflector.php +++ b/lib/Doctrine/Inflector.php @@ -29,7 +29,7 @@ * @package Doctrine * @subpackage Inflector * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 3189 $ * @author Konsta Vesterinen diff --git a/lib/Doctrine/IntegrityMapper.php b/lib/Doctrine/IntegrityMapper.php index 791b8c6d8..92aa19fee 100644 --- a/lib/Doctrine/IntegrityMapper.php +++ b/lib/Doctrine/IntegrityMapper.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage IntegrityMapper * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Lib.php b/lib/Doctrine/Lib.php index 8243743b4..7f027d4fd 100644 --- a/lib/Doctrine/Lib.php +++ b/lib/Doctrine/Lib.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Lib * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Locking/Exception.php b/lib/Doctrine/Locking/Exception.php index d487abf75..eaf8c3c13 100644 --- a/lib/Doctrine/Locking/Exception.php +++ b/lib/Doctrine/Locking/Exception.php @@ -7,7 +7,7 @@ * * @package Doctrine * @subpackage Locking - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @since 1.0 * @version $Revision$ diff --git a/lib/Doctrine/Locking/Manager/Pessimistic.php b/lib/Doctrine/Locking/Manager/Pessimistic.php index dcefd484b..3b0b52ec4 100644 --- a/lib/Doctrine/Locking/Manager/Pessimistic.php +++ b/lib/Doctrine/Locking/Manager/Pessimistic.php @@ -26,7 +26,7 @@ * * @package Doctrine * @subpackage Locking - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @author Roman Borschel * @author Pierre Minnieur * @author Konsta Vesterinen diff --git a/lib/Doctrine/Log.php b/lib/Doctrine/Log.php index ce8363793..db3f57a94 100755 --- a/lib/Doctrine/Log.php +++ b/lib/Doctrine/Log.php @@ -24,7 +24,7 @@ * @subpackage Log * @author Jonathan H. Wage * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 3155 $ */ diff --git a/lib/Doctrine/Log/Exception.php b/lib/Doctrine/Log/Exception.php index 58e22ab5f..bb62d9099 100755 --- a/lib/Doctrine/Log/Exception.php +++ b/lib/Doctrine/Log/Exception.php @@ -24,7 +24,7 @@ * @package Log * @author Jonathan H. Wage * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 3155 $ */ diff --git a/lib/Doctrine/Log/Filter/Interface.php b/lib/Doctrine/Log/Filter/Interface.php index 95730edb6..43a1bd6d9 100644 --- a/lib/Doctrine/Log/Filter/Interface.php +++ b/lib/Doctrine/Log/Filter/Interface.php @@ -25,7 +25,7 @@ * @author Konsta Vesterinen * @author Jonathan H. Wage * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 3155 $ */ diff --git a/lib/Doctrine/Log/Filter/Message.php b/lib/Doctrine/Log/Filter/Message.php index 96a53acc6..4a9f97aac 100644 --- a/lib/Doctrine/Log/Filter/Message.php +++ b/lib/Doctrine/Log/Filter/Message.php @@ -25,7 +25,7 @@ * @author Konsta Vesterinen * @author Jonathan H. Wage * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 3155 $ */ diff --git a/lib/Doctrine/Log/Filter/Priority.php b/lib/Doctrine/Log/Filter/Priority.php index cac617073..e51d75a04 100644 --- a/lib/Doctrine/Log/Filter/Priority.php +++ b/lib/Doctrine/Log/Filter/Priority.php @@ -25,7 +25,7 @@ * @author Konsta Vesterinen * @author Jonathan H. Wage * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 3155 $ */ diff --git a/lib/Doctrine/Log/Filter/Suppress.php b/lib/Doctrine/Log/Filter/Suppress.php index b18db39a3..fc801dd8e 100644 --- a/lib/Doctrine/Log/Filter/Suppress.php +++ b/lib/Doctrine/Log/Filter/Suppress.php @@ -25,7 +25,7 @@ * @author Konsta Vesterinen * @author Jonathan H. Wage * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 3155 $ */ diff --git a/lib/Doctrine/Log/Formatter/Interface.php b/lib/Doctrine/Log/Formatter/Interface.php index 18ab6dbd4..5a8494227 100644 --- a/lib/Doctrine/Log/Formatter/Interface.php +++ b/lib/Doctrine/Log/Formatter/Interface.php @@ -25,7 +25,7 @@ * @author Konsta Vesterinen * @author Jonathan H. Wage * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 3155 $ */ diff --git a/lib/Doctrine/Log/Formatter/Simple.php b/lib/Doctrine/Log/Formatter/Simple.php index 106ead544..b14ccff41 100644 --- a/lib/Doctrine/Log/Formatter/Simple.php +++ b/lib/Doctrine/Log/Formatter/Simple.php @@ -25,7 +25,7 @@ * @author Konsta Vesterinen * @author Jonathan H. Wage * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 3155 $ */ diff --git a/lib/Doctrine/Log/Formatter/Xml.php b/lib/Doctrine/Log/Formatter/Xml.php index ac67034c0..424f849d1 100644 --- a/lib/Doctrine/Log/Formatter/Xml.php +++ b/lib/Doctrine/Log/Formatter/Xml.php @@ -25,7 +25,7 @@ * @author Konsta Vesterinen * @author Jonathan H. Wage * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 3155 $ */ diff --git a/lib/Doctrine/Log/Writer/Abstract.php b/lib/Doctrine/Log/Writer/Abstract.php index cc7c4a9fc..7b83538c8 100644 --- a/lib/Doctrine/Log/Writer/Abstract.php +++ b/lib/Doctrine/Log/Writer/Abstract.php @@ -25,7 +25,7 @@ * @author Konsta Vesterinen * @author Jonathan H. Wage * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 3155 $ */ diff --git a/lib/Doctrine/Log/Writer/Db.php b/lib/Doctrine/Log/Writer/Db.php index 76e1f27f9..88f52e087 100644 --- a/lib/Doctrine/Log/Writer/Db.php +++ b/lib/Doctrine/Log/Writer/Db.php @@ -25,7 +25,7 @@ * @author Konsta Vesterinen * @author Jonathan H. Wage * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 3155 $ */ diff --git a/lib/Doctrine/Log/Writer/Mock.php b/lib/Doctrine/Log/Writer/Mock.php index 90182e754..e174f2c18 100644 --- a/lib/Doctrine/Log/Writer/Mock.php +++ b/lib/Doctrine/Log/Writer/Mock.php @@ -25,7 +25,7 @@ * @author Konsta Vesterinen * @author Jonathan H. Wage * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 3155 $ */ diff --git a/lib/Doctrine/Log/Writer/Null.php b/lib/Doctrine/Log/Writer/Null.php index baa9080ca..02083b63d 100644 --- a/lib/Doctrine/Log/Writer/Null.php +++ b/lib/Doctrine/Log/Writer/Null.php @@ -25,7 +25,7 @@ * @author Konsta Vesterinen * @author Jonathan H. Wage * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 3155 $ */ diff --git a/lib/Doctrine/Log/Writer/Stream.php b/lib/Doctrine/Log/Writer/Stream.php index 785a6b9c5..510eea8a4 100644 --- a/lib/Doctrine/Log/Writer/Stream.php +++ b/lib/Doctrine/Log/Writer/Stream.php @@ -25,7 +25,7 @@ * @author Konsta Vesterinen * @author Jonathan H. Wage * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 3155 $ */ diff --git a/lib/Doctrine/Manager.php b/lib/Doctrine/Manager.php index 6eee7ddce..95418ebcc 100644 --- a/lib/Doctrine/Manager.php +++ b/lib/Doctrine/Manager.php @@ -27,7 +27,7 @@ * @package Doctrine * @subpackage Manager * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Manager/Exception.php b/lib/Doctrine/Manager/Exception.php index 60692b11e..c3d15ed4c 100644 --- a/lib/Doctrine/Manager/Exception.php +++ b/lib/Doctrine/Manager/Exception.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Manager * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Migration.php b/lib/Doctrine/Migration.php index 990a5ac6e..54cb0955c 100644 --- a/lib/Doctrine/Migration.php +++ b/lib/Doctrine/Migration.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Migration * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1080 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Migration/Diff.php b/lib/Doctrine/Migration/Diff.php index 5bbc2f38d..81bde94ab 100644 --- a/lib/Doctrine/Migration/Diff.php +++ b/lib/Doctrine/Migration/Diff.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Migration * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1080 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Migration/Exception.php b/lib/Doctrine/Migration/Exception.php index 1adedd365..9780241d0 100644 --- a/lib/Doctrine/Migration/Exception.php +++ b/lib/Doctrine/Migration/Exception.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Migration * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1080 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Migration/IrreversibleMigrationException.php b/lib/Doctrine/Migration/IrreversibleMigrationException.php index 518d9261c..14d5785bf 100644 --- a/lib/Doctrine/Migration/IrreversibleMigrationException.php +++ b/lib/Doctrine/Migration/IrreversibleMigrationException.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Migration * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1080 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Migration/Process.php b/lib/Doctrine/Migration/Process.php index a864c54f5..58a552936 100644 --- a/lib/Doctrine/Migration/Process.php +++ b/lib/Doctrine/Migration/Process.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Migration * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1080 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Node.php b/lib/Doctrine/Node.php index 800a34248..ba1107509 100644 --- a/lib/Doctrine/Node.php +++ b/lib/Doctrine/Node.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Node * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Joe Simms diff --git a/lib/Doctrine/Node/AdjacencyList.php b/lib/Doctrine/Node/AdjacencyList.php index cb894d4c0..8c8e9b1bf 100644 --- a/lib/Doctrine/Node/AdjacencyList.php +++ b/lib/Doctrine/Node/AdjacencyList.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Node * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Joe Simms diff --git a/lib/Doctrine/Node/AdjacencyList/LevelOrderIterator.php b/lib/Doctrine/Node/AdjacencyList/LevelOrderIterator.php index 519d4ab23..c7a9f72c4 100644 --- a/lib/Doctrine/Node/AdjacencyList/LevelOrderIterator.php +++ b/lib/Doctrine/Node/AdjacencyList/LevelOrderIterator.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Node * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Joe Simms diff --git a/lib/Doctrine/Node/AdjacencyList/PostOrderIterator.php b/lib/Doctrine/Node/AdjacencyList/PostOrderIterator.php index 204801dbf..d7927e123 100644 --- a/lib/Doctrine/Node/AdjacencyList/PostOrderIterator.php +++ b/lib/Doctrine/Node/AdjacencyList/PostOrderIterator.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Node * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Joe Simms diff --git a/lib/Doctrine/Node/AdjacencyList/PreOrderIterator.php b/lib/Doctrine/Node/AdjacencyList/PreOrderIterator.php index d9f22b001..69f05c9e3 100644 --- a/lib/Doctrine/Node/AdjacencyList/PreOrderIterator.php +++ b/lib/Doctrine/Node/AdjacencyList/PreOrderIterator.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Node * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Joe Simms diff --git a/lib/Doctrine/Node/Exception.php b/lib/Doctrine/Node/Exception.php index 5e84c4322..ee676fff0 100644 --- a/lib/Doctrine/Node/Exception.php +++ b/lib/Doctrine/Node/Exception.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Node * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Joe Simms diff --git a/lib/Doctrine/Node/Interface.php b/lib/Doctrine/Node/Interface.php index e746ef0c6..fa7dac8b5 100644 --- a/lib/Doctrine/Node/Interface.php +++ b/lib/Doctrine/Node/Interface.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Node * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Joe Simms diff --git a/lib/Doctrine/Node/MaterializedPath.php b/lib/Doctrine/Node/MaterializedPath.php index 02c30034b..51fa776aa 100644 --- a/lib/Doctrine/Node/MaterializedPath.php +++ b/lib/Doctrine/Node/MaterializedPath.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Node * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Joe Simms diff --git a/lib/Doctrine/Node/MaterializedPath/LevelOrderIterator.php b/lib/Doctrine/Node/MaterializedPath/LevelOrderIterator.php index ec1c15d0a..08ea0a7f2 100644 --- a/lib/Doctrine/Node/MaterializedPath/LevelOrderIterator.php +++ b/lib/Doctrine/Node/MaterializedPath/LevelOrderIterator.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Node * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Joe Simms diff --git a/lib/Doctrine/Node/MaterializedPath/PostOrderIterator.php b/lib/Doctrine/Node/MaterializedPath/PostOrderIterator.php index d41a951de..01241e074 100644 --- a/lib/Doctrine/Node/MaterializedPath/PostOrderIterator.php +++ b/lib/Doctrine/Node/MaterializedPath/PostOrderIterator.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Node * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Joe Simms diff --git a/lib/Doctrine/Node/MaterializedPath/PreOrderIterator.php b/lib/Doctrine/Node/MaterializedPath/PreOrderIterator.php index 25a35c063..6b89cfef4 100644 --- a/lib/Doctrine/Node/MaterializedPath/PreOrderIterator.php +++ b/lib/Doctrine/Node/MaterializedPath/PreOrderIterator.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Node * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Joe Simms diff --git a/lib/Doctrine/Node/NestedSet.php b/lib/Doctrine/Node/NestedSet.php index 39b8545b7..aca7a6687 100644 --- a/lib/Doctrine/Node/NestedSet.php +++ b/lib/Doctrine/Node/NestedSet.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Node * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Joe Simms diff --git a/lib/Doctrine/Node/NestedSet/LevelOrderIterator.php b/lib/Doctrine/Node/NestedSet/LevelOrderIterator.php index 38ecc9c1c..740c94e01 100644 --- a/lib/Doctrine/Node/NestedSet/LevelOrderIterator.php +++ b/lib/Doctrine/Node/NestedSet/LevelOrderIterator.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Node * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Joe Simms diff --git a/lib/Doctrine/Node/NestedSet/PostOrderIterator.php b/lib/Doctrine/Node/NestedSet/PostOrderIterator.php index 26505540d..d07c26aea 100644 --- a/lib/Doctrine/Node/NestedSet/PostOrderIterator.php +++ b/lib/Doctrine/Node/NestedSet/PostOrderIterator.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Node * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Joe Simms diff --git a/lib/Doctrine/Node/NestedSet/PreOrderIterator.php b/lib/Doctrine/Node/NestedSet/PreOrderIterator.php index da977e79e..7fcc1ba2d 100644 --- a/lib/Doctrine/Node/NestedSet/PreOrderIterator.php +++ b/lib/Doctrine/Node/NestedSet/PreOrderIterator.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Node * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Joe Simms diff --git a/lib/Doctrine/Null.php b/lib/Doctrine/Null.php index 9673ea31a..3720c996f 100644 --- a/lib/Doctrine/Null.php +++ b/lib/Doctrine/Null.php @@ -28,7 +28,7 @@ * @package Doctrine * @subpackage Null * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Overloadable.php b/lib/Doctrine/Overloadable.php index 6d2dcf6be..1af239a95 100644 --- a/lib/Doctrine/Overloadable.php +++ b/lib/Doctrine/Overloadable.php @@ -26,7 +26,7 @@ * @package Doctrine * @subpackage Overloadable * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Parser.php b/lib/Doctrine/Parser.php index 8c7f3ddc3..17f02ca1d 100644 --- a/lib/Doctrine/Parser.php +++ b/lib/Doctrine/Parser.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Parser * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1080 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Parser/Exception.php b/lib/Doctrine/Parser/Exception.php index 05264916d..64a1301c8 100644 --- a/lib/Doctrine/Parser/Exception.php +++ b/lib/Doctrine/Parser/Exception.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Exception'); * @package Doctrine * @subpackage Parser * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1080 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Parser/Json.php b/lib/Doctrine/Parser/Json.php index 8bd3e49af..b05bb28b4 100644 --- a/lib/Doctrine/Parser/Json.php +++ b/lib/Doctrine/Parser/Json.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Parser * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1080 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Parser/Serialize.php b/lib/Doctrine/Parser/Serialize.php index b80fae916..57a40964e 100644 --- a/lib/Doctrine/Parser/Serialize.php +++ b/lib/Doctrine/Parser/Serialize.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Parser * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1080 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Parser/Xml.php b/lib/Doctrine/Parser/Xml.php index 81e24719e..397086a8b 100644 --- a/lib/Doctrine/Parser/Xml.php +++ b/lib/Doctrine/Parser/Xml.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Parser * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1080 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Parser/Yml.php b/lib/Doctrine/Parser/Yml.php index a77e5031c..fae25e1d2 100644 --- a/lib/Doctrine/Parser/Yml.php +++ b/lib/Doctrine/Parser/Yml.php @@ -27,7 +27,7 @@ require_once('spyc.php'); * @package Doctrine * @subpackage Parser * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1080 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Query.php b/lib/Doctrine/Query.php index 911e96c24..272ca1ff3 100644 --- a/lib/Doctrine/Query.php +++ b/lib/Doctrine/Query.php @@ -28,7 +28,7 @@ Doctrine::autoload('Doctrine_Query_Abstract'); * @package Doctrine * @subpackage Query * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Query/Abstract.php b/lib/Doctrine/Query/Abstract.php index 99f367895..f5288a3d6 100644 --- a/lib/Doctrine/Query/Abstract.php +++ b/lib/Doctrine/Query/Abstract.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Query * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1393 $ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Query/Check.php b/lib/Doctrine/Query/Check.php index 0db12fc7f..c9bed06bc 100644 --- a/lib/Doctrine/Query/Check.php +++ b/lib/Doctrine/Query/Check.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Query * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1080 $ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Query/Condition.php b/lib/Doctrine/Query/Condition.php index 835f8fcf0..7fc74566a 100644 --- a/lib/Doctrine/Query/Condition.php +++ b/lib/Doctrine/Query/Condition.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Query_Part'); * @package Doctrine * @subpackage Query * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Query/Exception.php b/lib/Doctrine/Query/Exception.php index 59557e999..362ac6a74 100644 --- a/lib/Doctrine/Query/Exception.php +++ b/lib/Doctrine/Query/Exception.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Exception'); * @package Doctrine * @subpackage Query * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Query/Filter.php b/lib/Doctrine/Query/Filter.php index bda8c88b1..1e541de11 100644 --- a/lib/Doctrine/Query/Filter.php +++ b/lib/Doctrine/Query/Filter.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Query * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Query/Filter/Chain.php b/lib/Doctrine/Query/Filter/Chain.php index 364219f93..dcbfb38be 100644 --- a/lib/Doctrine/Query/Filter/Chain.php +++ b/lib/Doctrine/Query/Filter/Chain.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Query * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Query/Filter/Interface.php b/lib/Doctrine/Query/Filter/Interface.php index a95794d64..2370d06f1 100644 --- a/lib/Doctrine/Query/Filter/Interface.php +++ b/lib/Doctrine/Query/Filter/Interface.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Query * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Query/From.php b/lib/Doctrine/Query/From.php index b90fbcbea..304a5b326 100644 --- a/lib/Doctrine/Query/From.php +++ b/lib/Doctrine/Query/From.php @@ -25,7 +25,7 @@ Doctrine::autoload("Doctrine_Query_Part"); * @package Doctrine * @subpackage Query * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Query/Groupby.php b/lib/Doctrine/Query/Groupby.php index 05b5c8bfe..f0a84230c 100644 --- a/lib/Doctrine/Query/Groupby.php +++ b/lib/Doctrine/Query/Groupby.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Query_Part'); * @package Doctrine * @subpackage Query * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Query/Having.php b/lib/Doctrine/Query/Having.php index 01dc6f0f0..28ea094bc 100644 --- a/lib/Doctrine/Query/Having.php +++ b/lib/Doctrine/Query/Having.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Query_Condition'); * @package Doctrine * @subpackage Query * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Query/JoinCondition.php b/lib/Doctrine/Query/JoinCondition.php index 598a84e35..40153a9f1 100644 --- a/lib/Doctrine/Query/JoinCondition.php +++ b/lib/Doctrine/Query/JoinCondition.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Query_Part'); * @package Doctrine * @subpackage Query * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Query/Limit.php b/lib/Doctrine/Query/Limit.php index b92e62dcf..f72d07566 100644 --- a/lib/Doctrine/Query/Limit.php +++ b/lib/Doctrine/Query/Limit.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Query * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1352 $ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Query/Offset.php b/lib/Doctrine/Query/Offset.php index 8fa99d5f1..b09627d9f 100644 --- a/lib/Doctrine/Query/Offset.php +++ b/lib/Doctrine/Query/Offset.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Query * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1352 $ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Query/Orderby.php b/lib/Doctrine/Query/Orderby.php index a496814ae..ef9184173 100644 --- a/lib/Doctrine/Query/Orderby.php +++ b/lib/Doctrine/Query/Orderby.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Query_Part'); * @package Doctrine * @subpackage Query * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Query/Parser.php b/lib/Doctrine/Query/Parser.php index b196fdb8a..d6eee71e4 100644 --- a/lib/Doctrine/Query/Parser.php +++ b/lib/Doctrine/Query/Parser.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Query * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Query/Part.php b/lib/Doctrine/Query/Part.php index 6e56f926d..a6cd4a21e 100644 --- a/lib/Doctrine/Query/Part.php +++ b/lib/Doctrine/Query/Part.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Query * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Query/Registry.php b/lib/Doctrine/Query/Registry.php index a1ab9a4b5..8cffec318 100644 --- a/lib/Doctrine/Query/Registry.php +++ b/lib/Doctrine/Query/Registry.php @@ -26,7 +26,7 @@ * @subpackage Query * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Query/Registry/Exception.php b/lib/Doctrine/Query/Registry/Exception.php index 0ef50171d..e138bdfa6 100644 --- a/lib/Doctrine/Query/Registry/Exception.php +++ b/lib/Doctrine/Query/Registry/Exception.php @@ -26,7 +26,7 @@ Doctrine::autoload('Doctrine_Query_Exception'); * @subpackage Query * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Query/Select.php b/lib/Doctrine/Query/Select.php index 8ae211d0e..3889fc903 100644 --- a/lib/Doctrine/Query/Select.php +++ b/lib/Doctrine/Query/Select.php @@ -25,7 +25,7 @@ Doctrine::autoload("Doctrine_Query_Part"); * @package Doctrine * @subpackage Query * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1080 $ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Query/Set.php b/lib/Doctrine/Query/Set.php index e622ec40f..5edc0b909 100644 --- a/lib/Doctrine/Query/Set.php +++ b/lib/Doctrine/Query/Set.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Query_Part'); * @package Doctrine * @subpackage Query * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Query/Tokenizer.php b/lib/Doctrine/Query/Tokenizer.php index 4a7c32c42..5267ab52e 100644 --- a/lib/Doctrine/Query/Tokenizer.php +++ b/lib/Doctrine/Query/Tokenizer.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Query * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @todo Give the tokenizer state, make it better work together with Doctrine_Query and maybe diff --git a/lib/Doctrine/Query/Tokenizer/Exception.php b/lib/Doctrine/Query/Tokenizer/Exception.php index 3be025022..c569d5b59 100644 --- a/lib/Doctrine/Query/Tokenizer/Exception.php +++ b/lib/Doctrine/Query/Tokenizer/Exception.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Exception'); * @package Doctrine * @subpackage Query * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2702 $ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Query/Where.php b/lib/Doctrine/Query/Where.php index 95c0c42fb..f25149109 100644 --- a/lib/Doctrine/Query/Where.php +++ b/lib/Doctrine/Query/Where.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Query_Condition'); * @package Doctrine * @subpackage Query * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/RawSql.php b/lib/Doctrine/RawSql.php index 249af9577..487d0f276 100644 --- a/lib/Doctrine/RawSql.php +++ b/lib/Doctrine/RawSql.php @@ -31,7 +31,7 @@ Doctrine::autoload('Doctrine_Query_Abstract'); * @package Doctrine * @subpackage RawSql * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/RawSql/Exception.php b/lib/Doctrine/RawSql/Exception.php index 6bdbe736c..8870151eb 100644 --- a/lib/Doctrine/RawSql/Exception.php +++ b/lib/Doctrine/RawSql/Exception.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Exception'); * @package Doctrine * @subpackage RawSql * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Record.php b/lib/Doctrine/Record.php index bc6c48fb8..a358839a2 100644 --- a/lib/Doctrine/Record.php +++ b/lib/Doctrine/Record.php @@ -28,7 +28,7 @@ Doctrine::autoload('Doctrine_Record_Abstract'); * @author Konsta Vesterinen * @author Roman Borschel * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @todo Remove the depdency on the ClassMetadata. All operations that involve the metadata diff --git a/lib/Doctrine/Record/Abstract.php b/lib/Doctrine/Record/Abstract.php index e25807390..4fea55e84 100644 --- a/lib/Doctrine/Record/Abstract.php +++ b/lib/Doctrine/Record/Abstract.php @@ -26,7 +26,7 @@ Doctrine::autoload('Doctrine_Access'); * @subpackage Record * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Record/Exception.php b/lib/Doctrine/Record/Exception.php index bc0f57a8c..4ffb1c1f3 100644 --- a/lib/Doctrine/Record/Exception.php +++ b/lib/Doctrine/Record/Exception.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Exception'); * @package Doctrine * @subpackage Record * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Record/Filter.php b/lib/Doctrine/Record/Filter.php index 35c51dfee..0d0a20218 100644 --- a/lib/Doctrine/Record/Filter.php +++ b/lib/Doctrine/Record/Filter.php @@ -27,7 +27,7 @@ * @subpackage Record * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1298 $ */ diff --git a/lib/Doctrine/Record/Filter/Compound.php b/lib/Doctrine/Record/Filter/Compound.php index fe71c8e01..e863f6fc3 100644 --- a/lib/Doctrine/Record/Filter/Compound.php +++ b/lib/Doctrine/Record/Filter/Compound.php @@ -26,7 +26,7 @@ * @subpackage Record * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1298 $ */ diff --git a/lib/Doctrine/Record/Filter/Standard.php b/lib/Doctrine/Record/Filter/Standard.php index 33dc9e822..dda01f48b 100644 --- a/lib/Doctrine/Record/Filter/Standard.php +++ b/lib/Doctrine/Record/Filter/Standard.php @@ -27,7 +27,7 @@ * @subpackage Record * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1298 $ */ diff --git a/lib/Doctrine/Record/Generator.php b/lib/Doctrine/Record/Generator.php index 4d34bbdf1..82f5dcced 100644 --- a/lib/Doctrine/Record/Generator.php +++ b/lib/Doctrine/Record/Generator.php @@ -27,7 +27,7 @@ * @subpackage Plugin * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ abstract class Doctrine_Record_Generator extends Doctrine_Record_Abstract diff --git a/lib/Doctrine/Record/Iterator.php b/lib/Doctrine/Record/Iterator.php index baa0f6586..52e0cb7e3 100644 --- a/lib/Doctrine/Record/Iterator.php +++ b/lib/Doctrine/Record/Iterator.php @@ -26,7 +26,7 @@ * @subpackage Record * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Record/Listener.php b/lib/Doctrine/Record/Listener.php index b7b6b3dbe..c2cf57b63 100644 --- a/lib/Doctrine/Record/Listener.php +++ b/lib/Doctrine/Record/Listener.php @@ -26,7 +26,7 @@ * @subpackage Record * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Record/Listener/Chain.php b/lib/Doctrine/Record/Listener/Chain.php index a3657ba54..73534565c 100644 --- a/lib/Doctrine/Record/Listener/Chain.php +++ b/lib/Doctrine/Record/Listener/Chain.php @@ -29,7 +29,7 @@ Doctrine::autoload('Doctrine_Access'); * @subpackage Record * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Record/Listener/Interface.php b/lib/Doctrine/Record/Listener/Interface.php index 75f6985d1..2ddc470b1 100644 --- a/lib/Doctrine/Record/Listener/Interface.php +++ b/lib/Doctrine/Record/Listener/Interface.php @@ -26,7 +26,7 @@ * @subpackage Record * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Record/State/Exception.php b/lib/Doctrine/Record/State/Exception.php index 2b88ac566..fd2ad4322 100644 --- a/lib/Doctrine/Record/State/Exception.php +++ b/lib/Doctrine/Record/State/Exception.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Record_Exception'); * @package Doctrine * @subpackage Record * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Relation.php b/lib/Doctrine/Relation.php index 5104a6bb5..98632a1a0 100644 --- a/lib/Doctrine/Relation.php +++ b/lib/Doctrine/Relation.php @@ -26,7 +26,7 @@ * @package Doctrine * @subpackage Relation * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Relation/Association.php b/lib/Doctrine/Relation/Association.php index bcce22e7a..394c9e440 100644 --- a/lib/Doctrine/Relation/Association.php +++ b/lib/Doctrine/Relation/Association.php @@ -27,7 +27,7 @@ Doctrine::autoload('Doctrine_Relation'); * @package Doctrine * @subpackage Relation * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Relation/Association/Self.php b/lib/Doctrine/Relation/Association/Self.php index 98810caf6..3da7ed57c 100644 --- a/lib/Doctrine/Relation/Association/Self.php +++ b/lib/Doctrine/Relation/Association/Self.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Relation_Association'); * @package Doctrine * @subpackage Relation * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Relation/Exception.php b/lib/Doctrine/Relation/Exception.php index 539bc1c4e..ab0de6781 100644 --- a/lib/Doctrine/Relation/Exception.php +++ b/lib/Doctrine/Relation/Exception.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Exception'); * @package Doctrine * @subpackage Relation * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1344 $ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Relation/ForeignKey.php b/lib/Doctrine/Relation/ForeignKey.php index 800215566..fff04f8dc 100644 --- a/lib/Doctrine/Relation/ForeignKey.php +++ b/lib/Doctrine/Relation/ForeignKey.php @@ -27,7 +27,7 @@ Doctrine::autoload('Doctrine_Relation'); * @subpackage Relation * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Relation/LocalKey.php b/lib/Doctrine/Relation/LocalKey.php index 7f6717bf7..2a98149e8 100644 --- a/lib/Doctrine/Relation/LocalKey.php +++ b/lib/Doctrine/Relation/LocalKey.php @@ -27,7 +27,7 @@ Doctrine::autoload('Doctrine_Relation'); * @subpackage Relation * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Relation/Nest.php b/lib/Doctrine/Relation/Nest.php index ca826e8e1..27b935d12 100644 --- a/lib/Doctrine/Relation/Nest.php +++ b/lib/Doctrine/Relation/Nest.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Relation_Association'); * @package Doctrine * @subpackage Relation * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1434 $ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Relation/Parser.php b/lib/Doctrine/Relation/Parser.php index 8b4d8b783..ae9714269 100644 --- a/lib/Doctrine/Relation/Parser.php +++ b/lib/Doctrine/Relation/Parser.php @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version $Revision: 1397 $ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @todo Composite key support? */ diff --git a/lib/Doctrine/Relation/Parser/Exception.php b/lib/Doctrine/Relation/Parser/Exception.php index 78b44643c..49802dd85 100644 --- a/lib/Doctrine/Relation/Parser/Exception.php +++ b/lib/Doctrine/Relation/Parser/Exception.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Relation_Exception'); * @package Doctrine * @subpackage Relation * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Search.php b/lib/Doctrine/Search.php index c0e3aadad..f6321d6e2 100644 --- a/lib/Doctrine/Search.php +++ b/lib/Doctrine/Search.php @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Search extends Doctrine_Record_Generator diff --git a/lib/Doctrine/Search/Analyzer.php b/lib/Doctrine/Search/Analyzer.php index dabd59d1f..28b55bcd7 100644 --- a/lib/Doctrine/Search/Analyzer.php +++ b/lib/Doctrine/Search/Analyzer.php @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Search_Analyzer implements Doctrine_Search_Analyzer_Interface diff --git a/lib/Doctrine/Search/Analyzer/Exception.php b/lib/Doctrine/Search/Analyzer/Exception.php index d24da1dfd..53829108a 100644 --- a/lib/Doctrine/Search/Analyzer/Exception.php +++ b/lib/Doctrine/Search/Analyzer/Exception.php @@ -27,7 +27,7 @@ Doctrine::autoload('Doctrine_Search_Exception'); * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Search_Analyzer_Exception extends Doctrine_Search_Exception diff --git a/lib/Doctrine/Search/Analyzer/Interface.php b/lib/Doctrine/Search/Analyzer/Interface.php index c4cba9e51..c810d2b3b 100644 --- a/lib/Doctrine/Search/Analyzer/Interface.php +++ b/lib/Doctrine/Search/Analyzer/Interface.php @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ interface Doctrine_Search_Analyzer_Interface diff --git a/lib/Doctrine/Search/Analyzer/Standard.php b/lib/Doctrine/Search/Analyzer/Standard.php index 6450ee766..aaa7d6f00 100644 --- a/lib/Doctrine/Search/Analyzer/Standard.php +++ b/lib/Doctrine/Search/Analyzer/Standard.php @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Search_Analyzer_Standard implements Doctrine_Search_Analyzer_Interface diff --git a/lib/Doctrine/Search/Exception.php b/lib/Doctrine/Search/Exception.php index 75e6c0114..d6bc83c34 100644 --- a/lib/Doctrine/Search/Exception.php +++ b/lib/Doctrine/Search/Exception.php @@ -27,7 +27,7 @@ Doctrine::autoload('Doctrine_Exception'); * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Search_Exception extends Doctrine_Exception diff --git a/lib/Doctrine/Search/File.php b/lib/Doctrine/Search/File.php index 7966b495e..75ca6c1a6 100644 --- a/lib/Doctrine/Search/File.php +++ b/lib/Doctrine/Search/File.php @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Search_File extends Doctrine_Search diff --git a/lib/Doctrine/Search/Indexer.php b/lib/Doctrine/Search/Indexer.php index 8fb6542a0..b07144d28 100644 --- a/lib/Doctrine/Search/Indexer.php +++ b/lib/Doctrine/Search/Indexer.php @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Search_Indexer diff --git a/lib/Doctrine/Search/Indexer/Dir.php b/lib/Doctrine/Search/Indexer/Dir.php index 3bba9c424..ea2dedfcf 100644 --- a/lib/Doctrine/Search/Indexer/Dir.php +++ b/lib/Doctrine/Search/Indexer/Dir.php @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Search_Indexer_Dir diff --git a/lib/Doctrine/Search/Indexer/Exception.php b/lib/Doctrine/Search/Indexer/Exception.php index 253f27bfe..3595144cf 100644 --- a/lib/Doctrine/Search/Indexer/Exception.php +++ b/lib/Doctrine/Search/Indexer/Exception.php @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Search_Indexer_Exception extends Doctrine_Search_Exception diff --git a/lib/Doctrine/Search/Listener.php b/lib/Doctrine/Search/Listener.php index 0e403bbf6..6e97ccb1e 100644 --- a/lib/Doctrine/Search/Listener.php +++ b/lib/Doctrine/Search/Listener.php @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Search_Listener extends Doctrine_Record_Listener diff --git a/lib/Doctrine/Search/Parser.php b/lib/Doctrine/Search/Parser.php index 834035407..8710e1cd2 100644 --- a/lib/Doctrine/Search/Parser.php +++ b/lib/Doctrine/Search/Parser.php @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Search_Parser diff --git a/lib/Doctrine/Search/Query.php b/lib/Doctrine/Search/Query.php index 82a98c199..466574e99 100644 --- a/lib/Doctrine/Search/Query.php +++ b/lib/Doctrine/Search/Query.php @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Search_Query diff --git a/lib/Doctrine/Search/Record.php b/lib/Doctrine/Search/Record.php index 97dd270ac..95015c003 100644 --- a/lib/Doctrine/Search/Record.php +++ b/lib/Doctrine/Search/Record.php @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Search_Record extends Doctrine_Template diff --git a/lib/Doctrine/Search/Scorer.php b/lib/Doctrine/Search/Scorer.php index a3dafd90f..d8ac7b8d0 100644 --- a/lib/Doctrine/Search/Scorer.php +++ b/lib/Doctrine/Search/Scorer.php @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Search_Scorer diff --git a/lib/Doctrine/Sequence.php b/lib/Doctrine/Sequence.php index 0b626321a..34e8b3965 100644 --- a/lib/Doctrine/Sequence.php +++ b/lib/Doctrine/Sequence.php @@ -27,7 +27,7 @@ Doctrine::autoload('Doctrine_Connection_Module'); * @subpackage Sequence * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Sequence/Db2.php b/lib/Doctrine/Sequence/Db2.php index 6cf5ed5ea..4af66c82a 100644 --- a/lib/Doctrine/Sequence/Db2.php +++ b/lib/Doctrine/Sequence/Db2.php @@ -26,7 +26,7 @@ Doctrine::autoload('Doctrine_Sequence'); * @subpackage Sequence * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Sequence/Exception.php b/lib/Doctrine/Sequence/Exception.php index 33fec1f7a..7283bd036 100644 --- a/lib/Doctrine/Sequence/Exception.php +++ b/lib/Doctrine/Sequence/Exception.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Exception'); * @package Doctrine * @subpackage Sequence * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Sequence/Firebird.php b/lib/Doctrine/Sequence/Firebird.php index e6d262bf2..90e4f7772 100644 --- a/lib/Doctrine/Sequence/Firebird.php +++ b/lib/Doctrine/Sequence/Firebird.php @@ -26,7 +26,7 @@ Doctrine::autoload('Doctrine_Sequence'); * @subpackage Sequence * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Sequence/Informix.php b/lib/Doctrine/Sequence/Informix.php index 5320ad117..bf659f782 100644 --- a/lib/Doctrine/Sequence/Informix.php +++ b/lib/Doctrine/Sequence/Informix.php @@ -26,7 +26,7 @@ * @subpackage Sequence * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Sequence/Mssql.php b/lib/Doctrine/Sequence/Mssql.php index e8db73d91..e62a0c034 100644 --- a/lib/Doctrine/Sequence/Mssql.php +++ b/lib/Doctrine/Sequence/Mssql.php @@ -26,7 +26,7 @@ Doctrine::autoload('Doctrine_Sequence'); * @subpackage Sequence * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Sequence/Mysql.php b/lib/Doctrine/Sequence/Mysql.php index 179c37a71..1903255ee 100644 --- a/lib/Doctrine/Sequence/Mysql.php +++ b/lib/Doctrine/Sequence/Mysql.php @@ -26,7 +26,7 @@ Doctrine::autoload('Doctrine_Sequence'); * @subpackage Sequence * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Sequence/Oracle.php b/lib/Doctrine/Sequence/Oracle.php index 2e2870452..9fef95469 100644 --- a/lib/Doctrine/Sequence/Oracle.php +++ b/lib/Doctrine/Sequence/Oracle.php @@ -26,7 +26,7 @@ Doctrine::autoload('Doctrine_Sequence'); * @subpackage Sequence * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Sequence/Pgsql.php b/lib/Doctrine/Sequence/Pgsql.php index 816aa5a55..8c66fe815 100644 --- a/lib/Doctrine/Sequence/Pgsql.php +++ b/lib/Doctrine/Sequence/Pgsql.php @@ -26,7 +26,7 @@ Doctrine::autoload('Doctrine_Sequence'); * @subpackage Sequence * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Sequence/Sqlite.php b/lib/Doctrine/Sequence/Sqlite.php index 3f9bf14b0..35fdc008c 100644 --- a/lib/Doctrine/Sequence/Sqlite.php +++ b/lib/Doctrine/Sequence/Sqlite.php @@ -26,7 +26,7 @@ Doctrine::autoload('Doctrine_Sequence'); * @subpackage Sequence * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Table/Exception.php b/lib/Doctrine/Table/Exception.php index 4281def51..69a7f8d1e 100644 --- a/lib/Doctrine/Table/Exception.php +++ b/lib/Doctrine/Table/Exception.php @@ -26,7 +26,7 @@ Doctrine::autoload('Doctrine_Exception'); * @package Doctrine * @subpackage Table * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Table/Repository.php b/lib/Doctrine/Table/Repository.php index 7d611f94d..42efd8c5d 100644 --- a/lib/Doctrine/Table/Repository.php +++ b/lib/Doctrine/Table/Repository.php @@ -28,7 +28,7 @@ * @package Doctrine * @subpackage Table * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Table/Repository/Exception.php b/lib/Doctrine/Table/Repository/Exception.php index 1b118c841..905606784 100644 --- a/lib/Doctrine/Table/Repository/Exception.php +++ b/lib/Doctrine/Table/Repository/Exception.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Exception'); * @package Doctrine * @subpackage Table * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Task.php b/lib/Doctrine/Task.php index 38b8d5792..2c757d0bb 100644 --- a/lib/Doctrine/Task.php +++ b/lib/Doctrine/Task.php @@ -27,7 +27,7 @@ * @package Doctrine * @subpackage Task * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2761 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Task/BuildAll.php b/lib/Doctrine/Task/BuildAll.php index e5ecf8257..bb71c7f69 100644 --- a/lib/Doctrine/Task/BuildAll.php +++ b/lib/Doctrine/Task/BuildAll.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Task * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2761 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Task/BuildAllLoad.php b/lib/Doctrine/Task/BuildAllLoad.php index 06e99cea1..b4e50311b 100644 --- a/lib/Doctrine/Task/BuildAllLoad.php +++ b/lib/Doctrine/Task/BuildAllLoad.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Task * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2761 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Task/BuildAllReload.php b/lib/Doctrine/Task/BuildAllReload.php index a14fa5953..efd258dc2 100644 --- a/lib/Doctrine/Task/BuildAllReload.php +++ b/lib/Doctrine/Task/BuildAllReload.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Task * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2761 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Task/Compile.php b/lib/Doctrine/Task/Compile.php index 133207ed1..d1b4ceaab 100644 --- a/lib/Doctrine/Task/Compile.php +++ b/lib/Doctrine/Task/Compile.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Task * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2761 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Task/CreateDb.php b/lib/Doctrine/Task/CreateDb.php index fcec22617..c00b577fa 100644 --- a/lib/Doctrine/Task/CreateDb.php +++ b/lib/Doctrine/Task/CreateDb.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Task * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2761 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Task/CreateTables.php b/lib/Doctrine/Task/CreateTables.php index 58f9a21b9..213e7b335 100644 --- a/lib/Doctrine/Task/CreateTables.php +++ b/lib/Doctrine/Task/CreateTables.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Task * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2761 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Task/Dql.php b/lib/Doctrine/Task/Dql.php index ec3c76b8b..720f9eeff 100644 --- a/lib/Doctrine/Task/Dql.php +++ b/lib/Doctrine/Task/Dql.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Task * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2761 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Task/DropDb.php b/lib/Doctrine/Task/DropDb.php index bbb9ae89d..7eb1ab092 100644 --- a/lib/Doctrine/Task/DropDb.php +++ b/lib/Doctrine/Task/DropDb.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Task * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2761 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Task/DumpData.php b/lib/Doctrine/Task/DumpData.php index 5d7b9a410..dddd4cefa 100644 --- a/lib/Doctrine/Task/DumpData.php +++ b/lib/Doctrine/Task/DumpData.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Task * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2761 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Task/Exception.php b/lib/Doctrine/Task/Exception.php index 10dcc3d94..febadc321 100644 --- a/lib/Doctrine/Task/Exception.php +++ b/lib/Doctrine/Task/Exception.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Task * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2761 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Task/GenerateMigration.php b/lib/Doctrine/Task/GenerateMigration.php index 06f786ce7..29075257a 100644 --- a/lib/Doctrine/Task/GenerateMigration.php +++ b/lib/Doctrine/Task/GenerateMigration.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Task * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2761 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Task/GenerateMigrationsDb.php b/lib/Doctrine/Task/GenerateMigrationsDb.php index e11f64887..b26639398 100644 --- a/lib/Doctrine/Task/GenerateMigrationsDb.php +++ b/lib/Doctrine/Task/GenerateMigrationsDb.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Task * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2761 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Task/GenerateMigrationsModels.php b/lib/Doctrine/Task/GenerateMigrationsModels.php index 5230d5765..e2f17de9b 100644 --- a/lib/Doctrine/Task/GenerateMigrationsModels.php +++ b/lib/Doctrine/Task/GenerateMigrationsModels.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Task * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2761 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Task/GenerateModelsDb.php b/lib/Doctrine/Task/GenerateModelsDb.php index 0c72e58d5..afe3ff01a 100644 --- a/lib/Doctrine/Task/GenerateModelsDb.php +++ b/lib/Doctrine/Task/GenerateModelsDb.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Task * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2761 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Task/GenerateModelsYaml.php b/lib/Doctrine/Task/GenerateModelsYaml.php index 93efb19c5..79b6098cf 100644 --- a/lib/Doctrine/Task/GenerateModelsYaml.php +++ b/lib/Doctrine/Task/GenerateModelsYaml.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Task * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2761 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Task/GenerateSql.php b/lib/Doctrine/Task/GenerateSql.php index 1f91fe5bb..e67c620fa 100644 --- a/lib/Doctrine/Task/GenerateSql.php +++ b/lib/Doctrine/Task/GenerateSql.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Task * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2761 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Task/GenerateYamlDb.php b/lib/Doctrine/Task/GenerateYamlDb.php index a5a50e14e..2ae2a014d 100644 --- a/lib/Doctrine/Task/GenerateYamlDb.php +++ b/lib/Doctrine/Task/GenerateYamlDb.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Task * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2761 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Task/GenerateYamlModels.php b/lib/Doctrine/Task/GenerateYamlModels.php index a8c8ae27f..5cb55b2b6 100644 --- a/lib/Doctrine/Task/GenerateYamlModels.php +++ b/lib/Doctrine/Task/GenerateYamlModels.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Task * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2761 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Task/LoadData.php b/lib/Doctrine/Task/LoadData.php index a34013131..84078207a 100644 --- a/lib/Doctrine/Task/LoadData.php +++ b/lib/Doctrine/Task/LoadData.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Task * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2761 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Task/LoadDummyData.php b/lib/Doctrine/Task/LoadDummyData.php index f23eab162..81c0f80e2 100644 --- a/lib/Doctrine/Task/LoadDummyData.php +++ b/lib/Doctrine/Task/LoadDummyData.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Task * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2761 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Task/Migrate.php b/lib/Doctrine/Task/Migrate.php index bd29cedd9..eb14449d1 100644 --- a/lib/Doctrine/Task/Migrate.php +++ b/lib/Doctrine/Task/Migrate.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Task * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2761 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Task/RebuildDb.php b/lib/Doctrine/Task/RebuildDb.php index 3b9ad85fd..e374136da 100644 --- a/lib/Doctrine/Task/RebuildDb.php +++ b/lib/Doctrine/Task/RebuildDb.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Task * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2761 $ * @author Jonathan H. Wage diff --git a/lib/Doctrine/Template.php b/lib/Doctrine/Template.php index 90893df18..c94c09d9c 100644 --- a/lib/Doctrine/Template.php +++ b/lib/Doctrine/Template.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Record_Abstract'); * @package Doctrine * @subpackage Template * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Template/Geographical.php b/lib/Doctrine/Template/Geographical.php index 691e269d0..5050503ac 100644 --- a/lib/Doctrine/Template/Geographical.php +++ b/lib/Doctrine/Template/Geographical.php @@ -27,7 +27,7 @@ * @package Doctrine * @subpackage Template * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Template/I18n.php b/lib/Doctrine/Template/I18n.php index a93a8dce0..72c019366 100644 --- a/lib/Doctrine/Template/I18n.php +++ b/lib/Doctrine/Template/I18n.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Template * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Template/Listener/Sluggable.php b/lib/Doctrine/Template/Listener/Sluggable.php index d09784ddd..5da04ff99 100644 --- a/lib/Doctrine/Template/Listener/Sluggable.php +++ b/lib/Doctrine/Template/Listener/Sluggable.php @@ -27,7 +27,7 @@ * @package Doctrine * @subpackage Template * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Template/Listener/Timestampable.php b/lib/Doctrine/Template/Listener/Timestampable.php index 00a08ad15..d330b6c70 100644 --- a/lib/Doctrine/Template/Listener/Timestampable.php +++ b/lib/Doctrine/Template/Listener/Timestampable.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Template * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Template/NestedSet.php b/lib/Doctrine/Template/NestedSet.php index 0e9f475b5..2d9954c44 100644 --- a/lib/Doctrine/Template/NestedSet.php +++ b/lib/Doctrine/Template/NestedSet.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Template * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Roman Borschel diff --git a/lib/Doctrine/Template/Searchable.php b/lib/Doctrine/Template/Searchable.php index 7d54dc9de..c4054d5de 100644 --- a/lib/Doctrine/Template/Searchable.php +++ b/lib/Doctrine/Template/Searchable.php @@ -27,7 +27,7 @@ * @subpackage Template * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Template_Searchable extends Doctrine_Template diff --git a/lib/Doctrine/Template/Sluggable.php b/lib/Doctrine/Template/Sluggable.php index 88a81c989..ae6ec1a3f 100644 --- a/lib/Doctrine/Template/Sluggable.php +++ b/lib/Doctrine/Template/Sluggable.php @@ -27,7 +27,7 @@ * @package Doctrine * @subpackage Template * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Template/Taggable.php b/lib/Doctrine/Template/Taggable.php index 8240e60d9..2eb475925 100644 --- a/lib/Doctrine/Template/Taggable.php +++ b/lib/Doctrine/Template/Taggable.php @@ -27,7 +27,7 @@ * @subpackage Template * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Template_Taggable extends Doctrine_Template diff --git a/lib/Doctrine/Template/Timestampable.php b/lib/Doctrine/Template/Timestampable.php index 4220b9185..3cd4b1775 100644 --- a/lib/Doctrine/Template/Timestampable.php +++ b/lib/Doctrine/Template/Timestampable.php @@ -27,7 +27,7 @@ * @package Doctrine * @subpackage Template * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Template/Versionable.php b/lib/Doctrine/Template/Versionable.php index 535bad631..d31a3a3ef 100644 --- a/lib/Doctrine/Template/Versionable.php +++ b/lib/Doctrine/Template/Versionable.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Template * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Transaction.php b/lib/Doctrine/Transaction.php index 304c2961d..916190702 100644 --- a/lib/Doctrine/Transaction.php +++ b/lib/Doctrine/Transaction.php @@ -28,7 +28,7 @@ Doctrine::autoload('Doctrine_Connection_Module'); * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @package Doctrine * @subpackage Transaction - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Transaction/Exception.php b/lib/Doctrine/Transaction/Exception.php index 8850b6469..1d4609a50 100644 --- a/lib/Doctrine/Transaction/Exception.php +++ b/lib/Doctrine/Transaction/Exception.php @@ -28,7 +28,7 @@ Doctrine::autoload('Doctrine_Exception'); * @author Konsta Vesterinen * @since 1.0 * @version $Revision$ - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org */ class Doctrine_Transaction_Exception extends Doctrine_Exception { } \ No newline at end of file diff --git a/lib/Doctrine/Transaction/Firebird.php b/lib/Doctrine/Transaction/Firebird.php index 96744b330..d04eef930 100644 --- a/lib/Doctrine/Transaction/Firebird.php +++ b/lib/Doctrine/Transaction/Firebird.php @@ -26,7 +26,7 @@ Doctrine::autoload('Doctrine_Transaction'); * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @package Doctrine * @subpackage Transaction - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Transaction/Informix.php b/lib/Doctrine/Transaction/Informix.php index 4780cb6d3..ed26449c9 100644 --- a/lib/Doctrine/Transaction/Informix.php +++ b/lib/Doctrine/Transaction/Informix.php @@ -26,7 +26,7 @@ Doctrine::autoload('Doctrine_Transaction'); * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @package Doctrine * @subpackage Transaction - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Transaction/Mock.php b/lib/Doctrine/Transaction/Mock.php index 43c0f40aa..5c93754b8 100644 --- a/lib/Doctrine/Transaction/Mock.php +++ b/lib/Doctrine/Transaction/Mock.php @@ -28,7 +28,7 @@ Doctrine::autoload('Doctrine_Transaction'); * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @package Doctrine * @subpackage Transaction - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Transaction/Mssql.php b/lib/Doctrine/Transaction/Mssql.php index 6906cf0f4..d5a81bfef 100644 --- a/lib/Doctrine/Transaction/Mssql.php +++ b/lib/Doctrine/Transaction/Mssql.php @@ -26,7 +26,7 @@ Doctrine::autoload('Doctrine_Transaction'); * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @package Doctrine * @subpackage Transaction - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Transaction/Mysql.php b/lib/Doctrine/Transaction/Mysql.php index fd2076a23..1ecb378a3 100644 --- a/lib/Doctrine/Transaction/Mysql.php +++ b/lib/Doctrine/Transaction/Mysql.php @@ -26,7 +26,7 @@ Doctrine::autoload('Doctrine_Transaction'); * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @package Doctrine * @subpackage Transaction - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Transaction/Oracle.php b/lib/Doctrine/Transaction/Oracle.php index eae9fb3db..75494be4f 100644 --- a/lib/Doctrine/Transaction/Oracle.php +++ b/lib/Doctrine/Transaction/Oracle.php @@ -26,7 +26,7 @@ Doctrine::autoload('Doctrine_Transaction'); * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @package Doctrine * @subpackage Transaction - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Transaction/Pgsql.php b/lib/Doctrine/Transaction/Pgsql.php index 39ba45e95..f052243a9 100644 --- a/lib/Doctrine/Transaction/Pgsql.php +++ b/lib/Doctrine/Transaction/Pgsql.php @@ -27,7 +27,7 @@ Doctrine::autoload('Doctrine_Transaction'); * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @package Doctrine * @subpackage Transaction - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Transaction/Sqlite.php b/lib/Doctrine/Transaction/Sqlite.php index 876a63ad2..2b71247e0 100644 --- a/lib/Doctrine/Transaction/Sqlite.php +++ b/lib/Doctrine/Transaction/Sqlite.php @@ -26,7 +26,7 @@ Doctrine::autoload('Doctrine_Transaction'); * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @package Doctrine * @subpackage Transaction - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Tree.php b/lib/Doctrine/Tree.php index 2b425e8b4..95383f78b 100644 --- a/lib/Doctrine/Tree.php +++ b/lib/Doctrine/Tree.php @@ -24,7 +24,7 @@ * @package Doctrine * @subpackage Tree * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Joe Simms diff --git a/lib/Doctrine/Tree/AdjacencyList.php b/lib/Doctrine/Tree/AdjacencyList.php index a078e58b3..241bdb33b 100644 --- a/lib/Doctrine/Tree/AdjacencyList.php +++ b/lib/Doctrine/Tree/AdjacencyList.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Tree * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Joe Simms diff --git a/lib/Doctrine/Tree/Exception.php b/lib/Doctrine/Tree/Exception.php index db57bedca..2f462bdfa 100644 --- a/lib/Doctrine/Tree/Exception.php +++ b/lib/Doctrine/Tree/Exception.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Tree * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Tree/Interface.php b/lib/Doctrine/Tree/Interface.php index 5c80fa9f7..a280bc819 100644 --- a/lib/Doctrine/Tree/Interface.php +++ b/lib/Doctrine/Tree/Interface.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Tree * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Joe Simms diff --git a/lib/Doctrine/Tree/MaterializedPath.php b/lib/Doctrine/Tree/MaterializedPath.php index 453e5a1c1..63f0fbe87 100644 --- a/lib/Doctrine/Tree/MaterializedPath.php +++ b/lib/Doctrine/Tree/MaterializedPath.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Tree * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Joe Simms diff --git a/lib/Doctrine/Tree/NestedSet.php b/lib/Doctrine/Tree/NestedSet.php index c6e21eb3e..9dffd77c4 100644 --- a/lib/Doctrine/Tree/NestedSet.php +++ b/lib/Doctrine/Tree/NestedSet.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Tree * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Joe Simms diff --git a/lib/Doctrine/Util.php b/lib/Doctrine/Util.php index e9b4d8fce..305e21b3f 100644 --- a/lib/Doctrine/Util.php +++ b/lib/Doctrine/Util.php @@ -25,7 +25,7 @@ Doctrine::autoload('Doctrine_Connection_Module'); * @package Doctrine * @subpackage Util * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Validator.php b/lib/Doctrine/Validator.php index 865ff8de3..2b95a5aca 100644 --- a/lib/Doctrine/Validator.php +++ b/lib/Doctrine/Validator.php @@ -26,7 +26,7 @@ * @package Doctrine * @subpackage Validator * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Validator/Country.php b/lib/Doctrine/Validator/Country.php index 732db2fe4..db7d48edf 100644 --- a/lib/Doctrine/Validator/Country.php +++ b/lib/Doctrine/Validator/Country.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Validator * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Validator/Creditcard.php b/lib/Doctrine/Validator/Creditcard.php index d994669bc..6e9c2c3be 100644 --- a/lib/Doctrine/Validator/Creditcard.php +++ b/lib/Doctrine/Validator/Creditcard.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Validator * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Validator/Date.php b/lib/Doctrine/Validator/Date.php index afca75c01..ab92630cb 100644 --- a/lib/Doctrine/Validator/Date.php +++ b/lib/Doctrine/Validator/Date.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Validator * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Validator/Driver.php b/lib/Doctrine/Validator/Driver.php index f3f10d1c4..3093f8320 100644 --- a/lib/Doctrine/Validator/Driver.php +++ b/lib/Doctrine/Validator/Driver.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Validator * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1080 $ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Validator/Email.php b/lib/Doctrine/Validator/Email.php index 1045994dd..5c950f219 100644 --- a/lib/Doctrine/Validator/Email.php +++ b/lib/Doctrine/Validator/Email.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Validator * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Validator/ErrorStack.php b/lib/Doctrine/Validator/ErrorStack.php index 22c418985..df203b8f4 100644 --- a/lib/Doctrine/Validator/ErrorStack.php +++ b/lib/Doctrine/Validator/ErrorStack.php @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @author Roman Borschel * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Validator/Exception.php b/lib/Doctrine/Validator/Exception.php index a5e01eb74..6ea45ee59 100644 --- a/lib/Doctrine/Validator/Exception.php +++ b/lib/Doctrine/Validator/Exception.php @@ -26,7 +26,7 @@ Doctrine::autoload('Doctrine_Exception'); * @subpackage Validator * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/Validator/Future.php b/lib/Doctrine/Validator/Future.php index 9f34c4c8f..7eac4066d 100644 --- a/lib/Doctrine/Validator/Future.php +++ b/lib/Doctrine/Validator/Future.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Validator * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Roman Borschel diff --git a/lib/Doctrine/Validator/Htmlcolor.php b/lib/Doctrine/Validator/Htmlcolor.php index b0f8d0059..81cf7f4f5 100644 --- a/lib/Doctrine/Validator/Htmlcolor.php +++ b/lib/Doctrine/Validator/Htmlcolor.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Validator * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Validator/Ip.php b/lib/Doctrine/Validator/Ip.php index 18a5069b1..c201f236a 100644 --- a/lib/Doctrine/Validator/Ip.php +++ b/lib/Doctrine/Validator/Ip.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Validator * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Validator/Minlength.php b/lib/Doctrine/Validator/Minlength.php index c20b5b7cf..602a392a2 100644 --- a/lib/Doctrine/Validator/Minlength.php +++ b/lib/Doctrine/Validator/Minlength.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Validator * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Gijs van Dulmen diff --git a/lib/Doctrine/Validator/Nospace.php b/lib/Doctrine/Validator/Nospace.php index 295615720..fa90af18a 100644 --- a/lib/Doctrine/Validator/Nospace.php +++ b/lib/Doctrine/Validator/Nospace.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Validator * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Validator/Notblank.php b/lib/Doctrine/Validator/Notblank.php index 260c530e2..589728092 100644 --- a/lib/Doctrine/Validator/Notblank.php +++ b/lib/Doctrine/Validator/Notblank.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Validator * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Validator/Notnull.php b/lib/Doctrine/Validator/Notnull.php index 6f02ac1ec..ae7703219 100644 --- a/lib/Doctrine/Validator/Notnull.php +++ b/lib/Doctrine/Validator/Notnull.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Validator * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Validator/Past.php b/lib/Doctrine/Validator/Past.php index 3f99d34ff..53a277bc9 100644 --- a/lib/Doctrine/Validator/Past.php +++ b/lib/Doctrine/Validator/Past.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Validator * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Roman Borschel diff --git a/lib/Doctrine/Validator/Range.php b/lib/Doctrine/Validator/Range.php index b63a7b7c5..a36e59e8e 100644 --- a/lib/Doctrine/Validator/Range.php +++ b/lib/Doctrine/Validator/Range.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Validator * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Validator/Readonly.php b/lib/Doctrine/Validator/Readonly.php index d4713777a..df916956e 100644 --- a/lib/Doctrine/Validator/Readonly.php +++ b/lib/Doctrine/Validator/Readonly.php @@ -14,7 +14,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -23,7 +23,7 @@ * @package Doctrine * @subpackage Validator * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @author Adam Huttler */ class Doctrine_Validator_Readonly diff --git a/lib/Doctrine/Validator/Regexp.php b/lib/Doctrine/Validator/Regexp.php index d41a8b1d3..2028c742c 100644 --- a/lib/Doctrine/Validator/Regexp.php +++ b/lib/Doctrine/Validator/Regexp.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Validator * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Validator/Unique.php b/lib/Doctrine/Validator/Unique.php index 2a4ee24ab..c1a8f490e 100644 --- a/lib/Doctrine/Validator/Unique.php +++ b/lib/Doctrine/Validator/Unique.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Validator * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Validator/Unsigned.php b/lib/Doctrine/Validator/Unsigned.php index 5aea22cda..02af1fd37 100644 --- a/lib/Doctrine/Validator/Unsigned.php +++ b/lib/Doctrine/Validator/Unsigned.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Validator * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1080 $ * @author Konsta Vesterinen diff --git a/lib/Doctrine/Validator/Usstate.php b/lib/Doctrine/Validator/Usstate.php index ed26787d1..d2f33c876 100644 --- a/lib/Doctrine/Validator/Usstate.php +++ b/lib/Doctrine/Validator/Usstate.php @@ -25,7 +25,7 @@ * @package Doctrine * @subpackage Validator * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen diff --git a/lib/Doctrine/View.php b/lib/Doctrine/View.php index d8f9ae940..c750288f7 100644 --- a/lib/Doctrine/View.php +++ b/lib/Doctrine/View.php @@ -28,7 +28,7 @@ * @package Doctrine * @subpackage View * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/lib/Doctrine/View/Exception.php b/lib/Doctrine/View/Exception.php index b8189159f..a1ad7c6eb 100644 --- a/lib/Doctrine/View/Exception.php +++ b/lib/Doctrine/View/Exception.php @@ -26,7 +26,7 @@ Doctrine::autoload('Doctrine_View_Exception'); * @subpackage View * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests/Orm/Component/AccessTest.php b/tests/Orm/Component/AccessTest.php index 7a431d6d5..880f8eb29 100644 --- a/tests/Orm/Component/AccessTest.php +++ b/tests/Orm/Component/AccessTest.php @@ -25,7 +25,7 @@ * @package Doctrine * @author Bjarte Stien Karlsen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 3754 $ */ diff --git a/tests/Orm/Component/CollectionTest.php b/tests/Orm/Component/CollectionTest.php index 416fd0277..94c7705e4 100644 --- a/tests/Orm/Component/CollectionTest.php +++ b/tests/Orm/Component/CollectionTest.php @@ -26,7 +26,7 @@ * @package Doctrine * @author Bjarte Stien Karlsen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 3754 $ */ diff --git a/tests_old/AccessTestCase.php b/tests_old/AccessTestCase.php index efd8f7fc8..1ccb6d730 100644 --- a/tests_old/AccessTestCase.php +++ b/tests_old/AccessTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/AuditLogTestCase.php b/tests_old/AuditLogTestCase.php index 930ed1301..7f6a85cc4 100644 --- a/tests_old/AuditLogTestCase.php +++ b/tests_old/AuditLogTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/BatchIteratorTestCase.php b/tests_old/BatchIteratorTestCase.php index ec08e4f24..da8186904 100644 --- a/tests_old/BatchIteratorTestCase.php +++ b/tests_old/BatchIteratorTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Cache/ApcTestCase.php b/tests_old/Cache/ApcTestCase.php index bec05c170..ff6e71750 100644 --- a/tests_old/Cache/ApcTestCase.php +++ b/tests_old/Cache/ApcTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Cache/MemcacheTestCase.php b/tests_old/Cache/MemcacheTestCase.php index d4c62a985..b507c5774 100644 --- a/tests_old/Cache/MemcacheTestCase.php +++ b/tests_old/Cache/MemcacheTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Cache/SqliteTestCase.php b/tests_old/Cache/SqliteTestCase.php index 46364f63a..b23a18ebe 100644 --- a/tests_old/Cache/SqliteTestCase.php +++ b/tests_old/Cache/SqliteTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/CacheTestCase.php b/tests_old/CacheTestCase.php index a436abcb1..bf54fd9a8 100644 --- a/tests_old/CacheTestCase.php +++ b/tests_old/CacheTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/CascadingDeleteTestCase.php b/tests_old/CascadingDeleteTestCase.php index 6b80eea29..8a689664c 100644 --- a/tests_old/CascadingDeleteTestCase.php +++ b/tests_old/CascadingDeleteTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/ClassTableInheritanceTestCase.php b/tests_old/ClassTableInheritanceTestCase.php index 07c495a48..d8e0d16fa 100644 --- a/tests_old/ClassTableInheritanceTestCase.php +++ b/tests_old/ClassTableInheritanceTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Collection/SnapshotTestCase.php b/tests_old/Collection/SnapshotTestCase.php index 967af92c3..31dd96a26 100644 --- a/tests_old/Collection/SnapshotTestCase.php +++ b/tests_old/Collection/SnapshotTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -32,7 +32,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/CollectionTestCase.php b/tests_old/CollectionTestCase.php index 298e4ea4e..5d495b556 100644 --- a/tests_old/CollectionTestCase.php +++ b/tests_old/CollectionTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/ColumnAggregationInheritanceTestCase.php b/tests_old/ColumnAggregationInheritanceTestCase.php index f4e889380..3873aec24 100644 --- a/tests_old/ColumnAggregationInheritanceTestCase.php +++ b/tests_old/ColumnAggregationInheritanceTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -27,7 +27,7 @@ * @author Bjarte Stien Karlsen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/ColumnAliasTestCase.php b/tests_old/ColumnAliasTestCase.php index 4ccac79aa..59fb81001 100644 --- a/tests_old/ColumnAliasTestCase.php +++ b/tests_old/ColumnAliasTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Connection/MssqlTestCase.php b/tests_old/Connection/MssqlTestCase.php index 0ac7c690e..c40e02c10 100644 --- a/tests_old/Connection/MssqlTestCase.php +++ b/tests_old/Connection/MssqlTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Connection/MysqlTestCase.php b/tests_old/Connection/MysqlTestCase.php index 2064f1db8..aca2dea13 100644 --- a/tests_old/Connection/MysqlTestCase.php +++ b/tests_old/Connection/MysqlTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Connection/OracleTestCase.php b/tests_old/Connection/OracleTestCase.php index f790eb52a..85bce1308 100644 --- a/tests_old/Connection/OracleTestCase.php +++ b/tests_old/Connection/OracleTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Connection/PgsqlTestCase.php b/tests_old/Connection/PgsqlTestCase.php index c152f7195..0c13d8128 100644 --- a/tests_old/Connection/PgsqlTestCase.php +++ b/tests_old/Connection/PgsqlTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Connection/ProfilerTestCase.php b/tests_old/Connection/ProfilerTestCase.php index 0a4680e04..c23c491ba 100644 --- a/tests_old/Connection/ProfilerTestCase.php +++ b/tests_old/Connection/ProfilerTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Connection/SqliteTestCase.php b/tests_old/Connection/SqliteTestCase.php index c7aacab83..a1afde98d 100644 --- a/tests_old/Connection/SqliteTestCase.php +++ b/tests_old/Connection/SqliteTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Connection/UnitOfWork.php b/tests_old/Connection/UnitOfWork.php index 3520a68c6..d9823c266 100644 --- a/tests_old/Connection/UnitOfWork.php +++ b/tests_old/Connection/UnitOfWork.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/ConnectionTestCase.php b/tests_old/ConnectionTestCase.php index 46b47a778..14478e80f 100644 --- a/tests_old/ConnectionTestCase.php +++ b/tests_old/ConnectionTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/CtiColumnAggregationTestCase.php b/tests_old/CtiColumnAggregationTestCase.php index 5351e0303..bd7244d01 100644 --- a/tests_old/CtiColumnAggregationTestCase.php +++ b/tests_old/CtiColumnAggregationTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/CustomPrimaryKeyTestCase.php b/tests_old/CustomPrimaryKeyTestCase.php index c0cd3c6e2..d31c200b3 100644 --- a/tests_old/CustomPrimaryKeyTestCase.php +++ b/tests_old/CustomPrimaryKeyTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/CustomResultSetOrderTestCase.php b/tests_old/CustomResultSetOrderTestCase.php index ab976a224..02b0354b0 100644 --- a/tests_old/CustomResultSetOrderTestCase.php +++ b/tests_old/CustomResultSetOrderTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/CustomResultSetOrderTestCaseTestCase.php b/tests_old/CustomResultSetOrderTestCaseTestCase.php index 2c02c18e8..1ecf5d6e4 100644 --- a/tests_old/CustomResultSetOrderTestCaseTestCase.php +++ b/tests_old/CustomResultSetOrderTestCaseTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/DBTestCase.php b/tests_old/DBTestCase.php index 3d8903d91..896d1b080 100644 --- a/tests_old/DBTestCase.php +++ b/tests_old/DBTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Data/ExportTestCase.php b/tests_old/Data/ExportTestCase.php index 1692d0fa0..be49149c8 100644 --- a/tests_old/Data/ExportTestCase.php +++ b/tests_old/Data/ExportTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Data/ImportTestCase.php b/tests_old/Data/ImportTestCase.php index 1aee17493..793d544f0 100644 --- a/tests_old/Data/ImportTestCase.php +++ b/tests_old/Data/ImportTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/DataDict/FirebirdTestCase.php b/tests_old/DataDict/FirebirdTestCase.php index a1d172b49..d73cfc749 100644 --- a/tests_old/DataDict/FirebirdTestCase.php +++ b/tests_old/DataDict/FirebirdTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/DataDict/InformixTestCase.php b/tests_old/DataDict/InformixTestCase.php index cfa9f037b..8022b734c 100644 --- a/tests_old/DataDict/InformixTestCase.php +++ b/tests_old/DataDict/InformixTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/DataDict/MssqlTestCase.php b/tests_old/DataDict/MssqlTestCase.php index c17714eff..d39eb4b9a 100644 --- a/tests_old/DataDict/MssqlTestCase.php +++ b/tests_old/DataDict/MssqlTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/DataDict/MysqlTestCase.php b/tests_old/DataDict/MysqlTestCase.php index 2cb79d9fd..df5b07ced 100644 --- a/tests_old/DataDict/MysqlTestCase.php +++ b/tests_old/DataDict/MysqlTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/DataDict/OracleTestCase.php b/tests_old/DataDict/OracleTestCase.php index 5fafd1f00..952a71d41 100644 --- a/tests_old/DataDict/OracleTestCase.php +++ b/tests_old/DataDict/OracleTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/DataDict/PgsqlTestCase.php b/tests_old/DataDict/PgsqlTestCase.php index 333a634ef..8acf5d705 100644 --- a/tests_old/DataDict/PgsqlTestCase.php +++ b/tests_old/DataDict/PgsqlTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/DataDict/SqliteTestCase.php b/tests_old/DataDict/SqliteTestCase.php index 36bc1c947..d12a778aa 100644 --- a/tests_old/DataDict/SqliteTestCase.php +++ b/tests_old/DataDict/SqliteTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/DataDictTestCase.php b/tests_old/DataDictTestCase.php index b52e1d303..f80f421be 100644 --- a/tests_old/DataDictTestCase.php +++ b/tests_old/DataDictTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/DataType/BooleanTestCase.php b/tests_old/DataType/BooleanTestCase.php index e2cbf0fd3..92afbf534 100644 --- a/tests_old/DataType/BooleanTestCase.php +++ b/tests_old/DataType/BooleanTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/DataType/EnumTestCase.php b/tests_old/DataType/EnumTestCase.php index c93adb04e..b7c3de088 100644 --- a/tests_old/DataType/EnumTestCase.php +++ b/tests_old/DataType/EnumTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Db/ProfilerTestCase.php b/tests_old/Db/ProfilerTestCase.php index b72a78d9c..97ed8aed4 100644 --- a/tests_old/Db/ProfilerTestCase.php +++ b/tests_old/Db/ProfilerTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/DoctrineTest.php b/tests_old/DoctrineTest.php index 3899daca5..83f63ecef 100644 --- a/tests_old/DoctrineTest.php +++ b/tests_old/DoctrineTest.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -27,7 +27,7 @@ * @author Bjarte S. Karlsen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/DoctrineTest/Coverage.php b/tests_old/DoctrineTest/Coverage.php index 32351b7da..893d46164 100644 --- a/tests_old/DoctrineTest/Coverage.php +++ b/tests_old/DoctrineTest/Coverage.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -27,7 +27,7 @@ * @author Bjarte S. Karlsen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/DoctrineTest/Doctrine_UnitTestCase.php b/tests_old/DoctrineTest/Doctrine_UnitTestCase.php index 9c52a44e6..cbca2b704 100644 --- a/tests_old/DoctrineTest/Doctrine_UnitTestCase.php +++ b/tests_old/DoctrineTest/Doctrine_UnitTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/EventListener/ChainTestCase.php b/tests_old/EventListener/ChainTestCase.php index fa9d28163..9bf94a2a8 100644 --- a/tests_old/EventListener/ChainTestCase.php +++ b/tests_old/EventListener/ChainTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/EventListenerTestCase.php b/tests_old/EventListenerTestCase.php index 2cd57df5e..0c21775d8 100644 --- a/tests_old/EventListenerTestCase.php +++ b/tests_old/EventListenerTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Export/CheckConstraintTestCase.php b/tests_old/Export/CheckConstraintTestCase.php index 9540d132d..5070111ba 100644 --- a/tests_old/Export/CheckConstraintTestCase.php +++ b/tests_old/Export/CheckConstraintTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Export/FirebirdTestCase.php b/tests_old/Export/FirebirdTestCase.php index 5f5dc14d6..6cb87a040 100644 --- a/tests_old/Export/FirebirdTestCase.php +++ b/tests_old/Export/FirebirdTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Export/InformixTestCase.php b/tests_old/Export/InformixTestCase.php index a35d0c4d9..7bec0c4d8 100644 --- a/tests_old/Export/InformixTestCase.php +++ b/tests_old/Export/InformixTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Export/MssqlTestCase.php b/tests_old/Export/MssqlTestCase.php index 5ed6be1fd..8b5c6b215 100644 --- a/tests_old/Export/MssqlTestCase.php +++ b/tests_old/Export/MssqlTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Export/MysqlTestCase.php b/tests_old/Export/MysqlTestCase.php index 4d2475826..d4c8930d6 100644 --- a/tests_old/Export/MysqlTestCase.php +++ b/tests_old/Export/MysqlTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Export/OracleTestCase.php b/tests_old/Export/OracleTestCase.php index 6760bbc39..44dbd88bf 100644 --- a/tests_old/Export/OracleTestCase.php +++ b/tests_old/Export/OracleTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Export/PgsqlTestCase.php b/tests_old/Export/PgsqlTestCase.php index 8f2601c1f..1178d89fb 100644 --- a/tests_old/Export/PgsqlTestCase.php +++ b/tests_old/Export/PgsqlTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Export/RecordTestCase.php b/tests_old/Export/RecordTestCase.php index b9c30d497..e4c9dfd67 100644 --- a/tests_old/Export/RecordTestCase.php +++ b/tests_old/Export/RecordTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Export/SchemaTestCase.php b/tests_old/Export/SchemaTestCase.php index b304da9f4..354559214 100644 --- a/tests_old/Export/SchemaTestCase.php +++ b/tests_old/Export/SchemaTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Export/SqliteTestCase.php b/tests_old/Export/SqliteTestCase.php index 4fb30c789..87cb92f21 100644 --- a/tests_old/Export/SqliteTestCase.php +++ b/tests_old/Export/SqliteTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/ExportTestCase.php b/tests_old/ExportTestCase.php index 3ff67fa4c..de5609710 100644 --- a/tests_old/ExportTestCase.php +++ b/tests_old/ExportTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Expression/DriverTestCase.php b/tests_old/Expression/DriverTestCase.php index 36e80f94d..450b39734 100644 --- a/tests_old/Expression/DriverTestCase.php +++ b/tests_old/Expression/DriverTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Expression/FirebirdTestCase.php b/tests_old/Expression/FirebirdTestCase.php index 3329d5938..2b8e43e56 100644 --- a/tests_old/Expression/FirebirdTestCase.php +++ b/tests_old/Expression/FirebirdTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Expression/InformixTestCase.php b/tests_old/Expression/InformixTestCase.php index 70c257c82..f78faef3e 100644 --- a/tests_old/Expression/InformixTestCase.php +++ b/tests_old/Expression/InformixTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Expression/MssqlTestCase.php b/tests_old/Expression/MssqlTestCase.php index c95897f66..0343cc0c3 100644 --- a/tests_old/Expression/MssqlTestCase.php +++ b/tests_old/Expression/MssqlTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Expression/MysqlTestCase.php b/tests_old/Expression/MysqlTestCase.php index f9931fa01..993940dfb 100644 --- a/tests_old/Expression/MysqlTestCase.php +++ b/tests_old/Expression/MysqlTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Expression/OracleTestCase.php b/tests_old/Expression/OracleTestCase.php index 3bb4771e9..a26d856c3 100644 --- a/tests_old/Expression/OracleTestCase.php +++ b/tests_old/Expression/OracleTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Expression/PgsqlTestCase.php b/tests_old/Expression/PgsqlTestCase.php index 040bb4672..996142c37 100644 --- a/tests_old/Expression/PgsqlTestCase.php +++ b/tests_old/Expression/PgsqlTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Expression/SqliteTestCase.php b/tests_old/Expression/SqliteTestCase.php index 92f37e18e..d6508aa26 100644 --- a/tests_old/Expression/SqliteTestCase.php +++ b/tests_old/Expression/SqliteTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/ExpressionTestCase.php b/tests_old/ExpressionTestCase.php index f35faa64b..a51075a83 100644 --- a/tests_old/ExpressionTestCase.php +++ b/tests_old/ExpressionTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/ForeignKeyTestCase.php b/tests_old/ForeignKeyTestCase.php index 48a3b53c6..49f864e82 100644 --- a/tests_old/ForeignKeyTestCase.php +++ b/tests_old/ForeignKeyTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/HookTestCase.php b/tests_old/HookTestCase.php index f37833d58..0e2d1a053 100644 --- a/tests_old/HookTestCase.php +++ b/tests_old/HookTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Hydrate/FetchModeTestCase.php b/tests_old/Hydrate/FetchModeTestCase.php index d0b11559b..b1b958a49 100644 --- a/tests_old/Hydrate/FetchModeTestCase.php +++ b/tests_old/Hydrate/FetchModeTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/HydrateTestCase.php b/tests_old/HydrateTestCase.php index fbd539fc2..02792f4e0 100644 --- a/tests_old/HydrateTestCase.php +++ b/tests_old/HydrateTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/I18nTestCase.php b/tests_old/I18nTestCase.php index 3251750e7..6d6f76033 100644 --- a/tests_old/I18nTestCase.php +++ b/tests_old/I18nTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Import/BuilderTestCase.php b/tests_old/Import/BuilderTestCase.php index f677fca30..110541093 100644 --- a/tests_old/Import/BuilderTestCase.php +++ b/tests_old/Import/BuilderTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Import/FirebirdTestCase.php b/tests_old/Import/FirebirdTestCase.php index 266d0de7b..4765238ab 100644 --- a/tests_old/Import/FirebirdTestCase.php +++ b/tests_old/Import/FirebirdTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Import/InformixTestCase.php b/tests_old/Import/InformixTestCase.php index 0408c8344..f2b716147 100644 --- a/tests_old/Import/InformixTestCase.php +++ b/tests_old/Import/InformixTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Import/MssqlTestCase.php b/tests_old/Import/MssqlTestCase.php index e6cb8a3c2..2cbd1ef01 100644 --- a/tests_old/Import/MssqlTestCase.php +++ b/tests_old/Import/MssqlTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Import/MysqlTestCase.php b/tests_old/Import/MysqlTestCase.php index e70c766a3..6c8624d73 100644 --- a/tests_old/Import/MysqlTestCase.php +++ b/tests_old/Import/MysqlTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Import/OracleTestCase.php b/tests_old/Import/OracleTestCase.php index e11fd3262..e91beb9fd 100644 --- a/tests_old/Import/OracleTestCase.php +++ b/tests_old/Import/OracleTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Import/PgsqlTestCase.php b/tests_old/Import/PgsqlTestCase.php index 14961a584..172ec5793 100644 --- a/tests_old/Import/PgsqlTestCase.php +++ b/tests_old/Import/PgsqlTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Import/SchemaTestCase.php b/tests_old/Import/SchemaTestCase.php index 0ce8ff288..c7f64a524 100644 --- a/tests_old/Import/SchemaTestCase.php +++ b/tests_old/Import/SchemaTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Import/SqliteTestCase.php b/tests_old/Import/SqliteTestCase.php index ca32d95da..f548046b4 100644 --- a/tests_old/Import/SqliteTestCase.php +++ b/tests_old/Import/SqliteTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/ImportTestCase.php b/tests_old/ImportTestCase.php index a080a4cc4..ae0c0da5a 100644 --- a/tests_old/ImportTestCase.php +++ b/tests_old/ImportTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/IntegrityActionTestCase.php b/tests_old/IntegrityActionTestCase.php index 8b4cc4806..67a6b8b24 100644 --- a/tests_old/IntegrityActionTestCase.php +++ b/tests_old/IntegrityActionTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/ManagerTestCase.php b/tests_old/ManagerTestCase.php index af5a21bdf..9d70168fc 100644 --- a/tests_old/ManagerTestCase.php +++ b/tests_old/ManagerTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Migration/MysqlTestCase.php b/tests_old/Migration/MysqlTestCase.php index 247be23b6..c23f6ea52 100644 --- a/tests_old/Migration/MysqlTestCase.php +++ b/tests_old/Migration/MysqlTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/MigrationTestCase.php b/tests_old/MigrationTestCase.php index 26b6e9704..aa3c16c79 100644 --- a/tests_old/MigrationTestCase.php +++ b/tests_old/MigrationTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/NestedSet/LoadInSetUpTestCase.php b/tests_old/NestedSet/LoadInSetUpTestCase.php index 9d895faa9..acd9228d5 100644 --- a/tests_old/NestedSet/LoadInSetUpTestCase.php +++ b/tests_old/NestedSet/LoadInSetUpTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/NestedSet/SingleRootTestCase.php b/tests_old/NestedSet/SingleRootTestCase.php index d0f1de783..d763f8bef 100644 --- a/tests_old/NestedSet/SingleRootTestCase.php +++ b/tests_old/NestedSet/SingleRootTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/NewCoreTestCase.php b/tests_old/NewCoreTestCase.php index 1cf3d0202..926baf9e4 100644 --- a/tests_old/NewCoreTestCase.php +++ b/tests_old/NewCoreTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/OneTableOneClassInheritanceTestCase.php b/tests_old/OneTableOneClassInheritanceTestCase.php index 3f41cd99c..c1da7386c 100644 --- a/tests_old/OneTableOneClassInheritanceTestCase.php +++ b/tests_old/OneTableOneClassInheritanceTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Bjarte Stien Karlsen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/ParserTestCase.php b/tests_old/ParserTestCase.php index 8293d9c1c..009ba3516 100644 --- a/tests_old/ParserTestCase.php +++ b/tests_old/ParserTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/PessimisticLockingTestCase.php b/tests_old/PessimisticLockingTestCase.php index 49a81e9fd..2d2428a53 100644 --- a/tests_old/PessimisticLockingTestCase.php +++ b/tests_old/PessimisticLockingTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/PluginTestCase.php b/tests_old/PluginTestCase.php index 743c5fa29..ce12f37e1 100644 --- a/tests_old/PluginTestCase.php +++ b/tests_old/PluginTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Query/AggregateValueTestCase.php b/tests_old/Query/AggregateValueTestCase.php index 89081a694..1df8b6b94 100644 --- a/tests_old/Query/AggregateValueTestCase.php +++ b/tests_old/Query/AggregateValueTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Query/ApplyInheritanceTestCase.php b/tests_old/Query/ApplyInheritanceTestCase.php index 55afa926e..a3071e757 100644 --- a/tests_old/Query/ApplyInheritanceTestCase.php +++ b/tests_old/Query/ApplyInheritanceTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Query/CacheTestCase.php b/tests_old/Query/CacheTestCase.php index 3eee3e849..126b7e114 100644 --- a/tests_old/Query/CacheTestCase.php +++ b/tests_old/Query/CacheTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Query/CheckTestCase.php b/tests_old/Query/CheckTestCase.php index 76023af6a..c5302e88c 100644 --- a/tests_old/Query/CheckTestCase.php +++ b/tests_old/Query/CheckTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Query/ComponentAliasTestCase.php b/tests_old/Query/ComponentAliasTestCase.php index aa42702d0..a352c34cd 100644 --- a/tests_old/Query/ComponentAliasTestCase.php +++ b/tests_old/Query/ComponentAliasTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Query/ConditionTestCase.php b/tests_old/Query/ConditionTestCase.php index 429402393..d24da4cfe 100644 --- a/tests_old/Query/ConditionTestCase.php +++ b/tests_old/Query/ConditionTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Query/DeleteTestCase.php b/tests_old/Query/DeleteTestCase.php index 4c4e17ed8..53f30001a 100644 --- a/tests_old/Query/DeleteTestCase.php +++ b/tests_old/Query/DeleteTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Query/DriverTestCase.php b/tests_old/Query/DriverTestCase.php index 252a2a850..6fc7f2e55 100644 --- a/tests_old/Query/DriverTestCase.php +++ b/tests_old/Query/DriverTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Query/ExpressionTestCase.php b/tests_old/Query/ExpressionTestCase.php index ab4404592..6df16654c 100644 --- a/tests_old/Query/ExpressionTestCase.php +++ b/tests_old/Query/ExpressionTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @version $Revision$ * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Query_Expression_TestCase extends Doctrine_UnitTestCase diff --git a/tests_old/Query/FromTestCase.php b/tests_old/Query/FromTestCase.php index d65113df5..75ca6287b 100644 --- a/tests_old/Query/FromTestCase.php +++ b/tests_old/Query/FromTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Query/GroupbyTestCase.php b/tests_old/Query/GroupbyTestCase.php index babdd02e0..a304d4a9f 100644 --- a/tests_old/Query/GroupbyTestCase.php +++ b/tests_old/Query/GroupbyTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @version $Revision$ * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Query_Groupby_TestCase extends Doctrine_UnitTestCase diff --git a/tests_old/Query/HavingTestCase.php b/tests_old/Query/HavingTestCase.php index 7d986fd04..ca5f4dbb0 100644 --- a/tests_old/Query/HavingTestCase.php +++ b/tests_old/Query/HavingTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @version $Revision$ * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Query_Having_TestCase extends Doctrine_UnitTestCase diff --git a/tests_old/Query/IdentifierQuotingTestCase.php b/tests_old/Query/IdentifierQuotingTestCase.php index ff9ce42c0..f08e28bab 100644 --- a/tests_old/Query/IdentifierQuotingTestCase.php +++ b/tests_old/Query/IdentifierQuotingTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -29,7 +29,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Query/JoinCondition2TestCase.php b/tests_old/Query/JoinCondition2TestCase.php index 598a4135f..d75e3ca3a 100755 --- a/tests_old/Query/JoinCondition2TestCase.php +++ b/tests_old/Query/JoinCondition2TestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Guilherme Blanco * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Query/JoinConditionTestCase.php b/tests_old/Query/JoinConditionTestCase.php index 7a0901ff8..482f6b615 100644 --- a/tests_old/Query/JoinConditionTestCase.php +++ b/tests_old/Query/JoinConditionTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Query/JoinTestCase.php b/tests_old/Query/JoinTestCase.php index 89896b660..23d3f6e2c 100644 --- a/tests_old/Query/JoinTestCase.php +++ b/tests_old/Query/JoinTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Query/LimitTestCase.php b/tests_old/Query/LimitTestCase.php index a026a6b11..867d20af5 100644 --- a/tests_old/Query/LimitTestCase.php +++ b/tests_old/Query/LimitTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -28,7 +28,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Query/MultiJoin2TestCase.php b/tests_old/Query/MultiJoin2TestCase.php index 43d22805b..262cad655 100644 --- a/tests_old/Query/MultiJoin2TestCase.php +++ b/tests_old/Query/MultiJoin2TestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Query/MultiJoinTestCase.php b/tests_old/Query/MultiJoinTestCase.php index 19fa37c06..3c9fce0fb 100644 --- a/tests_old/Query/MultiJoinTestCase.php +++ b/tests_old/Query/MultiJoinTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Query/MultipleAggregateValueTestCase.php b/tests_old/Query/MultipleAggregateValueTestCase.php index ef23adb80..bf7cd7a43 100644 --- a/tests_old/Query/MultipleAggregateValueTestCase.php +++ b/tests_old/Query/MultipleAggregateValueTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -27,7 +27,7 @@ * @author Jonathan H. Wage * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Query/MysqlSubqueryHavingTestCase.php b/tests_old/Query/MysqlSubqueryHavingTestCase.php index e9d6484ed..3b7d9a7d8 100644 --- a/tests_old/Query/MysqlSubqueryHavingTestCase.php +++ b/tests_old/Query/MysqlSubqueryHavingTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Query/MysqlSubqueryTestCase.php b/tests_old/Query/MysqlSubqueryTestCase.php index a0e09aa01..257f19a6c 100644 --- a/tests_old/Query/MysqlSubqueryTestCase.php +++ b/tests_old/Query/MysqlSubqueryTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Query/OneToOneFetchingTestCase.php b/tests_old/Query/OneToOneFetchingTestCase.php index bd6c0a7e9..a386be936 100644 --- a/tests_old/Query/OneToOneFetchingTestCase.php +++ b/tests_old/Query/OneToOneFetchingTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Query/OrderbyTestCase.php b/tests_old/Query/OrderbyTestCase.php index ab041c8bd..b6ddc134f 100644 --- a/tests_old/Query/OrderbyTestCase.php +++ b/tests_old/Query/OrderbyTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Query/PgsqlSubqueryTestCase.php b/tests_old/Query/PgsqlSubqueryTestCase.php index 7da254bb5..930e37274 100644 --- a/tests_old/Query/PgsqlSubqueryTestCase.php +++ b/tests_old/Query/PgsqlSubqueryTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Query/ReferenceModelTestCase.php b/tests_old/Query/ReferenceModelTestCase.php index 076e0d187..9e796dd33 100644 --- a/tests_old/Query/ReferenceModelTestCase.php +++ b/tests_old/Query/ReferenceModelTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Query/RegistryTestCase.php b/tests_old/Query/RegistryTestCase.php index 76978066e..2755df600 100644 --- a/tests_old/Query/RegistryTestCase.php +++ b/tests_old/Query/RegistryTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Query/SelectExpressionTestCase.php b/tests_old/Query/SelectExpressionTestCase.php index 35217cea4..76b19d2d7 100644 --- a/tests_old/Query/SelectExpressionTestCase.php +++ b/tests_old/Query/SelectExpressionTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Query/SelectTestCase.php b/tests_old/Query/SelectTestCase.php index 1d5c98a60..9fae6a2f2 100644 --- a/tests_old/Query/SelectTestCase.php +++ b/tests_old/Query/SelectTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Query/SubqueryTestCase.php b/tests_old/Query/SubqueryTestCase.php index d09d2d1e1..840beb6c3 100644 --- a/tests_old/Query/SubqueryTestCase.php +++ b/tests_old/Query/SubqueryTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Query/UpdateTestCase.php b/tests_old/Query/UpdateTestCase.php index bf514f67c..fde143d99 100644 --- a/tests_old/Query/UpdateTestCase.php +++ b/tests_old/Query/UpdateTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Query/WhereTestCase.php b/tests_old/Query/WhereTestCase.php index da87bcae5..0a057ea7d 100644 --- a/tests_old/Query/WhereTestCase.php +++ b/tests_old/Query/WhereTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -27,7 +27,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/QueryTestCase.php b/tests_old/QueryTestCase.php index 3519d91b5..8bc130b03 100644 --- a/tests_old/QueryTestCase.php +++ b/tests_old/QueryTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/RawSqlTestCase.php b/tests_old/RawSqlTestCase.php index 055396e96..ef617093b 100644 --- a/tests_old/RawSqlTestCase.php +++ b/tests_old/RawSqlTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @package Doctrine * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1181 $ * @author Konsta Vesterinen diff --git a/tests_old/Record/FilterTestCase.php b/tests_old/Record/FilterTestCase.php index a7b015355..35d56c53e 100644 --- a/tests_old/Record/FilterTestCase.php +++ b/tests_old/Record/FilterTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Record/HookTestCase.php b/tests_old/Record/HookTestCase.php index 743f466f2..b839c524e 100644 --- a/tests_old/Record/HookTestCase.php +++ b/tests_old/Record/HookTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Record/InheritanceTestCase.php b/tests_old/Record/InheritanceTestCase.php index c9755dcf4..57dc4a15c 100644 --- a/tests_old/Record/InheritanceTestCase.php +++ b/tests_old/Record/InheritanceTestCase.php @@ -12,7 +12,7 @@ * @author David Brewer * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Record/SaveBlankRecordTestCase.php b/tests_old/Record/SaveBlankRecordTestCase.php index bf125ab3e..65c891a74 100644 --- a/tests_old/Record/SaveBlankRecordTestCase.php +++ b/tests_old/Record/SaveBlankRecordTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Record/SerializeUnserializeTestCase.php b/tests_old/Record/SerializeUnserializeTestCase.php index 329f2b43f..1974781ed 100644 --- a/tests_old/Record/SerializeUnserializeTestCase.php +++ b/tests_old/Record/SerializeUnserializeTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Record/StateTestCase.php b/tests_old/Record/StateTestCase.php index 681734dd4..0757c7c89 100644 --- a/tests_old/Record/StateTestCase.php +++ b/tests_old/Record/StateTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Record/SynchronizeTestCase.php b/tests_old/Record/SynchronizeTestCase.php index c1d26eac9..c462ef405 100644 --- a/tests_old/Record/SynchronizeTestCase.php +++ b/tests_old/Record/SynchronizeTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Record/ZeroValuesTestCase.php b/tests_old/Record/ZeroValuesTestCase.php index cf77d375b..172036f89 100644 --- a/tests_old/Record/ZeroValuesTestCase.php +++ b/tests_old/Record/ZeroValuesTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/RecordTestCase.php b/tests_old/RecordTestCase.php index c10e77285..3cc3b13f4 100644 --- a/tests_old/RecordTestCase.php +++ b/tests_old/RecordTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Relation/CircularSavingTestCase.php b/tests_old/Relation/CircularSavingTestCase.php index b1c0b7f1b..41444b74a 100644 --- a/tests_old/Relation/CircularSavingTestCase.php +++ b/tests_old/Relation/CircularSavingTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -27,7 +27,7 @@ * @author Jan Schaefer * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Relation/ManyToMany2TestCase.php b/tests_old/Relation/ManyToMany2TestCase.php index 6d79b18e9..1fd238e14 100644 --- a/tests_old/Relation/ManyToMany2TestCase.php +++ b/tests_old/Relation/ManyToMany2TestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Relation/NestTestCase.php b/tests_old/Relation/NestTestCase.php index d59d7a59e..6da81c467 100644 --- a/tests_old/Relation/NestTestCase.php +++ b/tests_old/Relation/NestTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Relation/OneToManyTestCase.php b/tests_old/Relation/OneToManyTestCase.php index de9e36bd1..8d06c3d0b 100644 --- a/tests_old/Relation/OneToManyTestCase.php +++ b/tests_old/Relation/OneToManyTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Relation/OneToOneTestCase.php b/tests_old/Relation/OneToOneTestCase.php index 6ddbf98de..4a7b9b591 100644 --- a/tests_old/Relation/OneToOneTestCase.php +++ b/tests_old/Relation/OneToOneTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Relation/ParserTestCase.php b/tests_old/Relation/ParserTestCase.php index fd3fd64a1..f59a2f0f9 100644 --- a/tests_old/Relation/ParserTestCase.php +++ b/tests_old/Relation/ParserTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/RelationTestCase.php b/tests_old/RelationTestCase.php index a6dc482f4..dced15da7 100644 --- a/tests_old/RelationTestCase.php +++ b/tests_old/RelationTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Search/FileTestCase.php b/tests_old/Search/FileTestCase.php index d3636cd83..c9fe06cad 100644 --- a/tests_old/Search/FileTestCase.php +++ b/tests_old/Search/FileTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Search/IndexerTestCase.php b/tests_old/Search/IndexerTestCase.php index 0454b6afe..6f4f7b122 100644 --- a/tests_old/Search/IndexerTestCase.php +++ b/tests_old/Search/IndexerTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Search/QueryTestCase.php b/tests_old/Search/QueryTestCase.php index 387fdbaa2..744177102 100644 --- a/tests_old/Search/QueryTestCase.php +++ b/tests_old/Search/QueryTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ @@ -325,4 +325,4 @@ class Doctrine_Search_Query_TestCase extends Doctrine_UnitTestCase $this->assertFalse($result); } -} +} diff --git a/tests_old/Search/QueryWeightTestCase.php b/tests_old/Search/QueryWeightTestCase.php index 0047a0562..353834aa8 100644 --- a/tests_old/Search/QueryWeightTestCase.php +++ b/tests_old/Search/QueryWeightTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/SearchTestCase.php b/tests_old/SearchTestCase.php index 1842d74db..d1711afc7 100644 --- a/tests_old/SearchTestCase.php +++ b/tests_old/SearchTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Sequence/FirebirdTestCase.php b/tests_old/Sequence/FirebirdTestCase.php index ca584e669..0c45e6255 100644 --- a/tests_old/Sequence/FirebirdTestCase.php +++ b/tests_old/Sequence/FirebirdTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Sequence/InformixTestCase.php b/tests_old/Sequence/InformixTestCase.php index aaf0b4e0b..c39fee90a 100644 --- a/tests_old/Sequence/InformixTestCase.php +++ b/tests_old/Sequence/InformixTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Sequence/MssqlTestCase.php b/tests_old/Sequence/MssqlTestCase.php index c5fd35d3b..52edf8ed6 100644 --- a/tests_old/Sequence/MssqlTestCase.php +++ b/tests_old/Sequence/MssqlTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Sequence/MysqlTestCase.php b/tests_old/Sequence/MysqlTestCase.php index 08acb6ddf..6995ac959 100644 --- a/tests_old/Sequence/MysqlTestCase.php +++ b/tests_old/Sequence/MysqlTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Sequence/OracleTestCase.php b/tests_old/Sequence/OracleTestCase.php index 8d12cc5a5..72e7d7b1d 100644 --- a/tests_old/Sequence/OracleTestCase.php +++ b/tests_old/Sequence/OracleTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Sequence/PgsqlTestCase.php b/tests_old/Sequence/PgsqlTestCase.php index f65133f6c..f5ccb4e55 100644 --- a/tests_old/Sequence/PgsqlTestCase.php +++ b/tests_old/Sequence/PgsqlTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Sequence/SqliteTestCase.php b/tests_old/Sequence/SqliteTestCase.php index 7ffb1ab40..012807bb5 100644 --- a/tests_old/Sequence/SqliteTestCase.php +++ b/tests_old/Sequence/SqliteTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/SequenceTestCase.php b/tests_old/SequenceTestCase.php index 1222fe1c3..c99cba43c 100644 --- a/tests_old/SequenceTestCase.php +++ b/tests_old/SequenceTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/TableTestCase.php b/tests_old/TableTestCase.php index eaaca4014..614bbc532 100644 --- a/tests_old/TableTestCase.php +++ b/tests_old/TableTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/TemplateTestCase.php b/tests_old/TemplateTestCase.php index 6afe9acb5..3a6db6bb6 100644 --- a/tests_old/TemplateTestCase.php +++ b/tests_old/TemplateTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Ticket/381TestCase.php b/tests_old/Ticket/381TestCase.php index 91e4adb60..e8174cfa7 100644 --- a/tests_old/Ticket/381TestCase.php +++ b/tests_old/Ticket/381TestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Ticket/424BTestCase.php b/tests_old/Ticket/424BTestCase.php index cc650804e..7f7fa8fbd 100644 --- a/tests_old/Ticket/424BTestCase.php +++ b/tests_old/Ticket/424BTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -28,7 +28,7 @@ * @author Tamcy <7am.online@gmail.com> * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Ticket/424CTestCase.php b/tests_old/Ticket/424CTestCase.php index 1ba137595..c31b30309 100644 --- a/tests_old/Ticket/424CTestCase.php +++ b/tests_old/Ticket/424CTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -28,7 +28,7 @@ * @author Tamcy <7am.online@gmail.com> * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Ticket/428TestCase.php b/tests_old/Ticket/428TestCase.php index 79bbdef3b..8206a86fc 100644 --- a/tests_old/Ticket/428TestCase.php +++ b/tests_old/Ticket/428TestCase.php @@ -7,7 +7,7 @@ * @author Tamcy <7am.online@gmail.com> * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Ticket/438TestCase.php b/tests_old/Ticket/438TestCase.php index fd1cc69ac..25f9d6ccb 100644 --- a/tests_old/Ticket/438TestCase.php +++ b/tests_old/Ticket/438TestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Tamcy <7am.online@gmail.com> * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Ticket/480TestCase.php b/tests_old/Ticket/480TestCase.php index 03856e461..e0a521ba0 100644 --- a/tests_old/Ticket/480TestCase.php +++ b/tests_old/Ticket/480TestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Miloslav Kmet * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Ticket/576TestCase.php b/tests_old/Ticket/576TestCase.php index d9d500bbc..915fbfc59 100644 --- a/tests_old/Ticket/576TestCase.php +++ b/tests_old/Ticket/576TestCase.php @@ -7,7 +7,7 @@ * @author Joaquin Bravo * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Ticket/583TestCase.php b/tests_old/Ticket/583TestCase.php index a4f8cac2e..b24c09aa7 100644 --- a/tests_old/Ticket/583TestCase.php +++ b/tests_old/Ticket/583TestCase.php @@ -7,7 +7,7 @@ * @author Joaquin Bravo * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Ticket/587TestCase.php b/tests_old/Ticket/587TestCase.php index cf24af59e..6d3d25cd1 100644 --- a/tests_old/Ticket/587TestCase.php +++ b/tests_old/Ticket/587TestCase.php @@ -7,7 +7,7 @@ * @author David Brewer * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Ticket/626BTestCase.php b/tests_old/Ticket/626BTestCase.php index a4044f4e6..8e7c8c960 100644 --- a/tests_old/Ticket/626BTestCase.php +++ b/tests_old/Ticket/626BTestCase.php @@ -7,7 +7,7 @@ * @author Tamcy <7am.online@gmail.com> * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Ticket/626CTestCase.php b/tests_old/Ticket/626CTestCase.php index 4da2ec2e5..30ebd3c26 100644 --- a/tests_old/Ticket/626CTestCase.php +++ b/tests_old/Ticket/626CTestCase.php @@ -7,7 +7,7 @@ * @author Tamcy <7am.online@gmail.com> * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Ticket/626DTestCase.php b/tests_old/Ticket/626DTestCase.php index c950b3cbd..beee47686 100644 --- a/tests_old/Ticket/626DTestCase.php +++ b/tests_old/Ticket/626DTestCase.php @@ -7,7 +7,7 @@ * @author Tamcy <7am.online@gmail.com> * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Ticket/638TestCase.php b/tests_old/Ticket/638TestCase.php index f400291a2..8ef392d6d 100644 --- a/tests_old/Ticket/638TestCase.php +++ b/tests_old/Ticket/638TestCase.php @@ -7,7 +7,7 @@ * @author Tamcy <7am.online@gmail.com> * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Ticket/642TestCase.php b/tests_old/Ticket/642TestCase.php index 93cab5902..bc694d9c7 100644 --- a/tests_old/Ticket/642TestCase.php +++ b/tests_old/Ticket/642TestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Guilherme Blanco * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Ticket/673TestCase.php b/tests_old/Ticket/673TestCase.php index 681fdd485..c324e3672 100644 --- a/tests_old/Ticket/673TestCase.php +++ b/tests_old/Ticket/673TestCase.php @@ -7,7 +7,7 @@ * @author Tamcy <7am.online@gmail.com> * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Ticket/697TestCase.php b/tests_old/Ticket/697TestCase.php index 5a514c2fd..c66335af4 100644 --- a/tests_old/Ticket/697TestCase.php +++ b/tests_old/Ticket/697TestCase.php @@ -5,7 +5,7 @@ * @package Doctrine * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Ticket/749TestCase.php b/tests_old/Ticket/749TestCase.php index 35c757091..98fa153da 100644 --- a/tests_old/Ticket/749TestCase.php +++ b/tests_old/Ticket/749TestCase.php @@ -6,7 +6,7 @@ * @author David Brewer * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * diff --git a/tests_old/Ticket/NjeroTestCase.php b/tests_old/Ticket/NjeroTestCase.php index c32137140..322bef4cb 100644 --- a/tests_old/Ticket/NjeroTestCase.php +++ b/tests_old/Ticket/NjeroTestCase.php @@ -6,7 +6,7 @@ * @author Jeff Rafter * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/TokenizerTestCase.php b/tests_old/TokenizerTestCase.php index d4179ab31..26e0f3020 100644 --- a/tests_old/TokenizerTestCase.php +++ b/tests_old/TokenizerTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @package Doctrine * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 1181 $ * @author Konsta Vesterinen diff --git a/tests_old/Transaction/FirebirdTestCase.php b/tests_old/Transaction/FirebirdTestCase.php index dc3f78831..6e67c3ea6 100644 --- a/tests_old/Transaction/FirebirdTestCase.php +++ b/tests_old/Transaction/FirebirdTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Transaction/InformixTestCase.php b/tests_old/Transaction/InformixTestCase.php index b0b88e886..aadb930a0 100644 --- a/tests_old/Transaction/InformixTestCase.php +++ b/tests_old/Transaction/InformixTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Transaction/MssqlTestCase.php b/tests_old/Transaction/MssqlTestCase.php index bca3944be..0200677dd 100644 --- a/tests_old/Transaction/MssqlTestCase.php +++ b/tests_old/Transaction/MssqlTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Transaction/MysqlTestCase.php b/tests_old/Transaction/MysqlTestCase.php index 873f89a9e..6d7efa6cb 100644 --- a/tests_old/Transaction/MysqlTestCase.php +++ b/tests_old/Transaction/MysqlTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Transaction/OracleTestCase.php b/tests_old/Transaction/OracleTestCase.php index 59a914c28..768a5b8d2 100644 --- a/tests_old/Transaction/OracleTestCase.php +++ b/tests_old/Transaction/OracleTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Transaction/PgsqlTestCase.php b/tests_old/Transaction/PgsqlTestCase.php index 3d1e80161..7df34991f 100644 --- a/tests_old/Transaction/PgsqlTestCase.php +++ b/tests_old/Transaction/PgsqlTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Transaction/SqliteTestCase.php b/tests_old/Transaction/SqliteTestCase.php index 4d937dc59..40b7dc003 100644 --- a/tests_old/Transaction/SqliteTestCase.php +++ b/tests_old/Transaction/SqliteTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/TransactionTestCase.php b/tests_old/TransactionTestCase.php index 066c80caa..1e61caba3 100644 --- a/tests_old/TransactionTestCase.php +++ b/tests_old/TransactionTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/TreeStructureTestCase.php b/tests_old/TreeStructureTestCase.php index 1101fd788..3109a16ea 100644 --- a/tests_old/TreeStructureTestCase.php +++ b/tests_old/TreeStructureTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/UnitOfWorkTestCase.php b/tests_old/UnitOfWorkTestCase.php index 11c475caa..9310607a7 100644 --- a/tests_old/UnitOfWorkTestCase.php +++ b/tests_old/UnitOfWorkTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Validator/FutureTestCase.php b/tests_old/Validator/FutureTestCase.php index db0532d4e..653cd9586 100644 --- a/tests_old/Validator/FutureTestCase.php +++ b/tests_old/Validator/FutureTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Roman Borschel * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/Validator/PastTestCase.php b/tests_old/Validator/PastTestCase.php index 7afb7f019..6e1f17a6a 100644 --- a/tests_old/Validator/PastTestCase.php +++ b/tests_old/Validator/PastTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Roman Borschel * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/ValidatorTestCase.php b/tests_old/ValidatorTestCase.php index 0d4085177..22b2504b2 100644 --- a/tests_old/ValidatorTestCase.php +++ b/tests_old/ValidatorTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -29,7 +29,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/ViewTestCase.php b/tests_old/ViewTestCase.php index 03eac75cb..3fb0ba8b1 100644 --- a/tests_old/ViewTestCase.php +++ b/tests_old/ViewTestCase.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tests_old/coverage/Doctrine.html b/tests_old/coverage/Doctrine.html index 56c22bc37..0dcd5b840 100644 --- a/tests_old/coverage/Doctrine.html +++ b/tests_old/coverage/Doctrine.html @@ -64,7 +64,7 @@  * and is licensed under the LGPL. For more information, see 19 - * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>. 20  */ @@ -97,7 +97,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL 30 - * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org 31  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Access.html b/tests_old/coverage/Doctrine_Access.html index 9ca1e1c7c..e6166c33f 100644 --- a/tests_old/coverage/Doctrine_Access.html +++ b/tests_old/coverage/Doctrine_Access.html @@ -10,462 +10,462 @@

Coverage for Doctrine_Access

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: Access.php 3189 2007-11-18 20:37:44Z meus $ + *  $Id: Access.php 3189 2007-11-18 20:37:44Z meus $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Access + * Doctrine_Access
24 * + *
25 * the purpose of Doctrine_Access is to provice array access + * the purpose of Doctrine_Access is to provice array access
26 * and property overload interface for subclasses + * and property overload interface for subclasses
27 * + *
28 * @package     Doctrine + * @package     Doctrine
29 * @subpackage  Access + * @subpackage  Access
30 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
31 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
32 * @since       1.0 + * @since       1.0
33 * @version     $Revision: 3189 $ + * @version     $Revision: 3189 $
34 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
35 */ + */
36abstract class Doctrine_Access extends Doctrine_Locator_Injectable implements ArrayAccess +abstract class Doctrine_Access extends Doctrine_Locator_Injectable implements ArrayAccess
37{ +{
38    /** +    /**
39     * setArray +     * setArray
40     * +     *
41     * @param array $array          an array of key => value pairs +     * @param array $array          an array of key => value pairs
42     * @since 1.0 +     * @since 1.0
43     * @return Doctrine_Access +     * @return Doctrine_Access
44     */ +     */
45    public function setArray(array $array) +    public function setArray(array $array)
46    { +    {
47        foreach ($array as $k=>$v) { +        foreach ($array as $k=>$v) {
48            $this->set($k,$v); +            $this->set($k,$v);
49        } +        }
50 +
51        return $this; +        return $this;
52    } +    }
53 +
54    /** +    /**
55     * __set        an alias of set() +     * __set        an alias of set()
56     * +     *
57     * @see set, offsetSet +     * @see set, offsetSet
58     * @param $name +     * @param $name
59     * @param $value +     * @param $value
60     * @since 1.0 +     * @since 1.0
61     * @return void +     * @return void
62     */ +     */
63    public function __set($name,$value) +    public function __set($name,$value)
64    { +    {
65        $this->set($name,$value); +        $this->set($name,$value);
66    } +    }
67 +
68    /** +    /**
69     * __get -- an alias of get() +     * __get -- an alias of get()
70     * +     *
71     * @see get,  offsetGet +     * @see get,  offsetGet
72     * @param mixed $name +     * @param mixed $name
73     * @since 1.0 +     * @since 1.0
74     * @return mixed +     * @return mixed
75     */ +     */
76    public function __get($name) +    public function __get($name)
77    { +    {
78        return $this->get($name); +        return $this->get($name);
79    } +    }
80 +
81    /** +    /**
82     * __isset() +     * __isset()
83     * +     *
84     * @param string $name +     * @param string $name
85     * @since 1.0 +     * @since 1.0
86     * @return boolean          whether or not this object contains $name +     * @return boolean          whether or not this object contains $name
87     */ +     */
88    public function __isset($name) +    public function __isset($name)
89    { +    {
90        return $this->contains($name); +        return $this->contains($name);
91    } +    }
92 +
93    /** +    /**
94     * __unset() +     * __unset()
95     * +     *
96     * @param string $name +     * @param string $name
97     * @since 1.0 +     * @since 1.0
98     * @return void +     * @return void
99     */ +     */
100    public function __unset($name) +    public function __unset($name)
101    { +    {
102        return $this->remove($name); +        return $this->remove($name);
103    } +    }
104 +
105    /** +    /**
106     * Check if an offsetExists. Alias for contains. +     * Check if an offsetExists. Alias for contains.
107     * +     *
108     * @param mixed $offset +     * @param mixed $offset
109     * @return boolean          whether or not this object contains $offset +     * @return boolean          whether or not this object contains $offset
110     */ +     */
111    public function offsetExists($offset) +    public function offsetExists($offset)
112    { +    {
113        return $this->contains($offset); +        return $this->contains($offset);
114    } +    }
115 +
116    /** +    /**
117     * offsetGet    an alias of get() +     * offsetGet    an alias of get()
118     * +     *
119     * @see get,  __get +     * @see get,  __get
120     * @param mixed $offset +     * @param mixed $offset
121     * @return mixed +     * @return mixed
122     */ +     */
123    public function offsetGet($offset) +    public function offsetGet($offset)
124    { +    {
125        return $this->get($offset); +        return $this->get($offset);
126    } +    }
127 +
128    /** +    /**
129     * sets $offset to $value +     * sets $offset to $value
130     * @see set,  __set +     * @see set,  __set
131     * @param mixed $offset +     * @param mixed $offset
132     * @param mixed $value +     * @param mixed $value
133     * @return void +     * @return void
134     */ +     */
135    public function offsetSet($offset, $value) +    public function offsetSet($offset, $value)
136    { +    {
137        if ( ! isset($offset)) { +        if ( ! isset($offset)) {
138            $this->add($value); +            $this->add($value);
139        } else { +        } else {
140            $this->set($offset, $value); +            $this->set($offset, $value);
141        } +        }
142    } +    }
143 +
144    /** +    /**
145     * unset a given offset +     * unset a given offset
146     * @see set, offsetSet, __set +     * @see set, offsetSet, __set
147     * @param mixed $offset +     * @param mixed $offset
148     */ +     */
149    public function offsetUnset($offset) +    public function offsetUnset($offset)
150    { +    {
151        return $this->remove($offset); +        return $this->remove($offset);
152    } +    }
153} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Adapter_Mock.html b/tests_old/coverage/Doctrine_Adapter_Mock.html index 9d54c6ec9..34b82dc30 100644 --- a/tests_old/coverage/Doctrine_Adapter_Mock.html +++ b/tests_old/coverage/Doctrine_Adapter_Mock.html @@ -10,489 +10,489 @@

Coverage for Doctrine_Adapter_Mock

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: Mock.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Mock.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Adapter_Mock + * Doctrine_Adapter_Mock
24 * This class is used for special testing purposes. + * This class is used for special testing purposes.
25 * + *
26 * @package     Doctrine + * @package     Doctrine
27 * @subpackage  Adapter + * @subpackage  Adapter
28 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
29 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31 * @since       1.0 + * @since       1.0
32 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
33 */ + */
34class Doctrine_Adapter_Mock implements Doctrine_Adapter_Interface, Countable +class Doctrine_Adapter_Mock implements Doctrine_Adapter_Interface, Countable
35{ +{
36    private $name; +    private $name;
37     +    
38    private $queries = array(); +    private $queries = array();
39     +    
40    private $exception = array(); +    private $exception = array();
41     +    
42    private $lastInsertIdFail = false; +    private $lastInsertIdFail = false;
43 +
44    public function __construct($name = null)  +    public function __construct($name = null) 
45    { +    {
46        $this->name = $name; +        $this->name = $name;
47    } +    }
48    public function getName()  +    public function getName() 
49    { +    {
50        return $this->name; +        return $this->name;
51    } +    }
52    public function pop()  +    public function pop() 
53    { +    {
54        return array_pop($this->queries); +        return array_pop($this->queries);
55    } +    }
56    public function forceException($name, $message = '', $code = 0)  +    public function forceException($name, $message = '', $code = 0) 
57    { +    {
58        $this->exception = array($name, $message, $code); +        $this->exception = array($name, $message, $code);
59    } +    }
60    public function prepare($query) +    public function prepare($query)
61    { +    {
62        $mock = new Doctrine_Adapter_Statement_Mock($this, $query); +        $mock = new Doctrine_Adapter_Statement_Mock($this, $query);
63        $mock->queryString = $query; +        $mock->queryString = $query;
64         +        
65        return $mock; +        return $mock;
66    } +    }
67    public function addQuery($query) +    public function addQuery($query)
68    { +    {
69        $this->queries[] = $query; +        $this->queries[] = $query;
70    } +    }
71    public function query($query)  +    public function query($query) 
72    { +    {
73        $this->queries[] = $query; +        $this->queries[] = $query;
74 +
75        $e    = $this->exception; +        $e    = $this->exception;
76 +
77        if ( ! empty($e)) { +        if ( ! empty($e)) {
78            $name = $e[0]; +            $name = $e[0];
79 +
80            $this->exception = array(); +            $this->exception = array();
81 +
82            throw new $name($e[1], $e[2]); +            throw new $name($e[1], $e[2]);
83        } +        }
84 +
85        $stmt = new Doctrine_Adapter_Statement_Mock($this, $query); +        $stmt = new Doctrine_Adapter_Statement_Mock($this, $query);
86        $stmt->queryString = $query; +        $stmt->queryString = $query;
87         +        
88        return $stmt; +        return $stmt;
89    } +    }
90    public function getAll()  +    public function getAll() 
91    { +    {
92        return $this->queries; +        return $this->queries;
93    } +    }
94    public function quote($input)  +    public function quote($input) 
95    { +    {
96        return "'" . addslashes($input) . "'"; +        return "'" . addslashes($input) . "'";
97    } +    }
98    public function exec($statement)  +    public function exec($statement) 
99    { +    {
100        $this->queries[] = $statement; +        $this->queries[] = $statement;
101 +
102        $e    = $this->exception; +        $e    = $this->exception;
103 +
104        if ( ! empty($e)) { +        if ( ! empty($e)) {
105            $name = $e[0]; +            $name = $e[0];
106 +
107            $this->exception = array(); +            $this->exception = array();
108 +
109            throw new $name($e[1], $e[2]); +            throw new $name($e[1], $e[2]);
110        } +        }
111 +
112        return 0; +        return 0;
113    } +    }
114    public function forceLastInsertIdFail($fail = true)  +    public function forceLastInsertIdFail($fail = true) 
115    { +    {
116        if ($fail) { +        if ($fail) {
117            $this->lastInsertIdFail = true; +            $this->lastInsertIdFail = true;
118        } else { +        } else {
119            $this->lastInsertIdFail = false; +            $this->lastInsertIdFail = false;
120        } +        }
121    } +    }
122    public function lastInsertId() +    public function lastInsertId()
123    { +    {
124        $this->queries[] = 'LAST_INSERT_ID()'; +        $this->queries[] = 'LAST_INSERT_ID()';
125        if ($this->lastInsertIdFail) { +        if ($this->lastInsertIdFail) {
126            return null; +            return null;
127        } else { +        } else {
128            return 1; +            return 1;
129        } +        }
130    } +    }
131    public function count()  +    public function count() 
132    { +    {
133        return count($this->queries);     +        return count($this->queries);    
134    } +    }
135    public function beginTransaction() +    public function beginTransaction()
136    { +    {
137        $this->queries[] = 'BEGIN TRANSACTION'; +        $this->queries[] = 'BEGIN TRANSACTION';
138    } +    }
139    public function commit() +    public function commit()
140    { +    {
141        $this->queries[] = 'COMMIT'; +        $this->queries[] = 'COMMIT';
142    } +    }
143    public function rollBack()  +    public function rollBack() 
144    { +    {
145        $this->queries[] = 'ROLLBACK'; +        $this->queries[] = 'ROLLBACK';
146    } +    }
147    public function errorCode()  +    public function errorCode() 
148    { } +    { }
149    public function errorInfo() +    public function errorInfo()
150    { } +    { }
151    public function getAttribute($attribute)  +    public function getAttribute($attribute) 
152    { +    {
153        if ($attribute == Doctrine::ATTR_DRIVER_NAME) +        if ($attribute == Doctrine::ATTR_DRIVER_NAME)
154            return strtolower($this->name); +            return strtolower($this->name);
155    } +    }
156    public function setAttribute($attribute, $value)  +    public function setAttribute($attribute, $value) 
157    { +    {
158                                        +                                       
159    } +    }
160    public function sqliteCreateFunction() +    public function sqliteCreateFunction()
161    { } +    { }
162} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Adapter_Statement_Mock.html b/tests_old/coverage/Doctrine_Adapter_Statement_Mock.html index 61f4667c4..00edb1871 100644 --- a/tests_old/coverage/Doctrine_Adapter_Statement_Mock.html +++ b/tests_old/coverage/Doctrine_Adapter_Statement_Mock.html @@ -10,1050 +10,1050 @@

Coverage for Doctrine_Adapter_Statement_Mock

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: Mock.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Mock.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Adapter_Statement_Mock + * Doctrine_Adapter_Statement_Mock
24 * This class is used for special testing purposes. + * This class is used for special testing purposes.
25 * + *
26 * @package     Doctrine + * @package     Doctrine
27 * @subpackage  Adapter + * @subpackage  Adapter
28 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
29 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31 * @since       1.0 + * @since       1.0
32 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
33 */ + */
34class Doctrine_Adapter_Statement_Mock implements Doctrine_Adapter_Statement_Interface +class Doctrine_Adapter_Statement_Mock implements Doctrine_Adapter_Statement_Interface
35{ +{
36    private $mock; +    private $mock;
37     +    
38    public $queryString; +    public $queryString;
39 +
40    public function __construct($mock) +    public function __construct($mock)
41    { +    {
42        $this->mock  = $mock; +        $this->mock  = $mock;
43    } +    }
44 +
45    /** +    /**
46     * bindColumn +     * bindColumn
47     * Bind a column to a PHP variable +     * Bind a column to a PHP variable
48     * +     *
49     * @param mixed $column         Number of the column (1-indexed) or name of the column in the result set. +     * @param mixed $column         Number of the column (1-indexed) or name of the column in the result set.
50     *                              If using the column name, be aware that the name should match +     *                              If using the column name, be aware that the name should match
51     *                              the case of the column, as returned by the driver. +     *                              the case of the column, as returned by the driver.
52     * @param string $param         Name of the PHP variable to which the column will be bound. +     * @param string $param         Name of the PHP variable to which the column will be bound.
53     * @param integer $type         Data type of the parameter, specified by the Doctrine::PARAM_* constants. +     * @param integer $type         Data type of the parameter, specified by the Doctrine::PARAM_* constants.
54     * @return boolean              Returns TRUE on success or FALSE on failure +     * @return boolean              Returns TRUE on success or FALSE on failure
55     */ +     */
56    public function bindColumn($column, $param, $type = null) +    public function bindColumn($column, $param, $type = null)
57    { +    {
58         +        
59    } +    }
60 +
61    /** +    /**
62     * bindValue +     * bindValue
63     * Binds a value to a corresponding named or question mark  +     * Binds a value to a corresponding named or question mark 
64     * placeholder in the SQL statement that was use to prepare the statement. +     * placeholder in the SQL statement that was use to prepare the statement.
65     * +     *
66     * @param mixed $param          Parameter identifier. For a prepared statement using named placeholders, +     * @param mixed $param          Parameter identifier. For a prepared statement using named placeholders,
67     *                              this will be a parameter name of the form :name. For a prepared statement +     *                              this will be a parameter name of the form :name. For a prepared statement
68     *                              using question mark placeholders, this will be the 1-indexed position of the parameter +     *                              using question mark placeholders, this will be the 1-indexed position of the parameter
69     * +     *
70     * @param mixed $value          The value to bind to the parameter. +     * @param mixed $value          The value to bind to the parameter.
71     * @param integer $type         Explicit data type for the parameter using the Doctrine::PARAM_* constants. +     * @param integer $type         Explicit data type for the parameter using the Doctrine::PARAM_* constants.
72     * +     *
73     * @return boolean              Returns TRUE on success or FALSE on failure. +     * @return boolean              Returns TRUE on success or FALSE on failure.
74     */ +     */
75    public function bindValue($param, $value, $type = null) +    public function bindValue($param, $value, $type = null)
76    { +    {
77         +        
78    } +    }
79 +
80    /** +    /**
81     * bindParam +     * bindParam
82     * Binds a PHP variable to a corresponding named or question mark placeholder in the  +     * Binds a PHP variable to a corresponding named or question mark placeholder in the 
83     * SQL statement that was use to prepare the statement. Unlike Doctrine_Adapter_Statement_Interface->bindValue(), +     * SQL statement that was use to prepare the statement. Unlike Doctrine_Adapter_Statement_Interface->bindValue(),
84     * the variable is bound as a reference and will only be evaluated at the time  +     * the variable is bound as a reference and will only be evaluated at the time 
85     * that Doctrine_Adapter_Statement_Interface->execute() is called. +     * that Doctrine_Adapter_Statement_Interface->execute() is called.
86     * +     *
87     * Most parameters are input parameters, that is, parameters that are  +     * Most parameters are input parameters, that is, parameters that are 
88     * used in a read-only fashion to build up the query. Some drivers support the invocation  +     * used in a read-only fashion to build up the query. Some drivers support the invocation 
89     * of stored procedures that return data as output parameters, and some also as input/output +     * of stored procedures that return data as output parameters, and some also as input/output
90     * parameters that both send in data and are updated to receive it. +     * parameters that both send in data and are updated to receive it.
91     * +     *
92     * @param mixed $param          Parameter identifier. For a prepared statement using named placeholders, +     * @param mixed $param          Parameter identifier. For a prepared statement using named placeholders,
93     *                              this will be a parameter name of the form :name. For a prepared statement +     *                              this will be a parameter name of the form :name. For a prepared statement
94     *                              using question mark placeholders, this will be the 1-indexed position of the parameter +     *                              using question mark placeholders, this will be the 1-indexed position of the parameter
95     * +     *
96     * @param mixed $variable       Name of the PHP variable to bind to the SQL statement parameter. +     * @param mixed $variable       Name of the PHP variable to bind to the SQL statement parameter.
97     * +     *
98     * @param integer $type         Explicit data type for the parameter using the Doctrine::PARAM_* constants. To return +     * @param integer $type         Explicit data type for the parameter using the Doctrine::PARAM_* constants. To return
99     *                              an INOUT parameter from a stored procedure, use the bitwise OR operator to set the +     *                              an INOUT parameter from a stored procedure, use the bitwise OR operator to set the
100     *                              Doctrine::PARAM_INPUT_OUTPUT bits for the data_type parameter. +     *                              Doctrine::PARAM_INPUT_OUTPUT bits for the data_type parameter.
101     * +     *
102     * @param integer $length       Length of the data type. To indicate that a parameter is an OUT parameter +     * @param integer $length       Length of the data type. To indicate that a parameter is an OUT parameter
103     *                              from a stored procedure, you must explicitly set the length. +     *                              from a stored procedure, you must explicitly set the length.
104     * @param mixed $driverOptions +     * @param mixed $driverOptions
105     * @return boolean              Returns TRUE on success or FALSE on failure. +     * @return boolean              Returns TRUE on success or FALSE on failure.
106     */ +     */
107    public function bindParam($column, &$variable, $type = null, $length = null, $driverOptions = array()) +    public function bindParam($column, &$variable, $type = null, $length = null, $driverOptions = array())
108    { +    {
109         +        
110    } +    }
111 +
112    /** +    /**
113     * closeCursor +     * closeCursor
114     * Closes the cursor, enabling the statement to be executed again. +     * Closes the cursor, enabling the statement to be executed again.
115     * +     *
116     * @return boolean              Returns TRUE on success or FALSE on failure. +     * @return boolean              Returns TRUE on success or FALSE on failure.
117     */ +     */
118    public function closeCursor() +    public function closeCursor()
119    { +    {
120        return true; +        return true;
121    } +    }
122 +
123    /**  +    /** 
124     * columnCount +     * columnCount
125     * Returns the number of columns in the result set  +     * Returns the number of columns in the result set 
126     * +     *
127     * @return integer              Returns the number of columns in the result set represented +     * @return integer              Returns the number of columns in the result set represented
128     *                              by the Doctrine_Adapter_Statement_Interface object. If there is no result set, +     *                              by the Doctrine_Adapter_Statement_Interface object. If there is no result set,
129     *                              this method should return 0. +     *                              this method should return 0.
130     */ +     */
131    public function columnCount() +    public function columnCount()
132    { +    {
133        return 0;         +        return 0;        
134    } +    }
135 +
136    /** +    /**
137     * errorCode +     * errorCode
138     * Fetch the SQLSTATE associated with the last operation on the statement handle  +     * Fetch the SQLSTATE associated with the last operation on the statement handle 
139     * +     *
140     * @see Doctrine_Adapter_Interface::errorCode() +     * @see Doctrine_Adapter_Interface::errorCode()
141     * @return string       error code string +     * @return string       error code string
142     */ +     */
143    public function errorCode() +    public function errorCode()
144    { +    {
145        return array(); +        return array();
146    } +    }
147 +
148    /** +    /**
149     * errorInfo +     * errorInfo
150     * Fetch extended error information associated with the last operation on the statement handle +     * Fetch extended error information associated with the last operation on the statement handle
151     * +     *
152     * @see Doctrine_Adapter_Interface::errorInfo() +     * @see Doctrine_Adapter_Interface::errorInfo()
153     * @return array        error info array +     * @return array        error info array
154     */ +     */
155    public function errorInfo() +    public function errorInfo()
156    {  +    { 
157        return array(); +        return array();
158    } +    }
159 +
160    /** +    /**
161     * fetch +     * fetch
162     * +     *
163     * @see Doctrine::FETCH_* constants +     * @see Doctrine::FETCH_* constants
164     * @param integer $fetchStyle           Controls how the next row will be returned to the caller. +     * @param integer $fetchStyle           Controls how the next row will be returned to the caller.
165     *                                      This value must be one of the Doctrine::FETCH_* constants, +     *                                      This value must be one of the Doctrine::FETCH_* constants,
166     *                                      defaulting to Doctrine::FETCH_BOTH +     *                                      defaulting to Doctrine::FETCH_BOTH
167     * +     *
168     * @param integer $cursorOrientation    For a PDOStatement object representing a scrollable cursor,  +     * @param integer $cursorOrientation    For a PDOStatement object representing a scrollable cursor, 
169     *                                      this value determines which row will be returned to the caller.  +     *                                      this value determines which row will be returned to the caller. 
170     *                                      This value must be one of the Doctrine::FETCH_ORI_* constants, defaulting to +     *                                      This value must be one of the Doctrine::FETCH_ORI_* constants, defaulting to
171     *                                      Doctrine::FETCH_ORI_NEXT. To request a scrollable cursor for your  +     *                                      Doctrine::FETCH_ORI_NEXT. To request a scrollable cursor for your 
172     *                                      Doctrine_Adapter_Statement_Interface object, +     *                                      Doctrine_Adapter_Statement_Interface object,
173     *                                      you must set the Doctrine::ATTR_CURSOR attribute to Doctrine::CURSOR_SCROLL when you +     *                                      you must set the Doctrine::ATTR_CURSOR attribute to Doctrine::CURSOR_SCROLL when you
174     *                                      prepare the SQL statement with Doctrine_Adapter_Interface->prepare(). +     *                                      prepare the SQL statement with Doctrine_Adapter_Interface->prepare().
175     * +     *
176     * @param integer $cursorOffset         For a Doctrine_Adapter_Statement_Interface object representing a scrollable cursor for which the +     * @param integer $cursorOffset         For a Doctrine_Adapter_Statement_Interface object representing a scrollable cursor for which the
177     *                                      $cursorOrientation parameter is set to Doctrine::FETCH_ORI_ABS, this value specifies +     *                                      $cursorOrientation parameter is set to Doctrine::FETCH_ORI_ABS, this value specifies
178     *                                      the absolute number of the row in the result set that shall be fetched. +     *                                      the absolute number of the row in the result set that shall be fetched.
179     *                                       +     *                                      
180     *                                      For a Doctrine_Adapter_Statement_Interface object representing a scrollable cursor for  +     *                                      For a Doctrine_Adapter_Statement_Interface object representing a scrollable cursor for 
181     *                                      which the $cursorOrientation parameter is set to Doctrine::FETCH_ORI_REL, this value  +     *                                      which the $cursorOrientation parameter is set to Doctrine::FETCH_ORI_REL, this value 
182     *                                      specifies the row to fetch relative to the cursor position before  +     *                                      specifies the row to fetch relative to the cursor position before 
183     *                                      Doctrine_Adapter_Statement_Interface->fetch() was called. +     *                                      Doctrine_Adapter_Statement_Interface->fetch() was called.
184     * +     *
185     * @return mixed +     * @return mixed
186     */ +     */
187    public function fetch($fetchStyle = Doctrine::FETCH_BOTH, +    public function fetch($fetchStyle = Doctrine::FETCH_BOTH,
188                          $cursorOrientation = Doctrine::FETCH_ORI_NEXT, +                          $cursorOrientation = Doctrine::FETCH_ORI_NEXT,
189                          $cursorOffset = null) +                          $cursorOffset = null)
190    { +    {
191        return array(); +        return array();
192    } +    }
193 +
194    /** +    /**
195     * fetchAll +     * fetchAll
196     * Returns an array containing all of the result set rows +     * Returns an array containing all of the result set rows
197     * +     *
198     * @param integer $fetchStyle           Controls how the next row will be returned to the caller. +     * @param integer $fetchStyle           Controls how the next row will be returned to the caller.
199     *                                      This value must be one of the Doctrine::FETCH_* constants, +     *                                      This value must be one of the Doctrine::FETCH_* constants,
200     *                                      defaulting to Doctrine::FETCH_BOTH +     *                                      defaulting to Doctrine::FETCH_BOTH
201     * +     *
202     * @param integer $columnIndex          Returns the indicated 0-indexed column when the value of $fetchStyle is +     * @param integer $columnIndex          Returns the indicated 0-indexed column when the value of $fetchStyle is
203     *                                      Doctrine::FETCH_COLUMN. Defaults to 0. +     *                                      Doctrine::FETCH_COLUMN. Defaults to 0.
204     * +     *
205     * @return array +     * @return array
206     */ +     */
207    public function fetchAll($fetchMode = Doctrine::FETCH_BOTH) +    public function fetchAll($fetchMode = Doctrine::FETCH_BOTH)
208    { +    {
209        return array(); +        return array();
210    } +    }
211 +
212    /** +    /**
213     * execute +     * execute
214     * Executes a prepared statement +     * Executes a prepared statement
215     * +     *
216     * If the prepared statement included parameter markers, you must either: +     * If the prepared statement included parameter markers, you must either:
217     * call PDOStatement->bindParam() to bind PHP variables to the parameter markers: +     * call PDOStatement->bindParam() to bind PHP variables to the parameter markers:
218     * bound variables pass their value as input and receive the output value, +     * bound variables pass their value as input and receive the output value,
219     * if any, of their associated parameter markers or pass an array of input-only +     * if any, of their associated parameter markers or pass an array of input-only
220     * parameter values +     * parameter values
221     * +     *
222     * +     *
223     * @param array $params             An array of values with as many elements as there are +     * @param array $params             An array of values with as many elements as there are
224     *                                  bound parameters in the SQL statement being executed. +     *                                  bound parameters in the SQL statement being executed.
225     * @return boolean                  Returns TRUE on success or FALSE on failure. +     * @return boolean                  Returns TRUE on success or FALSE on failure.
226     */ +     */
227    public function execute($params = null) +    public function execute($params = null)
228    { +    {
229        if (is_object($this->mock)) { +        if (is_object($this->mock)) {
230            $this->mock->addQuery($this->queryString); +            $this->mock->addQuery($this->queryString);
231        } +        }
232        return true; +        return true;
233    } +    }
234 +
235    /** +    /**
236     * fetchColumn +     * fetchColumn
237     * Returns a single column from the next row of a +     * Returns a single column from the next row of a
238     * result set or FALSE if there are no more rows. +     * result set or FALSE if there are no more rows.
239     * +     *
240     * @param integer $columnIndex          0-indexed number of the column you wish to retrieve from the row. If no  +     * @param integer $columnIndex          0-indexed number of the column you wish to retrieve from the row. If no 
241     *                                      value is supplied, Doctrine_Adapter_Statement_Interface->fetchColumn()  +     *                                      value is supplied, Doctrine_Adapter_Statement_Interface->fetchColumn() 
242     *                                      fetches the first column. +     *                                      fetches the first column.
243     * +     *
244     * @return string                       returns a single column in the next row of a result set. +     * @return string                       returns a single column in the next row of a result set.
245     */ +     */
246    public function fetchColumn($columnIndex = 0) +    public function fetchColumn($columnIndex = 0)
247    { +    {
248        return 0; +        return 0;
249    } +    }
250 +
251    /** +    /**
252     * fetchObject +     * fetchObject
253     * Fetches the next row and returns it as an object. +     * Fetches the next row and returns it as an object.
254     * +     *
255     * Fetches the next row and returns it as an object. This function is an alternative to  +     * Fetches the next row and returns it as an object. This function is an alternative to 
256     * Doctrine_Adapter_Statement_Interface->fetch() with Doctrine::FETCH_CLASS or Doctrine::FETCH_OBJ style. +     * Doctrine_Adapter_Statement_Interface->fetch() with Doctrine::FETCH_CLASS or Doctrine::FETCH_OBJ style.
257     * +     *
258     * @param string $className             Name of the created class, defaults to stdClass.  +     * @param string $className             Name of the created class, defaults to stdClass. 
259     * @param array $args                   Elements of this array are passed to the constructor. +     * @param array $args                   Elements of this array are passed to the constructor.
260     * +     *
261     * @return mixed                        an instance of the required class with property names that correspond  +     * @return mixed                        an instance of the required class with property names that correspond 
262     *                                      to the column names or FALSE in case of an error. +     *                                      to the column names or FALSE in case of an error.
263     */ +     */
264    public function fetchObject($className = 'stdClass', $args = array())  +    public function fetchObject($className = 'stdClass', $args = array()) 
265    { +    {
266        return new $className(); +        return new $className();
267    } +    }
268 +
269    /** +    /**
270     * nextRowset +     * nextRowset
271     * Advances to the next rowset in a multi-rowset statement handle +     * Advances to the next rowset in a multi-rowset statement handle
272     *  +     * 
273     * Some database servers support stored procedures that return more than one rowset  +     * Some database servers support stored procedures that return more than one rowset 
274     * (also known as a result set). The nextRowset() method enables you to access the second  +     * (also known as a result set). The nextRowset() method enables you to access the second 
275     * and subsequent rowsets associated with a PDOStatement object. Each rowset can have a  +     * and subsequent rowsets associated with a PDOStatement object. Each rowset can have a 
276     * different set of columns from the preceding rowset. +     * different set of columns from the preceding rowset.
277     * +     *
278     * @return boolean                      Returns TRUE on success or FALSE on failure. +     * @return boolean                      Returns TRUE on success or FALSE on failure.
279     */ +     */
280    public function nextRowset() +    public function nextRowset()
281    { +    {
282        return true; +        return true;
283    } +    }
284 +
285    /** +    /**
286     * rowCount +     * rowCount
287     * rowCount() returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement  +     * rowCount() returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement 
288     * executed by the corresponding object. +     * executed by the corresponding object.
289     * +     *
290     * If the last SQL statement executed by the associated Statement object was a SELECT statement,  +     * If the last SQL statement executed by the associated Statement object was a SELECT statement, 
291     * some databases may return the number of rows returned by that statement. However,  +     * some databases may return the number of rows returned by that statement. However, 
292     * this behaviour is not guaranteed for all databases and should not be  +     * this behaviour is not guaranteed for all databases and should not be 
293     * relied on for portable applications. +     * relied on for portable applications.
294     * +     *
295     * @return integer                      Returns the number of rows. +     * @return integer                      Returns the number of rows.
296     */ +     */
297    public function rowCount() +    public function rowCount()
298    {  +    { 
299        return 0; +        return 0;
300    } +    }
301 +
302    /** +    /**
303     * getColumnMeta +     * getColumnMeta
304     * Returns metadata for a column in a result set +     * Returns metadata for a column in a result set
305     * +     *
306     * @param integer $column               The 0-indexed column in the result set. +     * @param integer $column               The 0-indexed column in the result set.
307     * +     *
308     * @return array                        Associative meta data array with the following structure: +     * @return array                        Associative meta data array with the following structure:
309     * +     *
310     *          native_type                 The PHP native type used to represent the column value. +     *          native_type                 The PHP native type used to represent the column value.
311     *          driver:decl_                type The SQL type used to represent the column value in the database. If the column in the result set is the result of a function, this value is not returned by PDOStatement->getColumnMeta(). +     *          driver:decl_                type The SQL type used to represent the column value in the database. If the column in the result set is the result of a function, this value is not returned by PDOStatement->getColumnMeta().
312     *          flags                       Any flags set for this column. +     *          flags                       Any flags set for this column.
313     *          name                        The name of this column as returned by the database. +     *          name                        The name of this column as returned by the database.
314     *          len                         The length of this column. Normally -1 for types other than floating point decimals. +     *          len                         The length of this column. Normally -1 for types other than floating point decimals.
315     *          precision                   The numeric precision of this column. Normally 0 for types other than floating point decimals. +     *          precision                   The numeric precision of this column. Normally 0 for types other than floating point decimals.
316     *          pdo_type                    The type of this column as represented by the PDO::PARAM_* constants. +     *          pdo_type                    The type of this column as represented by the PDO::PARAM_* constants.
317     */ +     */
318    public function getColumnMeta($column) +    public function getColumnMeta($column)
319    { } +    { }
320    /** +    /**
321     * getAttribute +     * getAttribute
322     * Retrieve a statement attribute  +     * Retrieve a statement attribute 
323     * +     *
324     * @param integer $attribute +     * @param integer $attribute
325     * @see Doctrine::ATTR_* constants +     * @see Doctrine::ATTR_* constants
326     * @return mixed                        the attribute value +     * @return mixed                        the attribute value
327     */ +     */
328    public function getAttribute($attribute) +    public function getAttribute($attribute)
329    { } +    { }
330    /** +    /**
331     * setAttribute +     * setAttribute
332     * Set a statement attribute +     * Set a statement attribute
333     * +     *
334     * @param integer $attribute +     * @param integer $attribute
335     * @param mixed $value                  the value of given attribute +     * @param mixed $value                  the value of given attribute
336     * @return boolean                      Returns TRUE on success or FALSE on failure. +     * @return boolean                      Returns TRUE on success or FALSE on failure.
337     */ +     */
338    public function setAttribute($attribute, $value) +    public function setAttribute($attribute, $value)
339    { } +    { }
340    /** +    /**
341     * setFetchMode +     * setFetchMode
342     * Set the default fetch mode for this statement +     * Set the default fetch mode for this statement
343     * +     *
344     * @param integer $mode                 The fetch mode must be one of the Doctrine::FETCH_* constants. +     * @param integer $mode                 The fetch mode must be one of the Doctrine::FETCH_* constants.
345     * @return boolean                      Returns 1 on success or FALSE on failure. +     * @return boolean                      Returns 1 on success or FALSE on failure.
346     */ +     */
347    public function setFetchMode($mode, $arg1 = null, $arg2 = null) +    public function setFetchMode($mode, $arg1 = null, $arg2 = null)
348    { } +    { }
349} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_AuditLog.html b/tests_old/coverage/Doctrine_AuditLog.html index 4edecfa11..20f99fde0 100644 --- a/tests_old/coverage/Doctrine_AuditLog.html +++ b/tests_old/coverage/Doctrine_AuditLog.html @@ -10,366 +10,366 @@

Coverage for Doctrine_AuditLog

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id$ + *  $Id$
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_AuditLog + * Doctrine_AuditLog
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  AuditLog + * @subpackage  AuditLog
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision$ + * @version     $Revision$
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_AuditLog extends Doctrine_Plugin +class Doctrine_AuditLog extends Doctrine_Plugin
34{ +{
35    protected $_options = array( +    protected $_options = array(
36                            'className'     => '%CLASS%Version', +                            'className'     => '%CLASS%Version',
37                            'versionColumn' => 'version', +                            'versionColumn' => 'version',
38                            'generateFiles' => false, +                            'generateFiles' => false,
39                            'table'         => false, +                            'table'         => false,
40                            'pluginTable'   => false, +                            'pluginTable'   => false,
41                            ); +                            );
42 +
43    /** +    /**
44     * Create a new auditlog_  +     * Create a new auditlog_ 
45     *  +     * 
46     * @param array $options An array of options +     * @param array $options An array of options
47     * @return void +     * @return void
48     */ +     */
49    public function __construct(array $options = array()) +    public function __construct(array $options = array())
50    { +    {
51        $this->_options = array_merge($this->_options, $options); +        $this->_options = array_merge($this->_options, $options);
52    } +    }
53 +
54    /** +    /**
55     * Get the version  +     * Get the version 
56     *  +     * 
57     * @param Doctrine_Record $record  +     * @param Doctrine_Record $record 
58     * @param mixed $version  +     * @param mixed $version 
59     * @return array An array with version information +     * @return array An array with version information
60     */ +     */
61    public function getVersion(Doctrine_Record $record, $version) +    public function getVersion(Doctrine_Record $record, $version)
62    {            +    {           
63        $className = $this->_options['className']; +        $className = $this->_options['className'];
64 +
65        $q = new Doctrine_Query(); +        $q = new Doctrine_Query();
66 +
67        $values = array(); +        $values = array();
68        foreach ((array) $this->_options['table']->getIdentifier() as $id) { +        foreach ((array) $this->_options['table']->getIdentifier() as $id) {
69            $conditions[] = $className . '.' . $id . ' = ?'; +            $conditions[] = $className . '.' . $id . ' = ?';
70            $values[] = $record->get($id); +            $values[] = $record->get($id);
71        } +        }
72        $where = implode(' AND ', $conditions) . ' AND ' . $className . '.' . $this->_options['versionColumn'] . ' = ?'; +        $where = implode(' AND ', $conditions) . ' AND ' . $className . '.' . $this->_options['versionColumn'] . ' = ?';
73         +        
74        $values[] = $version; +        $values[] = $version;
75 +
76        $q->from($className) +        $q->from($className)
77          ->where($where); +          ->where($where);
78 +
79        return $q->execute($values, Doctrine::HYDRATE_ARRAY); +        return $q->execute($values, Doctrine::HYDRATE_ARRAY);
80    } +    }
81 +
82    /** +    /**
83     * buildDefinition for a table  +     * buildDefinition for a table 
84     *  +     * 
85     * @param Doctrine_Table $table  +     * @param Doctrine_Table $table 
86     * @return boolean true on success otherwise false. +     * @return boolean true on success otherwise false.
87     */ +     */
88    public function buildDefinition() +    public function buildDefinition()
89    { +    {
90        $name = $this->_options['table']->getComponentName(); +        $name = $this->_options['table']->getComponentName();
91 +
92        $columns = $this->_options['table']->getColumns(); +        $columns = $this->_options['table']->getColumns();
93 +
94        // remove all sequence, autoincrement and unique constraint definitions +        // remove all sequence, autoincrement and unique constraint definitions
95        foreach ($columns as $column => $definition) { +        foreach ($columns as $column => $definition) {
96            unset($columns[$column]['autoincrement']); +            unset($columns[$column]['autoincrement']);
97            unset($columns[$column]['sequence']); +            unset($columns[$column]['sequence']);
98            unset($columns[$column]['unique']); +            unset($columns[$column]['unique']);
99        } +        }
100 +
101        // the version column should be part of the primary key definition +        // the version column should be part of the primary key definition
102        $columns[$this->_options['versionColumn']] = array('type' => 'integer', +        $columns[$this->_options['versionColumn']] = array('type' => 'integer',
103                                                           'length' => 8, +                                                           'length' => 8,
104                                                           'primary' => true); +                                                           'primary' => true);
105 +
106        $id = $this->_options['table']->getIdentifier(); +        $id = $this->_options['table']->getIdentifier();
107 +
108        $options = array('className' => $this->_options['className']); +        $options = array('className' => $this->_options['className']);
109 +
110        $relations = array($name => array('local' => $id, +        $relations = array($name => array('local' => $id,
111                                          'foreign' => $id,  +                                          'foreign' => $id, 
112                                          'onDelete' => 'CASCADE', +                                          'onDelete' => 'CASCADE',
113                                          'onUpdate' => 'CASCADE')); +                                          'onUpdate' => 'CASCADE'));
114 +
115        $this->generateClass($options, $columns, array()); +        $this->generateClass($options, $columns, array());
116         +        
117        $this->_options['pluginTable'] = $this->_options['table']->getConnection()->getTable($this->_options['className']); +        $this->_options['pluginTable'] = $this->_options['table']->getConnection()->getTable($this->_options['className']);
118 +
119        return true; +        return true;
120    } +    }
121} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_AuditLog_Listener.html b/tests_old/coverage/Doctrine_AuditLog_Listener.html index 6142e87ad..8b33e27a9 100644 --- a/tests_old/coverage/Doctrine_AuditLog_Listener.html +++ b/tests_old/coverage/Doctrine_AuditLog_Listener.html @@ -10,264 +10,264 @@

Coverage for Doctrine_AuditLog_Listener

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id$ + *  $Id$
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Record_Listener'); +Doctrine::autoload('Doctrine_Record_Listener');
22/** +/**
23 * Doctrine_AuditLog_Listener + * Doctrine_AuditLog_Listener
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  AuditLog + * @subpackage  AuditLog
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision$ + * @version     $Revision$
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_AuditLog_Listener extends Doctrine_Record_Listener +class Doctrine_AuditLog_Listener extends Doctrine_Record_Listener
34{ +{
35     +    
36    protected $_auditLog; +    protected $_auditLog;
37 +
38    public function __construct(Doctrine_AuditLog $auditLog) { +    public function __construct(Doctrine_AuditLog $auditLog) {
39        $this->_auditLog = $auditLog; +        $this->_auditLog = $auditLog;
40    } +    }
41    public function preInsert(Doctrine_Event $event) +    public function preInsert(Doctrine_Event $event)
42    { +    {
43        $versionColumn = $this->_auditLog->getOption('versionColumn'); +        $versionColumn = $this->_auditLog->getOption('versionColumn');
44 +
45        $event->getInvoker()->set($versionColumn, 1); +        $event->getInvoker()->set($versionColumn, 1);
46    } +    }
47    public function postInsert(Doctrine_Event $event)  +    public function postInsert(Doctrine_Event $event) 
48    { +    {
49        $class = $this->_auditLog->getOption('className'); +        $class = $this->_auditLog->getOption('className');
50 +
51        $record  = $event->getInvoker(); +        $record  = $event->getInvoker();
52 +
53        $version = new $class(); +        $version = new $class();
54        $version->merge($record->toArray()); +        $version->merge($record->toArray());
55        $version->save(); +        $version->save();
56    } +    }
57    public function preDelete(Doctrine_Event $event) +    public function preDelete(Doctrine_Event $event)
58    { +    {
59        $class = $this->_auditLog->getOption('className'); +        $class = $this->_auditLog->getOption('className');
60 +
61        $record  = $event->getInvoker(); +        $record  = $event->getInvoker();
62 +
63        $versionColumn = $this->_auditLog->getOption('versionColumn'); +        $versionColumn = $this->_auditLog->getOption('versionColumn');
64        $version = $record->get($versionColumn); +        $version = $record->get($versionColumn);
65 +
66        $record->set($versionColumn, ++$version); +        $record->set($versionColumn, ++$version);
67 +
68        $version = new $class(); +        $version = new $class();
69        $version->merge($record->toArray()); +        $version->merge($record->toArray());
70        $version->save(); +        $version->save();
71    } +    }
72    public function preUpdate(Doctrine_Event $event) +    public function preUpdate(Doctrine_Event $event)
73    { +    {
74        $class  = $this->_auditLog->getOption('className'); +        $class  = $this->_auditLog->getOption('className');
75        $record = $event->getInvoker();  +        $record = $event->getInvoker(); 
76 +
77        $versionColumn = $this->_auditLog->getOption('versionColumn'); +        $versionColumn = $this->_auditLog->getOption('versionColumn');
78 +
79        $version = $record->get($versionColumn); +        $version = $record->get($versionColumn);
80 +
81        $record->set($versionColumn, ++$version); +        $record->set($versionColumn, ++$version);
82         +        
83        $version = new $class(); +        $version = new $class();
84        $version->merge($record->toArray()); +        $version->merge($record->toArray());
85        $version->save(); +        $version->save();
86    } +    }
87} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Cache_Array.html b/tests_old/coverage/Doctrine_Cache_Array.html index bbc9182eb..e50825889 100644 --- a/tests_old/coverage/Doctrine_Cache_Array.html +++ b/tests_old/coverage/Doctrine_Cache_Array.html @@ -10,342 +10,342 @@

Coverage for Doctrine_Cache_Array

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: Array.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Array.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Cache_Interface + * Doctrine_Cache_Interface
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Cache + * @subpackage  Cache
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Cache_Array implements Countable, Doctrine_Cache_Interface +class Doctrine_Cache_Array implements Countable, Doctrine_Cache_Interface
34{ +{
35    /** +    /**
36     * @var array $data         an array of cached data +     * @var array $data         an array of cached data
37     */ +     */
38    protected $data; +    protected $data;
39 +
40    /** +    /**
41     * Test if a cache is available for the given id and (if yes) return it (false else) +     * Test if a cache is available for the given id and (if yes) return it (false else)
42     *  +     * 
43     * Note : return value is always "string" (unserialization is done by the core not by the backend) +     * Note : return value is always "string" (unserialization is done by the core not by the backend)
44     *  +     * 
45     * @param string $id cache id +     * @param string $id cache id
46     * @param boolean $testCacheValidity        if set to false, the cache validity won't be tested +     * @param boolean $testCacheValidity        if set to false, the cache validity won't be tested
47     * @return string cached datas (or false) +     * @return string cached datas (or false)
48     */ +     */
49    public function fetch($id, $testCacheValidity = true)  +    public function fetch($id, $testCacheValidity = true) 
50    { +    {
51        if (isset($this->data[$id])) { +        if (isset($this->data[$id])) {
52            return $this->data[$id]; +            return $this->data[$id];
53        } +        }
54        return false; +        return false;
55    } +    }
56 +
57    /** +    /**
58     * Test if a cache is available or not (for the given id) +     * Test if a cache is available or not (for the given id)
59     * +     *
60     * @param string $id cache id +     * @param string $id cache id
61     * @return mixed false (a cache is not available) or "last modified" timestamp (int) of the available cache record +     * @return mixed false (a cache is not available) or "last modified" timestamp (int) of the available cache record
62     */ +     */
63    public function contains($id) +    public function contains($id)
64    { +    {
65        return isset($this->data[$id]); +        return isset($this->data[$id]);
66    } +    }
67 +
68    /** +    /**
69     * Save some string datas into a cache record +     * Save some string datas into a cache record
70     * +     *
71     * Note : $data is always saved as a string +     * Note : $data is always saved as a string
72     * +     *
73     * @param string $data      data to cache +     * @param string $data      data to cache
74     * @param string $id        cache id +     * @param string $id        cache id
75     * @param int $lifeTime     if != false, set a specific lifetime for this cache record (null => infinite lifeTime) +     * @param int $lifeTime     if != false, set a specific lifetime for this cache record (null => infinite lifeTime)
76     * @return boolean true if no problem +     * @return boolean true if no problem
77     */ +     */
78    public function save($id, $data, $lifeTime = false) +    public function save($id, $data, $lifeTime = false)
79    { +    {
80        $this->data[$id] = $data; +        $this->data[$id] = $data;
81    } +    }
82 +
83    /** +    /**
84     * Remove a cache record +     * Remove a cache record
85     *  +     * 
86     * @param string $id cache id +     * @param string $id cache id
87     * @return boolean true if no problem +     * @return boolean true if no problem
88     */ +     */
89    public function delete($id) +    public function delete($id)
90    { +    {
91        unset($this->data[$id]); +        unset($this->data[$id]);
92    } +    }
93 +
94    /** +    /**
95     * Remove all cache record +     * Remove all cache record
96     *  +     * 
97     * @return boolean true if no problem +     * @return boolean true if no problem
98     */ +     */
99    public function deleteAll() +    public function deleteAll()
100    { +    {
101        $this->data = array(); +        $this->data = array();
102    } +    }
103 +
104    /** +    /**
105     * count +     * count
106     * +     *
107     * @return integer +     * @return integer
108     */ +     */
109    public function count()  +    public function count() 
110    { +    {
111        return count($this->data); +        return count($this->data);
112    } +    }
113} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Collection.html b/tests_old/coverage/Doctrine_Collection.html index bf539f1ce..88b0e1b86 100644 --- a/tests_old/coverage/Doctrine_Collection.html +++ b/tests_old/coverage/Doctrine_Collection.html @@ -64,7 +64,7 @@  * and is licensed under the LGPL. For more information, see 19 - * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>. 20  */ @@ -94,7 +94,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL 29 - * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org 30  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Configurable.html b/tests_old/coverage/Doctrine_Configurable.html index d80f68a65..152fef3ad 100644 --- a/tests_old/coverage/Doctrine_Configurable.html +++ b/tests_old/coverage/Doctrine_Configurable.html @@ -64,7 +64,7 @@  * and is licensed under the LGPL. For more information, see 19 - * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>. 20  */ @@ -97,7 +97,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL 30 - * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org 31  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Connection.html b/tests_old/coverage/Doctrine_Connection.html index 098ed77d5..0e0e19224 100644 --- a/tests_old/coverage/Doctrine_Connection.html +++ b/tests_old/coverage/Doctrine_Connection.html @@ -64,7 +64,7 @@  * and is licensed under the LGPL. For more information, see 19 - * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>. 20  */ @@ -157,7 +157,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL 50 - * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org 51  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Connection_Common.html b/tests_old/coverage/Doctrine_Connection_Common.html index d66b1a23e..cd594d09a 100644 --- a/tests_old/coverage/Doctrine_Connection_Common.html +++ b/tests_old/coverage/Doctrine_Connection_Common.html @@ -10,172 +10,172 @@

Coverage for Doctrine_Connection_Common

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Connection_Exception.html b/tests_old/coverage/Doctrine_Connection_Exception.html index 2e64983ce..f717e4fd2 100644 --- a/tests_old/coverage/Doctrine_Connection_Exception.html +++ b/tests_old/coverage/Doctrine_Connection_Exception.html @@ -10,352 +10,352 @@

Coverage for Doctrine_Connection_Exception

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Common.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $ + *  $Id: Common.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Connection'); +Doctrine::autoload('Doctrine_Connection');
22/** +/**
23 * standard connection, the parent of pgsql, mysql and sqlite + * standard connection, the parent of pgsql, mysql and sqlite
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Connection + * @subpackage  Connection
27 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 2702 $ + * @version     $Revision: 2702 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Connection_Common extends Doctrine_Connection +class Doctrine_Connection_Common extends Doctrine_Connection
34{ +{
35    /** +    /**
36     * Adds an driver-specific LIMIT clause to the query +     * Adds an driver-specific LIMIT clause to the query
37     * +     *
38     * @param string $query +     * @param string $query
39     * @param mixed $limit +     * @param mixed $limit
40     * @param mixed $offset +     * @param mixed $offset
41     */ +     */
42    public function modifyLimitQuery($query, $limit = false,$offset = false,$isManip=false) +    public function modifyLimitQuery($query, $limit = false,$offset = false,$isManip=false)
43    { +    {
44        $limit = (int) $limit; +        $limit = (int) $limit;
45        $offset = (int) $offset; +        $offset = (int) $offset;
46         +        
47        if ($limit && $offset) { +        if ($limit && $offset) {
48            $query .= ' LIMIT ' . $limit . ' OFFSET ' . $offset; +            $query .= ' LIMIT ' . $limit . ' OFFSET ' . $offset;
49        } elseif ($limit && ! $offset) { +        } elseif ($limit && ! $offset) {
50            $query .= ' LIMIT ' . $limit; +            $query .= ' LIMIT ' . $limit;
51        } elseif ( ! $limit && $offset) { +        } elseif ( ! $limit && $offset) {
52            $query .= ' LIMIT 999999999999 OFFSET ' . $offset; +            $query .= ' LIMIT 999999999999 OFFSET ' . $offset;
53        } +        }
54 +
55        return $query; +        return $query;
56    } +    }
57 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Connection_Firebird.html b/tests_old/coverage/Doctrine_Connection_Firebird.html index 730b3bee3..8b1c25df1 100644 --- a/tests_old/coverage/Doctrine_Connection_Firebird.html +++ b/tests_old/coverage/Doctrine_Connection_Firebird.html @@ -10,334 +10,334 @@

Coverage for Doctrine_Connection_Firebird

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Exception.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Exception.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Exception'); +Doctrine::autoload('Doctrine_Exception');
22/** +/**
23 * Doctrine_Exception + * Doctrine_Exception
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Connection + * @subpackage  Connection
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Connection_Exception extends Doctrine_Exception +class Doctrine_Connection_Exception extends Doctrine_Exception
34{ +{
35    /** +    /**
36     * @var array $errorMessages        an array containing messages for portable error codes +     * @var array $errorMessages        an array containing messages for portable error codes
37     */ +     */
38    static protected $errorMessages = array( +    static protected $errorMessages = array(
39                Doctrine::ERR                    => 'unknown error', +                Doctrine::ERR                    => 'unknown error',
40                Doctrine::ERR_ALREADY_EXISTS     => 'already exists', +                Doctrine::ERR_ALREADY_EXISTS     => 'already exists',
41                Doctrine::ERR_CANNOT_CREATE      => 'can not create', +                Doctrine::ERR_CANNOT_CREATE      => 'can not create',
42                Doctrine::ERR_CANNOT_ALTER       => 'can not alter', +                Doctrine::ERR_CANNOT_ALTER       => 'can not alter',
43                Doctrine::ERR_CANNOT_REPLACE     => 'can not replace', +                Doctrine::ERR_CANNOT_REPLACE     => 'can not replace',
44                Doctrine::ERR_CANNOT_DELETE      => 'can not delete', +                Doctrine::ERR_CANNOT_DELETE      => 'can not delete',
45                Doctrine::ERR_CANNOT_DROP        => 'can not drop', +                Doctrine::ERR_CANNOT_DROP        => 'can not drop',
46                Doctrine::ERR_CONSTRAINT         => 'constraint violation', +                Doctrine::ERR_CONSTRAINT         => 'constraint violation',
47                Doctrine::ERR_CONSTRAINT_NOT_NULL=> 'null value violates not-null constraint', +                Doctrine::ERR_CONSTRAINT_NOT_NULL=> 'null value violates not-null constraint',
48                Doctrine::ERR_DIVZERO            => 'division by zero', +                Doctrine::ERR_DIVZERO            => 'division by zero',
49                Doctrine::ERR_INVALID            => 'invalid', +                Doctrine::ERR_INVALID            => 'invalid',
50                Doctrine::ERR_INVALID_DATE       => 'invalid date or time', +                Doctrine::ERR_INVALID_DATE       => 'invalid date or time',
51                Doctrine::ERR_INVALID_NUMBER     => 'invalid number', +                Doctrine::ERR_INVALID_NUMBER     => 'invalid number',
52                Doctrine::ERR_MISMATCH           => 'mismatch', +                Doctrine::ERR_MISMATCH           => 'mismatch',
53                Doctrine::ERR_NODBSELECTED       => 'no database selected', +                Doctrine::ERR_NODBSELECTED       => 'no database selected',
54                Doctrine::ERR_NOSUCHFIELD        => 'no such field', +                Doctrine::ERR_NOSUCHFIELD        => 'no such field',
55                Doctrine::ERR_NOSUCHTABLE        => 'no such table', +                Doctrine::ERR_NOSUCHTABLE        => 'no such table',
56                Doctrine::ERR_NOT_CAPABLE        => 'Doctrine backend not capable', +                Doctrine::ERR_NOT_CAPABLE        => 'Doctrine backend not capable',
57                Doctrine::ERR_NOT_FOUND          => 'not found', +                Doctrine::ERR_NOT_FOUND          => 'not found',
58                Doctrine::ERR_NOT_LOCKED         => 'not locked', +                Doctrine::ERR_NOT_LOCKED         => 'not locked',
59                Doctrine::ERR_SYNTAX             => 'syntax error', +                Doctrine::ERR_SYNTAX             => 'syntax error',
60                Doctrine::ERR_UNSUPPORTED        => 'not supported', +                Doctrine::ERR_UNSUPPORTED        => 'not supported',
61                Doctrine::ERR_VALUE_COUNT_ON_ROW => 'value count on row', +                Doctrine::ERR_VALUE_COUNT_ON_ROW => 'value count on row',
62                Doctrine::ERR_INVALID_DSN        => 'invalid DSN', +                Doctrine::ERR_INVALID_DSN        => 'invalid DSN',
63                Doctrine::ERR_CONNECT_FAILED     => 'connect failed', +                Doctrine::ERR_CONNECT_FAILED     => 'connect failed',
64                Doctrine::ERR_NEED_MORE_DATA     => 'insufficient data supplied', +                Doctrine::ERR_NEED_MORE_DATA     => 'insufficient data supplied',
65                Doctrine::ERR_EXTENSION_NOT_FOUND=> 'extension not found', +                Doctrine::ERR_EXTENSION_NOT_FOUND=> 'extension not found',
66                Doctrine::ERR_NOSUCHDB           => 'no such database', +                Doctrine::ERR_NOSUCHDB           => 'no such database',
67                Doctrine::ERR_ACCESS_VIOLATION   => 'insufficient permissions', +                Doctrine::ERR_ACCESS_VIOLATION   => 'insufficient permissions',
68                Doctrine::ERR_LOADMODULE         => 'error while including on demand module', +                Doctrine::ERR_LOADMODULE         => 'error while including on demand module',
69                Doctrine::ERR_TRUNCATED          => 'truncated', +                Doctrine::ERR_TRUNCATED          => 'truncated',
70                Doctrine::ERR_DEADLOCK           => 'deadlock detected', +                Doctrine::ERR_DEADLOCK           => 'deadlock detected',
71                ); +                );
72 +
73    /** +    /**
74     * @see Doctrine::ERR_* constants +     * @see Doctrine::ERR_* constants
75     * @since 1.0 +     * @since 1.0
76     * @var integer $portableCode           portable error code +     * @var integer $portableCode           portable error code
77     */ +     */
78    protected $portableCode; +    protected $portableCode;
79 +
80    /** +    /**
81     * getPortableCode +     * getPortableCode
82     * returns portable error code +     * returns portable error code
83     * +     *
84     * @return integer      portable error code +     * @return integer      portable error code
85     */ +     */
86    public function getPortableCode() +    public function getPortableCode()
87    { +    {
88        return $this->portableCode; +        return $this->portableCode;
89    } +    }
90 +
91    /** +    /**
92     * getPortableMessage +     * getPortableMessage
93     * returns portable error message +     * returns portable error message
94     * +     *
95     * @return string       portable error message +     * @return string       portable error message
96     */ +     */
97    public function getPortableMessage() +    public function getPortableMessage()
98    { +    {
99        return self::errorMessage($this->portableCode); +        return self::errorMessage($this->portableCode);
100    } +    }
101 +
102    /** +    /**
103     * Return a textual error message for a Doctrine error code +     * Return a textual error message for a Doctrine error code
104     * +     *
105     * @param   int|array   integer error code, +     * @param   int|array   integer error code,
106     *                           null to get the current error code-message map, +     *                           null to get the current error code-message map,
107     *                           or an array with a new error code-message map +     *                           or an array with a new error code-message map
108     * +     *
109     * @return  string  error message, or false if the error code was +     * @return  string  error message, or false if the error code was
110     *                  not recognized +     *                  not recognized
111     */ +     */
112    public function errorMessage($value = null) +    public function errorMessage($value = null)
113    { +    {
114        return isset(self::$errorMessages[$value]) ? +        return isset(self::$errorMessages[$value]) ?
115           self::$errorMessages[$value] : self::$errorMessages[Doctrine::ERR]; +           self::$errorMessages[$value] : self::$errorMessages[Doctrine::ERR];
116    } +    }
117 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Connection_Firebird_Exception.html b/tests_old/coverage/Doctrine_Connection_Firebird_Exception.html index 7a5de3ed1..5ab9a28a8 100644 --- a/tests_old/coverage/Doctrine_Connection_Firebird_Exception.html +++ b/tests_old/coverage/Doctrine_Connection_Firebird_Exception.html @@ -10,409 +10,409 @@

Coverage for Doctrine_Connection_Firebird_Exception

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Firebird.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Firebird.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Connection'); +Doctrine::autoload('Doctrine_Connection');
22/** +/**
23 * Doctrine_Connection_Firebird + * Doctrine_Connection_Firebird
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Connection + * @subpackage  Connection
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
29 * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library) + * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
30 * @author      Lorenzo Alberton <l.alberton@quipo.it> (PEAR MDB2 Interbase driver) + * @author      Lorenzo Alberton <l.alberton@quipo.it> (PEAR MDB2 Interbase driver)
31 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
32 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
33 * @since       1.0 + * @since       1.0
34 */ + */
35class Doctrine_Connection_Firebird extends Doctrine_Connection +class Doctrine_Connection_Firebird extends Doctrine_Connection
36{ +{
37    /** +    /**
38     * @var string $driverName                  the name of this connection driver +     * @var string $driverName                  the name of this connection driver
39     */ +     */
40    protected $driverName = 'Firebird'; +    protected $driverName = 'Firebird';
41 +
42    /** +    /**
43     * the constructor +     * the constructor
44     * +     *
45     * @param Doctrine_Manager $manager +     * @param Doctrine_Manager $manager
46     * @param PDO $pdo                          database handle +     * @param PDO $pdo                          database handle
47     */ +     */
48    public function __construct(Doctrine_Manager $manager, $adapter) +    public function __construct(Doctrine_Manager $manager, $adapter)
49    { +    {
50 +
51        $this->supported = array( +        $this->supported = array(
52                          'sequences'             => true, +                          'sequences'             => true,
53                          'indexes'               => true, +                          'indexes'               => true,
54                          'affected_rows'         => true, +                          'affected_rows'         => true,
55                          'summary_functions'     => true, +                          'summary_functions'     => true,
56                          'order_by_text'         => true, +                          'order_by_text'         => true,
57                          'transactions'          => true, +                          'transactions'          => true,
58                          'savepoints'            => true, +                          'savepoints'            => true,
59                          'current_id'            => true, +                          'current_id'            => true,
60                          'limit_queries'         => 'emulated', +                          'limit_queries'         => 'emulated',
61                          'LOBs'                  => true, +                          'LOBs'                  => true,
62                          'replace'               => 'emulated', +                          'replace'               => 'emulated',
63                          'sub_selects'           => true, +                          'sub_selects'           => true,
64                          'auto_increment'        => true, +                          'auto_increment'        => true,
65                          'primary_key'           => true, +                          'primary_key'           => true,
66                          'result_introspection'  => true, +                          'result_introspection'  => true,
67                          'prepared_statements'   => true, +                          'prepared_statements'   => true,
68                          'identifier_quoting'    => false, +                          'identifier_quoting'    => false,
69                          'pattern_escaping'      => true +                          'pattern_escaping'      => true
70                          ); +                          );
71        // initialize all driver options +        // initialize all driver options
72        /** +        /**
73        $this->options['DBA_username'] = false; +        $this->options['DBA_username'] = false;
74        $this->options['DBA_password'] = false; +        $this->options['DBA_password'] = false;
75        $this->options['database_path'] = ''; +        $this->options['database_path'] = '';
76        $this->options['database_extension'] = '.gdb'; +        $this->options['database_extension'] = '.gdb';
77        $this->options['server_version'] = ''; +        $this->options['server_version'] = '';
78        */ +        */
79        parent::__construct($manager, $adapter); +        parent::__construct($manager, $adapter);
80    } +    }
81 +
82    /** +    /**
83     * Set the charset on the current connection +     * Set the charset on the current connection
84     * +     *
85     * @param string    charset +     * @param string    charset
86     * +     *
87     * @return void +     * @return void
88     */ +     */
89    public function setCharset($charset) +    public function setCharset($charset)
90    { +    {
91        $query = 'SET NAMES '.$this->dbh->quote($charset); +        $query = 'SET NAMES '.$this->dbh->quote($charset);
92        $this->exec($query); +        $this->exec($query);
93    } +    }
94 +
95    /** +    /**
96     * Adds an driver-specific LIMIT clause to the query +     * Adds an driver-specific LIMIT clause to the query
97     * +     *
98     * @param string $query     query to modify +     * @param string $query     query to modify
99     * @param integer $limit    limit the number of rows +     * @param integer $limit    limit the number of rows
100     * @param integer $offset   start reading from given offset +     * @param integer $offset   start reading from given offset
101     * @return string modified  query +     * @return string modified  query
102     */ +     */
103    public function modifyLimitQuery($query, $limit, $offset) +    public function modifyLimitQuery($query, $limit, $offset)
104    { +    {
105        if ($limit > 0) { +        if ($limit > 0) {
106            $query = preg_replace('/^([\s(])*SELECT(?!\s*FIRST\s*\d+)/i', +            $query = preg_replace('/^([\s(])*SELECT(?!\s*FIRST\s*\d+)/i',
107                "SELECT FIRST $limit SKIP $offset", $query); +                "SELECT FIRST $limit SKIP $offset", $query);
108        } +        }
109        return $query; +        return $query;
110    } +    }
111 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Connection_Module.html b/tests_old/coverage/Doctrine_Connection_Module.html index dc7d3959d..d620316d9 100644 --- a/tests_old/coverage/Doctrine_Connection_Module.html +++ b/tests_old/coverage/Doctrine_Connection_Module.html @@ -10,250 +10,250 @@

Coverage for Doctrine_Connection_Module

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Exception.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Exception.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Connection_Exception'); +Doctrine::autoload('Doctrine_Connection_Exception');
22/** +/**
23 * Doctrine_Connection_Firebird_Exception + * Doctrine_Connection_Firebird_Exception
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Connection + * @subpackage  Connection
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 * @author      Lorenzo Alberton <l.alberton@quipo.it> (PEAR MDB2 Interbase driver) + * @author      Lorenzo Alberton <l.alberton@quipo.it> (PEAR MDB2 Interbase driver)
33 * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library) + * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
34 */ + */
35class Doctrine_Connection_Firebird_Exception extends Doctrine_Connection_Exception +class Doctrine_Connection_Firebird_Exception extends Doctrine_Connection_Exception
36{ +{
37    /** +    /**
38     * @var array $errorCodeMap         an array that is used for determining portable +     * @var array $errorCodeMap         an array that is used for determining portable
39     *                                  error code from a native database error code +     *                                  error code from a native database error code
40     */ +     */
41    protected static $errorCodeMap = array( +    protected static $errorCodeMap = array(
42                                    -104 => Doctrine::ERR_SYNTAX, +                                    -104 => Doctrine::ERR_SYNTAX,
43                                    -150 => Doctrine::ERR_ACCESS_VIOLATION, +                                    -150 => Doctrine::ERR_ACCESS_VIOLATION,
44                                    -151 => Doctrine::ERR_ACCESS_VIOLATION, +                                    -151 => Doctrine::ERR_ACCESS_VIOLATION,
45                                    -155 => Doctrine::ERR_NOSUCHTABLE, +                                    -155 => Doctrine::ERR_NOSUCHTABLE,
46                                    -157 => Doctrine::ERR_NOSUCHFIELD, +                                    -157 => Doctrine::ERR_NOSUCHFIELD,
47                                    -158 => Doctrine::ERR_VALUE_COUNT_ON_ROW, +                                    -158 => Doctrine::ERR_VALUE_COUNT_ON_ROW,
48                                    -170 => Doctrine::ERR_MISMATCH, +                                    -170 => Doctrine::ERR_MISMATCH,
49                                    -171 => Doctrine::ERR_MISMATCH, +                                    -171 => Doctrine::ERR_MISMATCH,
50                                    -172 => Doctrine::ERR_INVALID, +                                    -172 => Doctrine::ERR_INVALID,
51                                    // -204 =>  // Covers too many errors, need to use regex on msg +                                    // -204 =>  // Covers too many errors, need to use regex on msg
52                                    -205 => Doctrine::ERR_NOSUCHFIELD, +                                    -205 => Doctrine::ERR_NOSUCHFIELD,
53                                    -206 => Doctrine::ERR_NOSUCHFIELD, +                                    -206 => Doctrine::ERR_NOSUCHFIELD,
54                                    -208 => Doctrine::ERR_INVALID, +                                    -208 => Doctrine::ERR_INVALID,
55                                    -219 => Doctrine::ERR_NOSUCHTABLE, +                                    -219 => Doctrine::ERR_NOSUCHTABLE,
56                                    -297 => Doctrine::ERR_CONSTRAINT, +                                    -297 => Doctrine::ERR_CONSTRAINT,
57                                    -303 => Doctrine::ERR_INVALID, +                                    -303 => Doctrine::ERR_INVALID,
58                                    -413 => Doctrine::ERR_INVALID_NUMBER, +                                    -413 => Doctrine::ERR_INVALID_NUMBER,
59                                    -530 => Doctrine::ERR_CONSTRAINT, +                                    -530 => Doctrine::ERR_CONSTRAINT,
60                                    -551 => Doctrine::ERR_ACCESS_VIOLATION, +                                    -551 => Doctrine::ERR_ACCESS_VIOLATION,
61                                    -552 => Doctrine::ERR_ACCESS_VIOLATION, +                                    -552 => Doctrine::ERR_ACCESS_VIOLATION,
62                                    // -607 =>  // Covers too many errors, need to use regex on msg +                                    // -607 =>  // Covers too many errors, need to use regex on msg
63                                    -625 => Doctrine::ERR_CONSTRAINT_NOT_NULL, +                                    -625 => Doctrine::ERR_CONSTRAINT_NOT_NULL,
64                                    -803 => Doctrine::ERR_CONSTRAINT, +                                    -803 => Doctrine::ERR_CONSTRAINT,
65                                    -804 => Doctrine::ERR_VALUE_COUNT_ON_ROW, +                                    -804 => Doctrine::ERR_VALUE_COUNT_ON_ROW,
66                                    -904 => Doctrine::ERR_CONNECT_FAILED, +                                    -904 => Doctrine::ERR_CONNECT_FAILED,
67                                    -922 => Doctrine::ERR_NOSUCHDB, +                                    -922 => Doctrine::ERR_NOSUCHDB,
68                                    -923 => Doctrine::ERR_CONNECT_FAILED, +                                    -923 => Doctrine::ERR_CONNECT_FAILED,
69                                    -924 => Doctrine::ERR_CONNECT_FAILED +                                    -924 => Doctrine::ERR_CONNECT_FAILED
70                                    ); +                                    );
71 +
72    /** +    /**
73     * @var array $errorRegexps         an array that is used for determining portable +     * @var array $errorRegexps         an array that is used for determining portable
74     *                                  error code from a native database error message +     *                                  error code from a native database error message
75     */ +     */
76    protected static $errorRegexps = array( +    protected static $errorRegexps = array(
77                                    '/generator .* is not defined/' +                                    '/generator .* is not defined/'
78                                        => Doctrine::ERR_SYNTAX,  // for compat. w ibase_errcode() +                                        => Doctrine::ERR_SYNTAX,  // for compat. w ibase_errcode()
79                                    '/table.*(not exist|not found|unknown)/i' +                                    '/table.*(not exist|not found|unknown)/i'
80                                        => Doctrine::ERR_NOSUCHTABLE, +                                        => Doctrine::ERR_NOSUCHTABLE,
81                                    '/table .* already exists/i' +                                    '/table .* already exists/i'
82                                        => Doctrine::ERR_ALREADY_EXISTS, +                                        => Doctrine::ERR_ALREADY_EXISTS,
83                                    '/unsuccessful metadata update .* failed attempt to store duplicate value/i' +                                    '/unsuccessful metadata update .* failed attempt to store duplicate value/i'
84                                        => Doctrine::ERR_ALREADY_EXISTS, +                                        => Doctrine::ERR_ALREADY_EXISTS,
85                                    '/unsuccessful metadata update .* not found/i' +                                    '/unsuccessful metadata update .* not found/i'
86                                        => Doctrine::ERR_NOT_FOUND, +                                        => Doctrine::ERR_NOT_FOUND,
87                                    '/validation error for column .* value "\*\*\* null/i' +                                    '/validation error for column .* value "\*\*\* null/i'
88                                        => Doctrine::ERR_CONSTRAINT_NOT_NULL, +                                        => Doctrine::ERR_CONSTRAINT_NOT_NULL,
89                                    '/violation of [\w ]+ constraint/i' +                                    '/violation of [\w ]+ constraint/i'
90                                        => Doctrine::ERR_CONSTRAINT, +                                        => Doctrine::ERR_CONSTRAINT,
91                                    '/conversion error from string/i' +                                    '/conversion error from string/i'
92                                        => Doctrine::ERR_INVALID_NUMBER, +                                        => Doctrine::ERR_INVALID_NUMBER,
93                                    '/no permission for/i' +                                    '/no permission for/i'
94                                        => Doctrine::ERR_ACCESS_VIOLATION, +                                        => Doctrine::ERR_ACCESS_VIOLATION,
95                                    '/arithmetic exception, numeric overflow, or string truncation/i' +                                    '/arithmetic exception, numeric overflow, or string truncation/i'
96                                        => Doctrine::ERR_INVALID, +                                        => Doctrine::ERR_INVALID,
97                                    '/table unknown/i' +                                    '/table unknown/i'
98                                        => Doctrine::ERR_NOSUCHTABLE, +                                        => Doctrine::ERR_NOSUCHTABLE,
99                                    ); +                                    );
100 +
101    /** +    /**
102     * This method checks if native error code/message can be +     * This method checks if native error code/message can be
103     * converted into a portable code and then adds this +     * converted into a portable code and then adds this
104     * portable error code to errorInfo array and returns the modified array +     * portable error code to errorInfo array and returns the modified array
105     * +     *
106     * the portable error code is added at the end of array +     * the portable error code is added at the end of array
107     * +     *
108     * @param array $errorInfo      error info array +     * @param array $errorInfo      error info array
109     * @since 1.0 +     * @since 1.0
110     * @return array +     * @return array
111     */ +     */
112    public function processErrorInfo(array $errorInfo) +    public function processErrorInfo(array $errorInfo)
113    { +    {
114            /** +            /**
115            // todo: are the following lines needed? +            // todo: are the following lines needed?
116            // memo for the interbase php module hackers: we need something similar +            // memo for the interbase php module hackers: we need something similar
117            // to mysql_errno() to retrieve error codes instead of this ugly hack +            // to mysql_errno() to retrieve error codes instead of this ugly hack
118            if (preg_match('/^([^0-9\-]+)([0-9\-]+)\s+(.*)$/', $native_msg, $m)) { +            if (preg_match('/^([^0-9\-]+)([0-9\-]+)\s+(.*)$/', $native_msg, $m)) {
119                $native_code = (int)$m[2]; +                $native_code = (int)$m[2];
120            } else { +            } else {
121                $native_code = null; +                $native_code = null;
122            } +            }
123            */ +            */
124 +
125        foreach (self::$errorRegexps as $regexp => $code) { +        foreach (self::$errorRegexps as $regexp => $code) {
126            if (preg_match($regexp, $errorInfo[2])) { +            if (preg_match($regexp, $errorInfo[2])) {
127                $errorInfo[3] = $code; +                $errorInfo[3] = $code;
128                break; +                break;
129            } +            }
130        } +        }
131        if (isset(self::$errorCodeMap[$errorInfo[1]])) { +        if (isset(self::$errorCodeMap[$errorInfo[1]])) {
132            $errorInfo[3] = self::$errorCodeMap[$errorInfo[1]]; +            $errorInfo[3] = self::$errorCodeMap[$errorInfo[1]];
133        } +        }
134        return $errorInfo; +        return $errorInfo;
135    } +    }
136 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Connection_Mssql.html b/tests_old/coverage/Doctrine_Connection_Mssql.html index 3687d2c23..20e1be7b1 100644 --- a/tests_old/coverage/Doctrine_Connection_Mssql.html +++ b/tests_old/coverage/Doctrine_Connection_Mssql.html @@ -10,583 +10,583 @@

Coverage for Doctrine_Connection_Mssql

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Module.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Module.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Connection_Module + * Doctrine_Connection_Module
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Connection + * @subpackage  Connection
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Connection_Module +class Doctrine_Connection_Module
34{ +{
35    /** +    /**
36     * @var Doctrine_Connection $conn       Doctrine_Connection object, every connection +     * @var Doctrine_Connection $conn       Doctrine_Connection object, every connection
37     *                                      module holds an instance of Doctrine_Connection +     *                                      module holds an instance of Doctrine_Connection
38     */ +     */
39    protected $conn; +    protected $conn;
40 +
41    /** +    /**
42     * @var string $moduleName              the name of this module +     * @var string $moduleName              the name of this module
43     */ +     */
44    protected $moduleName; +    protected $moduleName;
45 +
46    /** +    /**
47     * @param Doctrine_Connection $conn     Doctrine_Connection object, every connection +     * @param Doctrine_Connection $conn     Doctrine_Connection object, every connection
48     *                                      module holds an instance of Doctrine_Connection +     *                                      module holds an instance of Doctrine_Connection
49     */ +     */
50    public function __construct($conn = null) +    public function __construct($conn = null)
51    { +    {
52        if ( ! ($conn instanceof Doctrine_Connection)) { +        if ( ! ($conn instanceof Doctrine_Connection)) {
53            $conn = Doctrine_Manager::getInstance()->getCurrentConnection(); +            $conn = Doctrine_Manager::getInstance()->getCurrentConnection();
54        } +        }
55        $this->conn = $conn; +        $this->conn = $conn;
56 +
57        $e = explode('_', get_class($this)); +        $e = explode('_', get_class($this));
58 +
59        $this->moduleName = $e[1]; +        $this->moduleName = $e[1];
60    } +    }
61 +
62    /** +    /**
63     * getConnection +     * getConnection
64     * returns the connection object this module uses +     * returns the connection object this module uses
65     * +     *
66     * @return Doctrine_Connection +     * @return Doctrine_Connection
67     */ +     */
68    public function getConnection() +    public function getConnection()
69    { +    {
70        return $this->conn; +        return $this->conn;
71    } +    }
72 +
73    /** +    /**
74     * getModuleName +     * getModuleName
75     * returns the name of this module +     * returns the name of this module
76     * +     *
77     * @return string       the name of this module +     * @return string       the name of this module
78     */ +     */
79    public function getModuleName() +    public function getModuleName()
80    { +    {
81        return $this->moduleName; +        return $this->moduleName;
82    } +    }
83 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Connection_Mssql_Exception.html b/tests_old/coverage/Doctrine_Connection_Mssql_Exception.html index 1de900116..cf867b188 100644 --- a/tests_old/coverage/Doctrine_Connection_Mssql_Exception.html +++ b/tests_old/coverage/Doctrine_Connection_Mssql_Exception.html @@ -10,226 +10,226 @@

Coverage for Doctrine_Connection_Mssql_Exception

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Mssql.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Mssql.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Connection'); +Doctrine::autoload('Doctrine_Connection');
22/** +/**
23 * Doctrine_Connection_Mssql + * Doctrine_Connection_Mssql
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Connection + * @subpackage  Connection
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
29 * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library) + * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
30 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
31 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
32 * @since       1.0 + * @since       1.0
33 */ + */
34class Doctrine_Connection_Mssql extends Doctrine_Connection +class Doctrine_Connection_Mssql extends Doctrine_Connection
35{ +{
36    /** +    /**
37     * @var string $driverName                  the name of this connection driver +     * @var string $driverName                  the name of this connection driver
38     */ +     */
39    protected $driverName = 'Mssql'; +    protected $driverName = 'Mssql';
40 +
41    /** +    /**
42     * the constructor +     * the constructor
43     * +     *
44     * @param Doctrine_Manager $manager +     * @param Doctrine_Manager $manager
45     * @param PDO $pdo                          database handle +     * @param PDO $pdo                          database handle
46     */ +     */
47    public function __construct(Doctrine_Manager $manager, $adapter) +    public function __construct(Doctrine_Manager $manager, $adapter)
48    { +    {
49        // initialize all driver options +        // initialize all driver options
50        $this->supported = array( +        $this->supported = array(
51                          'sequences'             => 'emulated', +                          'sequences'             => 'emulated',
52                          'indexes'               => true, +                          'indexes'               => true,
53                          'affected_rows'         => true, +                          'affected_rows'         => true,
54                          'transactions'          => true, +                          'transactions'          => true,
55                          'summary_functions'     => true, +                          'summary_functions'     => true,
56                          'order_by_text'         => true, +                          'order_by_text'         => true,
57                          'current_id'            => 'emulated', +                          'current_id'            => 'emulated',
58                          'limit_queries'         => 'emulated', +                          'limit_queries'         => 'emulated',
59                          'LOBs'                  => true, +                          'LOBs'                  => true,
60                          'replace'               => 'emulated', +                          'replace'               => 'emulated',
61                          'sub_selects'           => true, +                          'sub_selects'           => true,
62                          'auto_increment'        => true, +                          'auto_increment'        => true,
63                          'primary_key'           => true, +                          'primary_key'           => true,
64                          'result_introspection'  => true, +                          'result_introspection'  => true,
65                          'prepared_statements'   => 'emulated', +                          'prepared_statements'   => 'emulated',
66                          ); +                          );
67 +
68        parent::__construct($manager, $adapter); +        parent::__construct($manager, $adapter);
69    } +    }
70 +
71    /** +    /**
72     * quoteIdentifier +     * quoteIdentifier
73     * Quote a string so it can be safely used as a table / column name +     * Quote a string so it can be safely used as a table / column name
74     * +     *
75     * Quoting style depends on which database driver is being used. +     * Quoting style depends on which database driver is being used.
76     * +     *
77     * @param string $identifier    identifier name to be quoted +     * @param string $identifier    identifier name to be quoted
78     * @param bool   $checkOption   check the 'quote_identifier' option +     * @param bool   $checkOption   check the 'quote_identifier' option
79     * +     *
80     * @return string  quoted identifier string +     * @return string  quoted identifier string
81     */ +     */
82    public function quoteIdentifier($identifier, $checkOption = false) +    public function quoteIdentifier($identifier, $checkOption = false)
83    { +    {
84        if ($checkOption && ! $this->getAttribute(Doctrine::ATTR_QUOTE_IDENTIFIER)) { +        if ($checkOption && ! $this->getAttribute(Doctrine::ATTR_QUOTE_IDENTIFIER)) {
85            return $identifier; +            return $identifier;
86        } +        }
87        return '[' . str_replace(']', ']]', $identifier) . ']'; +        return '[' . str_replace(']', ']]', $identifier) . ']';
88    } +    }
89 +
90    /** +    /**
91     * Adds an adapter-specific LIMIT clause to the SELECT statement. +     * Adds an adapter-specific LIMIT clause to the SELECT statement.
92     * [ borrowed from Zend Framework ] +     * [ borrowed from Zend Framework ]
93     * +     *
94     * @param string $query +     * @param string $query
95     * @param mixed $limit +     * @param mixed $limit
96     * @param mixed $offset +     * @param mixed $offset
97     * @link http://lists.bestpractical.com/pipermail/rt-devel/2005-June/007339.html +     * @link http://lists.bestpractical.com/pipermail/rt-devel/2005-June/007339.html
98     * @return string +     * @return string
99     */ +     */
100    public function modifyLimitQuery($query, $limit, $offset, $isManip = false) +    public function modifyLimitQuery($query, $limit, $offset, $isManip = false)
101    { +    {
102        if ($limit > 0) { +        if ($limit > 0) {
103            $count = intval($limit); +            $count = intval($limit);
104 +
105            $offset = intval($offset); +            $offset = intval($offset);
106            if ($offset < 0) { +            if ($offset < 0) {
107                throw new Doctrine_Connection_Exception("LIMIT argument offset=$offset is not valid"); +                throw new Doctrine_Connection_Exception("LIMIT argument offset=$offset is not valid");
108            } +            }
109     +    
110            $orderby = stristr($query, 'ORDER BY'); +            $orderby = stristr($query, 'ORDER BY');
111            if ($orderby !== false) { +            if ($orderby !== false) {
112                $sort = (stripos($orderby, 'desc') !== false) ? 'desc' : 'asc'; +                $sort = (stripos($orderby, 'desc') !== false) ? 'desc' : 'asc';
113                $order = str_ireplace('ORDER BY', '', $orderby); +                $order = str_ireplace('ORDER BY', '', $orderby);
114                $order = trim(preg_replace('/ASC|DESC/i', '', $order)); +                $order = trim(preg_replace('/ASC|DESC/i', '', $order));
115            } +            }
116     +    
117            $query = preg_replace('/^SELECT\s/i', 'SELECT TOP ' . ($count+$offset) . ' ', $query); +            $query = preg_replace('/^SELECT\s/i', 'SELECT TOP ' . ($count+$offset) . ' ', $query);
118     +    
119            $query = 'SELECT * FROM (SELECT TOP ' . $count . ' * FROM (' . $query . ') AS inner_tbl'; +            $query = 'SELECT * FROM (SELECT TOP ' . $count . ' * FROM (' . $query . ') AS inner_tbl';
120            if ($orderby !== false) { +            if ($orderby !== false) {
121                $query .= ' ORDER BY ' . $order . ' '; +                $query .= ' ORDER BY ' . $order . ' ';
122                $query .= (stripos($sort, 'asc') !== false) ? 'DESC' : 'ASC'; +                $query .= (stripos($sort, 'asc') !== false) ? 'DESC' : 'ASC';
123            } +            }
124            $query .= ') AS outer_tbl'; +            $query .= ') AS outer_tbl';
125            if ($orderby !== false) { +            if ($orderby !== false) {
126                $query .= ' ORDER BY ' . $order . ' ' . $sort; +                $query .= ' ORDER BY ' . $order . ' ' . $sort;
127            } +            }
128     +    
129            return $query; +            return $query;
130 +
131        } +        }
132 +
133        return $query; +        return $query;
134    } +    }
135 +
136    /** +    /**
137     * return version information about the server +     * return version information about the server
138     * +     *
139     * @param bool   $native  determines if the raw version string should be returned +     * @param bool   $native  determines if the raw version string should be returned
140     * @return mixed array/string with version information or MDB2 error object +     * @return mixed array/string with version information or MDB2 error object
141     */ +     */
142    public function getServerVersion($native = false) +    public function getServerVersion($native = false)
143    { +    {
144        if ($this->serverInfo) { +        if ($this->serverInfo) {
145            $serverInfo = $this->serverInfo; +            $serverInfo = $this->serverInfo;
146        } else { +        } else {
147            $query      = 'SELECT @@VERSION'; +            $query      = 'SELECT @@VERSION';
148            $serverInfo = $this->fetchOne($query); +            $serverInfo = $this->fetchOne($query);
149        } +        }
150        // cache server_info +        // cache server_info
151        $this->serverInfo = $serverInfo; +        $this->serverInfo = $serverInfo;
152        if ( ! $native) { +        if ( ! $native) {
153            if (preg_match('/([0-9]+)\.([0-9]+)\.([0-9]+)/', $serverInfo, $tmp)) { +            if (preg_match('/([0-9]+)\.([0-9]+)\.([0-9]+)/', $serverInfo, $tmp)) {
154                $serverInfo = array( +                $serverInfo = array(
155                    'major' => $tmp[1], +                    'major' => $tmp[1],
156                    'minor' => $tmp[2], +                    'minor' => $tmp[2],
157                    'patch' => $tmp[3], +                    'patch' => $tmp[3],
158                    'extra' => null, +                    'extra' => null,
159                    'native' => $serverInfo, +                    'native' => $serverInfo,
160                ); +                );
161            } else { +            } else {
162                $serverInfo = array( +                $serverInfo = array(
163                    'major' => null, +                    'major' => null,
164                    'minor' => null, +                    'minor' => null,
165                    'patch' => null, +                    'patch' => null,
166                    'extra' => null, +                    'extra' => null,
167                    'native' => $serverInfo, +                    'native' => $serverInfo,
168                ); +                );
169            } +            }
170        } +        }
171        return $serverInfo; +        return $serverInfo;
172    } +    }
173 +
174    /** +    /**
175     * Checks if there's a sequence that exists. +     * Checks if there's a sequence that exists.
176     * +     *
177     * @param  string $seq_name     The sequence name to verify. +     * @param  string $seq_name     The sequence name to verify.
178     * @return boolean              The value if the table exists or not +     * @return boolean              The value if the table exists or not
179     */ +     */
180    public function checkSequence($seqName) +    public function checkSequence($seqName)
181    { +    {
182        $query = 'SELECT * FROM ' . $seqName; +        $query = 'SELECT * FROM ' . $seqName;
183        try { +        try {
184            $this->exec($query); +            $this->exec($query);
185        } catch(Doctrine_Connection_Exception $e) { +        } catch(Doctrine_Connection_Exception $e) {
186            if ($e->getPortableCode() == Doctrine::ERR_NOSUCHTABLE) { +            if ($e->getPortableCode() == Doctrine::ERR_NOSUCHTABLE) {
187                return false; +                return false;
188            } +            }
189 +
190            throw $e; +            throw $e;
191        } +        }
192        return true; +        return true;
193    } +    }
194 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Connection_Mysql.html b/tests_old/coverage/Doctrine_Connection_Mysql.html index 25f98e148..8f127ba93 100644 --- a/tests_old/coverage/Doctrine_Connection_Mysql.html +++ b/tests_old/coverage/Doctrine_Connection_Mysql.html @@ -10,630 +10,630 @@

Coverage for Doctrine_Connection_Mysql

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Exception.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Exception.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Connection_Exception'); +Doctrine::autoload('Doctrine_Connection_Exception');
22/** +/**
23 * Doctrine_Connection_Mssql_Exception + * Doctrine_Connection_Mssql_Exception
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Connection + * @subpackage  Connection
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
29 * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library) + * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
30 * @since       1.0 + * @since       1.0
31 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
32 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
33 */ + */
34class Doctrine_Connection_Mssql_Exception extends Doctrine_Connection_Exception +class Doctrine_Connection_Mssql_Exception extends Doctrine_Connection_Exception
35{ +{
36    /** +    /**
37     * @var array $errorCodeMap         an array that is used for determining portable +     * @var array $errorCodeMap         an array that is used for determining portable
38     *                                  error code from a native database error code +     *                                  error code from a native database error code
39     */ +     */
40    protected static $errorCodeMap = array( +    protected static $errorCodeMap = array(
41                                      110   => Doctrine::ERR_VALUE_COUNT_ON_ROW, +                                      110   => Doctrine::ERR_VALUE_COUNT_ON_ROW,
42                                      155   => Doctrine::ERR_NOSUCHFIELD, +                                      155   => Doctrine::ERR_NOSUCHFIELD,
43                                      170   => Doctrine::ERR_SYNTAX, +                                      170   => Doctrine::ERR_SYNTAX,
44                                      207   => Doctrine::ERR_NOSUCHFIELD, +                                      207   => Doctrine::ERR_NOSUCHFIELD,
45                                      208   => Doctrine::ERR_NOSUCHTABLE, +                                      208   => Doctrine::ERR_NOSUCHTABLE,
46                                      245   => Doctrine::ERR_INVALID_NUMBER, +                                      245   => Doctrine::ERR_INVALID_NUMBER,
47                                      515   => Doctrine::ERR_CONSTRAINT_NOT_NULL, +                                      515   => Doctrine::ERR_CONSTRAINT_NOT_NULL,
48                                      547   => Doctrine::ERR_CONSTRAINT, +                                      547   => Doctrine::ERR_CONSTRAINT,
49                                      1913  => Doctrine::ERR_ALREADY_EXISTS, +                                      1913  => Doctrine::ERR_ALREADY_EXISTS,
50                                      2627  => Doctrine::ERR_CONSTRAINT, +                                      2627  => Doctrine::ERR_CONSTRAINT,
51                                      2714  => Doctrine::ERR_ALREADY_EXISTS, +                                      2714  => Doctrine::ERR_ALREADY_EXISTS,
52                                      3701  => Doctrine::ERR_NOSUCHTABLE, +                                      3701  => Doctrine::ERR_NOSUCHTABLE,
53                                      8134  => Doctrine::ERR_DIVZERO, +                                      8134  => Doctrine::ERR_DIVZERO,
54                                      ); +                                      );
55 +
56    /** +    /**
57     * This method checks if native error code/message can be +     * This method checks if native error code/message can be
58     * converted into a portable code and then adds this +     * converted into a portable code and then adds this
59     * portable error code to $portableCode field +     * portable error code to $portableCode field
60     * +     *
61     * @param array $errorInfo      error info array +     * @param array $errorInfo      error info array
62     * @since 1.0 +     * @since 1.0
63     * @return boolean              whether or not the error info processing was successfull +     * @return boolean              whether or not the error info processing was successfull
64     *                              (the process is successfull if portable error code was found) +     *                              (the process is successfull if portable error code was found)
65     */ +     */
66    public function processErrorInfo(array $errorInfo) +    public function processErrorInfo(array $errorInfo)
67    { +    {
68        $code = $errorInfo[1]; +        $code = $errorInfo[1];
69        if (isset(self::$errorCodeMap[$code])) { +        if (isset(self::$errorCodeMap[$code])) {
70            $this->portableCode = self::$errorCodeMap[$code]; +            $this->portableCode = self::$errorCodeMap[$code];
71            return true; +            return true;
72        } +        }
73        return false; +        return false;
74    } +    }
75 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: Mysql.php 3183 2007-11-18 16:06:37Z romanb $ + *  $Id: Mysql.php 3183 2007-11-18 16:06:37Z romanb $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Connection_Common'); +Doctrine::autoload('Doctrine_Connection_Common');
22/** +/**
23 * Doctrine_Connection_Mysql + * Doctrine_Connection_Mysql
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Connection + * @subpackage  Connection
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
29 * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library) + * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
30 * @version     $Revision: 3183 $ + * @version     $Revision: 3183 $
31 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
32 * @since       1.0 + * @since       1.0
33 */ + */
34class Doctrine_Connection_Mysql extends Doctrine_Connection_Common +class Doctrine_Connection_Mysql extends Doctrine_Connection_Common
35{ +{
36    /** +    /**
37     * @var string $driverName                  the name of this connection driver +     * @var string $driverName                  the name of this connection driver
38     */ +     */
39    protected $driverName = 'Mysql'; +    protected $driverName = 'Mysql';
40 +
41    /** +    /**
42     * the constructor +     * the constructor
43     * +     *
44     * @param Doctrine_Manager $manager +     * @param Doctrine_Manager $manager
45     * @param PDO|Doctrine_Adapter $adapter     database handler +     * @param PDO|Doctrine_Adapter $adapter     database handler
46     */ +     */
47    public function __construct(Doctrine_Manager $manager, $adapter) +    public function __construct(Doctrine_Manager $manager, $adapter)
48    { +    {
49        $this->setAttribute(PDO::ATTR_EMULATE_PREPARES, true); +        $this->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
50        $this->setAttribute(Doctrine::ATTR_DEFAULT_TABLE_TYPE, 'INNODB'); +        $this->setAttribute(Doctrine::ATTR_DEFAULT_TABLE_TYPE, 'INNODB');
51 +
52        $this->supported = array( +        $this->supported = array(
53                          'sequences'            => 'emulated', +                          'sequences'            => 'emulated',
54                          'indexes'              => true, +                          'indexes'              => true,
55                          'affected_rows'        => true, +                          'affected_rows'        => true,
56                          'transactions'         => true, +                          'transactions'         => true,
57                          'savepoints'           => false, +                          'savepoints'           => false,
58                          'summary_functions'    => true, +                          'summary_functions'    => true,
59                          'order_by_text'        => true, +                          'order_by_text'        => true,
60                          'current_id'           => 'emulated', +                          'current_id'           => 'emulated',
61                          'limit_queries'        => true, +                          'limit_queries'        => true,
62                          'LOBs'                 => true, +                          'LOBs'                 => true,
63                          'replace'              => true, +                          'replace'              => true,
64                          'sub_selects'          => true, +                          'sub_selects'          => true,
65                          'auto_increment'       => true, +                          'auto_increment'       => true,
66                          'primary_key'          => true, +                          'primary_key'          => true,
67                          'result_introspection' => true, +                          'result_introspection' => true,
68                          'prepared_statements'  => 'emulated', +                          'prepared_statements'  => 'emulated',
69                          'identifier_quoting'   => true, +                          'identifier_quoting'   => true,
70                          'pattern_escaping'     => true +                          'pattern_escaping'     => true
71                          ); +                          );
72 +
73        $this->properties['string_quoting'] = array('start' => "'", +        $this->properties['string_quoting'] = array('start' => "'",
74                                                    'end' => "'", +                                                    'end' => "'",
75                                                    'escape' => '\\', +                                                    'escape' => '\\',
76                                                    'escape_pattern' => '\\'); +                                                    'escape_pattern' => '\\');
77 +
78        $this->properties['identifier_quoting'] = array('start' => '`', +        $this->properties['identifier_quoting'] = array('start' => '`',
79                                                        'end' => '`', +                                                        'end' => '`',
80                                                        'escape' => '`'); +                                                        'escape' => '`');
81 +
82        $this->properties['sql_comments'] = array( +        $this->properties['sql_comments'] = array(
83                                            array('start' => '-- ', 'end' => "\n", 'escape' => false), +                                            array('start' => '-- ', 'end' => "\n", 'escape' => false),
84                                            array('start' => '#', 'end' => "\n", 'escape' => false), +                                            array('start' => '#', 'end' => "\n", 'escape' => false),
85                                            array('start' => '/*', 'end' => '*/', 'escape' => false), +                                            array('start' => '/*', 'end' => '*/', 'escape' => false),
86                                            ); +                                            );
87 +
88        $this->properties['varchar_max_length'] = 255; +        $this->properties['varchar_max_length'] = 255;
89 +
90        parent::__construct($manager, $adapter); +        parent::__construct($manager, $adapter);
91    } +    }
92 +
93    /** +    /**
94     * Set the charset on the current connection +     * Set the charset on the current connection
95     * +     *
96     * @param string    charset +     * @param string    charset
97     */ +     */
98    public function setCharset($charset) +    public function setCharset($charset)
99    { +    {
100        $query = 'SET NAMES ' . $this->quote($charset); +        $query = 'SET NAMES ' . $this->quote($charset);
101 +
102        $this->exec($query); +        $this->exec($query);
103    } +    }
104 +
105    /** +    /**
106     * Execute a SQL REPLACE query. A REPLACE query is identical to a INSERT +     * Execute a SQL REPLACE query. A REPLACE query is identical to a INSERT
107     * query, except that if there is already a row in the table with the same +     * query, except that if there is already a row in the table with the same
108     * key field values, the REPLACE query just updates its values instead of +     * key field values, the REPLACE query just updates its values instead of
109     * inserting a new row. +     * inserting a new row.
110     * +     *
111     * The REPLACE type of query does not make part of the SQL standards. Since +     * The REPLACE type of query does not make part of the SQL standards. Since
112     * practically only MySQL implements it natively, this type of query is +     * practically only MySQL implements it natively, this type of query is
113     * emulated through this method for other DBMS using standard types of +     * emulated through this method for other DBMS using standard types of
114     * queries inside a transaction to assure the atomicity of the operation. +     * queries inside a transaction to assure the atomicity of the operation.
115     * +     *
116     * @access public +     * @access public
117     * +     *
118     * @param string $table name of the table on which the REPLACE query will +     * @param string $table name of the table on which the REPLACE query will
119     *  be executed. +     *  be executed.
120     * @param array $fields associative array that describes the fields and the +     * @param array $fields associative array that describes the fields and the
121     *  values that will be inserted or updated in the specified table. The +     *  values that will be inserted or updated in the specified table. The
122     *  indexes of the array are the names of all the fields of the table. The +     *  indexes of the array are the names of all the fields of the table. The
123     *  values of the array are also associative arrays that describe the +     *  values of the array are also associative arrays that describe the
124     *  values and other properties of the table fields. +     *  values and other properties of the table fields.
125     * +     *
126     *  Here follows a list of field properties that need to be specified: +     *  Here follows a list of field properties that need to be specified:
127     * +     *
128     *    value: +     *    value:
129     *          Value to be assigned to the specified field. This value may be +     *          Value to be assigned to the specified field. This value may be
130     *          of specified in database independent type format as this +     *          of specified in database independent type format as this
131     *          function can perform the necessary datatype conversions. +     *          function can perform the necessary datatype conversions.
132     * +     *
133     *    Default: +     *    Default:
134     *          this property is required unless the Null property +     *          this property is required unless the Null property
135     *          is set to 1. +     *          is set to 1.
136     * +     *
137     *    type +     *    type
138     *          Name of the type of the field. Currently, all types Metabase +     *          Name of the type of the field. Currently, all types Metabase
139     *          are supported except for clob and blob. +     *          are supported except for clob and blob.
140     * +     *
141     *    Default: no type conversion +     *    Default: no type conversion
142     * +     *
143     *    null +     *    null
144     *          Boolean property that indicates that the value for this field +     *          Boolean property that indicates that the value for this field
145     *          should be set to null. +     *          should be set to null.
146     * +     *
147     *          The default value for fields missing in INSERT queries may be +     *          The default value for fields missing in INSERT queries may be
148     *          specified the definition of a table. Often, the default value +     *          specified the definition of a table. Often, the default value
149     *          is already null, but since the REPLACE may be emulated using +     *          is already null, but since the REPLACE may be emulated using
150     *          an UPDATE query, make sure that all fields of the table are +     *          an UPDATE query, make sure that all fields of the table are
151     *          listed in this function argument array. +     *          listed in this function argument array.
152     * +     *
153     *    Default: 0 +     *    Default: 0
154     * +     *
155     *    key +     *    key
156     *          Boolean property that indicates that this field should be +     *          Boolean property that indicates that this field should be
157     *          handled as a primary key or at least as part of the compound +     *          handled as a primary key or at least as part of the compound
158     *          unique index of the table that will determine the row that will +     *          unique index of the table that will determine the row that will
159     *          updated if it exists or inserted a new row otherwise. +     *          updated if it exists or inserted a new row otherwise.
160     * +     *
161     *          This function will fail if no key field is specified or if the +     *          This function will fail if no key field is specified or if the
162     *          value of a key field is set to null because fields that are +     *          value of a key field is set to null because fields that are
163     *          part of unique index they may not be null. +     *          part of unique index they may not be null.
164     * +     *
165     *    Default: 0 +     *    Default: 0
166     * +     *
167     * @return integer      the number of affected rows +     * @return integer      the number of affected rows
168     */ +     */
169    public function replace(Doctrine_Table $table, array $fields, array $keys) +    public function replace(Doctrine_Table $table, array $fields, array $keys)
170    { +    {
171        $count = count($fields); +        $count = count($fields);
172        $query = $values = ''; +        $query = $values = '';
173        $keys = $colnum = 0; +        $keys = $colnum = 0;
174 +
175        for (reset($fields); $colnum < $count; next($fields), $colnum++) { +        for (reset($fields); $colnum < $count; next($fields), $colnum++) {
176            $name = key($fields); +            $name = key($fields);
177 +
178            if ($colnum > 0) { +            if ($colnum > 0) {
179                $query .= ','; +                $query .= ',';
180                $values.= ','; +                $values.= ',';
181            } +            }
182 +
183            $query .= $table->getColumnName($name); +            $query .= $table->getColumnName($name);
184 +
185            if (isset($fields[$name]['null']) && $fields[$name]['null']) { +            if (isset($fields[$name]['null']) && $fields[$name]['null']) {
186                $value = 'NULL'; +                $value = 'NULL';
187            } else { +            } else {
188                $type = isset($fields[$name]['type']) ? $fields[$name]['type'] : null; +                $type = isset($fields[$name]['type']) ? $fields[$name]['type'] : null;
189                $value = $this->quote($fields[$name]['value'], $type); +                $value = $this->quote($fields[$name]['value'], $type);
190            } +            }
191 +
192            $values .= $value; +            $values .= $value;
193 +
194            if (isset($fields[$name]['key']) && $fields[$name]['key']) { +            if (isset($fields[$name]['key']) && $fields[$name]['key']) {
195                if ($value === 'NULL') { +                if ($value === 'NULL') {
196                    throw new Doctrine_Connection_Mysql_Exception('key value '.$name.' may not be NULL'); +                    throw new Doctrine_Connection_Mysql_Exception('key value '.$name.' may not be NULL');
197                } +                }
198                $keys++; +                $keys++;
199            } +            }
200        } +        }
201 +
202        if ($keys == 0) { +        if ($keys == 0) {
203            throw new Doctrine_Connection_Mysql_Exception('not specified which fields are keys'); +            throw new Doctrine_Connection_Mysql_Exception('not specified which fields are keys');
204        } +        }
205        $query = 'REPLACE INTO ' . $table->getTableName() . ' (' . $query . ') VALUES (' . $values . ')'; +        $query = 'REPLACE INTO ' . $table->getTableName() . ' (' . $query . ') VALUES (' . $values . ')';
206 +
207        return $this->exec($query); +        return $this->exec($query);
208    } +    }
209} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Connection_Mysql_Exception.html b/tests_old/coverage/Doctrine_Connection_Mysql_Exception.html index 4ed85af40..f73a7dc32 100644 --- a/tests_old/coverage/Doctrine_Connection_Mysql_Exception.html +++ b/tests_old/coverage/Doctrine_Connection_Mysql_Exception.html @@ -10,256 +10,256 @@

Coverage for Doctrine_Connection_Mysql_Exception

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Connection_Oracle.html b/tests_old/coverage/Doctrine_Connection_Oracle.html index 392695eca..012060f4c 100644 --- a/tests_old/coverage/Doctrine_Connection_Oracle.html +++ b/tests_old/coverage/Doctrine_Connection_Oracle.html @@ -10,355 +10,355 @@

Coverage for Doctrine_Connection_Oracle

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Exception.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Exception.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Connection_Exception'); +Doctrine::autoload('Doctrine_Connection_Exception');
22/** +/**
23 * Doctrine_Connection_Mysql_Exception + * Doctrine_Connection_Mysql_Exception
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Connection + * @subpackage  Connection
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
29 * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library) + * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
30 * @since       1.0 + * @since       1.0
31 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
32 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
33 */ + */
34class Doctrine_Connection_Mysql_Exception extends Doctrine_Connection_Exception +class Doctrine_Connection_Mysql_Exception extends Doctrine_Connection_Exception
35{ +{
36    /** +    /**
37     * @var array $errorCodeMap         an array that is used for determining portable +     * @var array $errorCodeMap         an array that is used for determining portable
38     *                                  error code from a native database error code +     *                                  error code from a native database error code
39     */ +     */
40    protected static $errorCodeMap = array( +    protected static $errorCodeMap = array(
41                                      1004 => Doctrine::ERR_CANNOT_CREATE, +                                      1004 => Doctrine::ERR_CANNOT_CREATE,
42                                      1005 => Doctrine::ERR_CANNOT_CREATE, +                                      1005 => Doctrine::ERR_CANNOT_CREATE,
43                                      1006 => Doctrine::ERR_CANNOT_CREATE, +                                      1006 => Doctrine::ERR_CANNOT_CREATE,
44                                      1007 => Doctrine::ERR_ALREADY_EXISTS, +                                      1007 => Doctrine::ERR_ALREADY_EXISTS,
45                                      1008 => Doctrine::ERR_CANNOT_DROP, +                                      1008 => Doctrine::ERR_CANNOT_DROP,
46                                      1022 => Doctrine::ERR_ALREADY_EXISTS, +                                      1022 => Doctrine::ERR_ALREADY_EXISTS,
47                                      1044 => Doctrine::ERR_ACCESS_VIOLATION, +                                      1044 => Doctrine::ERR_ACCESS_VIOLATION,
48                                      1046 => Doctrine::ERR_NODBSELECTED, +                                      1046 => Doctrine::ERR_NODBSELECTED,
49                                      1048 => Doctrine::ERR_CONSTRAINT, +                                      1048 => Doctrine::ERR_CONSTRAINT,
50                                      1049 => Doctrine::ERR_NOSUCHDB, +                                      1049 => Doctrine::ERR_NOSUCHDB,
51                                      1050 => Doctrine::ERR_ALREADY_EXISTS, +                                      1050 => Doctrine::ERR_ALREADY_EXISTS,
52                                      1051 => Doctrine::ERR_NOSUCHTABLE, +                                      1051 => Doctrine::ERR_NOSUCHTABLE,
53                                      1054 => Doctrine::ERR_NOSUCHFIELD, +                                      1054 => Doctrine::ERR_NOSUCHFIELD,
54                                      1061 => Doctrine::ERR_ALREADY_EXISTS, +                                      1061 => Doctrine::ERR_ALREADY_EXISTS,
55                                      1062 => Doctrine::ERR_ALREADY_EXISTS, +                                      1062 => Doctrine::ERR_ALREADY_EXISTS,
56                                      1064 => Doctrine::ERR_SYNTAX, +                                      1064 => Doctrine::ERR_SYNTAX,
57                                      1091 => Doctrine::ERR_NOT_FOUND, +                                      1091 => Doctrine::ERR_NOT_FOUND,
58                                      1100 => Doctrine::ERR_NOT_LOCKED, +                                      1100 => Doctrine::ERR_NOT_LOCKED,
59                                      1136 => Doctrine::ERR_VALUE_COUNT_ON_ROW, +                                      1136 => Doctrine::ERR_VALUE_COUNT_ON_ROW,
60                                      1142 => Doctrine::ERR_ACCESS_VIOLATION, +                                      1142 => Doctrine::ERR_ACCESS_VIOLATION,
61                                      1146 => Doctrine::ERR_NOSUCHTABLE, +                                      1146 => Doctrine::ERR_NOSUCHTABLE,
62                                      1216 => Doctrine::ERR_CONSTRAINT, +                                      1216 => Doctrine::ERR_CONSTRAINT,
63                                      1217 => Doctrine::ERR_CONSTRAINT, +                                      1217 => Doctrine::ERR_CONSTRAINT,
64                                      ); +                                      );
65 +
66    /** +    /**
67     * This method checks if native error code/message can be +     * This method checks if native error code/message can be
68     * converted into a portable code and then adds this +     * converted into a portable code and then adds this
69     * portable error code to $portableCode field +     * portable error code to $portableCode field
70     * +     *
71     * @param array $errorInfo      error info array +     * @param array $errorInfo      error info array
72     * @since 1.0 +     * @since 1.0
73     * @return boolean              whether or not the error info processing was successfull +     * @return boolean              whether or not the error info processing was successfull
74     *                              (the process is successfull if portable error code was found) +     *                              (the process is successfull if portable error code was found)
75     */ +     */
76    public function processErrorInfo(array $errorInfo) +    public function processErrorInfo(array $errorInfo)
77    { +    {
78        $code = $errorInfo[1]; +        $code = $errorInfo[1];
79        if (isset(self::$errorCodeMap[$code])) { +        if (isset(self::$errorCodeMap[$code])) {
80            $this->portableCode = self::$errorCodeMap[$code]; +            $this->portableCode = self::$errorCodeMap[$code];
81            return true; +            return true;
82        } +        }
83        return false; +        return false;
84    } +    }
85 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Connection_Oracle_Exception.html b/tests_old/coverage/Doctrine_Connection_Oracle_Exception.html index a09710dac..42a520046 100644 --- a/tests_old/coverage/Doctrine_Connection_Oracle_Exception.html +++ b/tests_old/coverage/Doctrine_Connection_Oracle_Exception.html @@ -10,241 +10,241 @@

Coverage for Doctrine_Connection_Oracle_Exception

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Oracle.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Oracle.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Connection'); +Doctrine::autoload('Doctrine_Connection');
22/** +/**
23 * Doctrine_Connection_Oracle + * Doctrine_Connection_Oracle
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Connection + * @subpackage  Connection
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Connection_Oracle extends Doctrine_Connection +class Doctrine_Connection_Oracle extends Doctrine_Connection
34{ +{
35    /** +    /**
36     * @var string $driverName                  the name of this connection driver +     * @var string $driverName                  the name of this connection driver
37     */ +     */
38    protected $driverName = 'Oracle'; +    protected $driverName = 'Oracle';
39 +
40    public function __construct(Doctrine_Manager $manager, $adapter) +    public function __construct(Doctrine_Manager $manager, $adapter)
41    { +    {
42        $this->supported = array( +        $this->supported = array(
43                          'sequences'            => true, +                          'sequences'            => true,
44                          'indexes'              => true, +                          'indexes'              => true,
45                          'summary_functions'    => true, +                          'summary_functions'    => true,
46                          'order_by_text'        => true, +                          'order_by_text'        => true,
47                          'current_id'           => true, +                          'current_id'           => true,
48                          'affected_rows'        => true, +                          'affected_rows'        => true,
49                          'transactions'         => true, +                          'transactions'         => true,
50                          'savepoints'           => true, +                          'savepoints'           => true,
51                          'limit_queries'        => true, +                          'limit_queries'        => true,
52                          'LOBs'                 => true, +                          'LOBs'                 => true,
53                          'replace'              => 'emulated', +                          'replace'              => 'emulated',
54                          'sub_selects'          => true, +                          'sub_selects'          => true,
55                          'auto_increment'       => false, // implementation is broken +                          'auto_increment'       => false, // implementation is broken
56                          'primary_key'          => true, +                          'primary_key'          => true,
57                          'result_introspection' => true, +                          'result_introspection' => true,
58                          'prepared_statements'  => true, +                          'prepared_statements'  => true,
59                          'identifier_quoting'   => true, +                          'identifier_quoting'   => true,
60                          'pattern_escaping'     => true, +                          'pattern_escaping'     => true,
61                          ); +                          );
62        /** +        /**
63        $this->options['DBA_username'] = false; +        $this->options['DBA_username'] = false;
64        $this->options['DBA_password'] = false; +        $this->options['DBA_password'] = false;
65        $this->options['database_name_prefix'] = false; +        $this->options['database_name_prefix'] = false;
66        $this->options['emulate_database'] = true; +        $this->options['emulate_database'] = true;
67        $this->options['default_tablespace'] = false; +        $this->options['default_tablespace'] = false;
68        $this->options['default_text_field_length'] = 2000; +        $this->options['default_text_field_length'] = 2000;
69        $this->options['result_prefetching'] = false; +        $this->options['result_prefetching'] = false;
70        */ +        */
71        parent::__construct($manager, $adapter); +        parent::__construct($manager, $adapter);
72    } +    }
73 +
74    /** +    /**
75     * Sets up the date/time format +     * Sets up the date/time format
76     * +     *
77     */ +     */
78    public function setDateFormat($format = 'YYYY-MM-DD HH24:MI:SS') +    public function setDateFormat($format = 'YYYY-MM-DD HH24:MI:SS')
79    { +    {
80      $this->exec('ALTER SESSION SET NLS_DATE_FORMAT = "' . $format . '"'); +      $this->exec('ALTER SESSION SET NLS_DATE_FORMAT = "' . $format . '"');
81    } +    }
82 +
83    /** +    /**
84     * Adds an driver-specific LIMIT clause to the query +     * Adds an driver-specific LIMIT clause to the query
85     * +     *
86     * @param string $query         query to modify +     * @param string $query         query to modify
87     * @param integer $limit        limit the number of rows +     * @param integer $limit        limit the number of rows
88     * @param integer $offset       start reading from given offset +     * @param integer $offset       start reading from given offset
89     * @return string               the modified query +     * @return string               the modified query
90     */ +     */
91    public function modifyLimitQuery($query, $limit, $offset) +    public function modifyLimitQuery($query, $limit, $offset)
92    { +    {
93        /** +        /**
94        $e      = explode("select ",strtolower($query)); +        $e      = explode("select ",strtolower($query));
95        $e2     = explode(" from ",$e[1]); +        $e2     = explode(" from ",$e[1]);
96        $fields = $e2[0]; +        $fields = $e2[0];
97        */ +        */
98        $limit = (int) $limit; +        $limit = (int) $limit;
99        $offset = (int) $offset; +        $offset = (int) $offset;
100        if (preg_match('/^\s*SELECT/i', $query)) { +        if (preg_match('/^\s*SELECT/i', $query)) {
101            if ( ! preg_match('/\sFROM\s/i', $query)) { +            if ( ! preg_match('/\sFROM\s/i', $query)) {
102                $query .= " FROM dual"; +                $query .= " FROM dual";
103            } +            }
104            if ($limit > 0) { +            if ($limit > 0) {
105                // taken from http://svn.ez.no/svn/ezcomponents/packages/Database +                // taken from http://svn.ez.no/svn/ezcomponents/packages/Database
106                $max = $offset + $limit; +                $max = $offset + $limit;
107                if ($offset > 0) { +                if ($offset > 0) {
108                    $min = $offset + 1; +                    $min = $offset + 1;
109                    $query = 'SELECT * FROM (SELECT a.*, ROWNUM dctrn_rownum FROM (' . $query +                    $query = 'SELECT * FROM (SELECT a.*, ROWNUM dctrn_rownum FROM (' . $query
110                           . ') a WHERE ROWNUM <= ' . $max . ') WHERE dctrn_rownum >= ' . $min; +                           . ') a WHERE ROWNUM <= ' . $max . ') WHERE dctrn_rownum >= ' . $min;
111                } else { +                } else {
112                    $query = 'SELECT a.* FROM (' . $query .') a WHERE ROWNUM <= ' . $max; +                    $query = 'SELECT a.* FROM (' . $query .') a WHERE ROWNUM <= ' . $max;
113                } +                }
114            } +            }
115        } +        }
116        return $query; +        return $query;
117    } +    }
118 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Connection_Pgsql.html b/tests_old/coverage/Doctrine_Connection_Pgsql.html index 47f92b921..e7a2f09fa 100644 --- a/tests_old/coverage/Doctrine_Connection_Pgsql.html +++ b/tests_old/coverage/Doctrine_Connection_Pgsql.html @@ -10,586 +10,586 @@

Coverage for Doctrine_Connection_Pgsql

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Exception.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Exception.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Connection_Exception'); +Doctrine::autoload('Doctrine_Connection_Exception');
22/** +/**
23 * Doctrine_Connection_Oracle_Exception + * Doctrine_Connection_Oracle_Exception
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Connection + * @subpackage  Connection
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
29 * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library) + * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
30 * @since       1.0 + * @since       1.0
31 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
32 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
33 */ + */
34class Doctrine_Connection_Oracle_Exception extends Doctrine_Connection_Exception +class Doctrine_Connection_Oracle_Exception extends Doctrine_Connection_Exception
35{ +{
36    /** +    /**
37     * @var array $errorCodeMap         an array that is used for determining portable +     * @var array $errorCodeMap         an array that is used for determining portable
38     *                                  error code from a native database error code +     *                                  error code from a native database error code
39     */ +     */
40    protected static $errorCodeMap = array( +    protected static $errorCodeMap = array(
41                                      1    => Doctrine::ERR_CONSTRAINT, +                                      1    => Doctrine::ERR_CONSTRAINT,
42                                      900  => Doctrine::ERR_SYNTAX, +                                      900  => Doctrine::ERR_SYNTAX,
43                                      904  => Doctrine::ERR_NOSUCHFIELD, +                                      904  => Doctrine::ERR_NOSUCHFIELD,
44                                      913  => Doctrine::ERR_VALUE_COUNT_ON_ROW, +                                      913  => Doctrine::ERR_VALUE_COUNT_ON_ROW,
45                                      921  => Doctrine::ERR_SYNTAX, +                                      921  => Doctrine::ERR_SYNTAX,
46                                      923  => Doctrine::ERR_SYNTAX, +                                      923  => Doctrine::ERR_SYNTAX,
47                                      942  => Doctrine::ERR_NOSUCHTABLE, +                                      942  => Doctrine::ERR_NOSUCHTABLE,
48                                      955  => Doctrine::ERR_ALREADY_EXISTS, +                                      955  => Doctrine::ERR_ALREADY_EXISTS,
49                                      1400 => Doctrine::ERR_CONSTRAINT_NOT_NULL, +                                      1400 => Doctrine::ERR_CONSTRAINT_NOT_NULL,
50                                      1401 => Doctrine::ERR_INVALID, +                                      1401 => Doctrine::ERR_INVALID,
51                                      1407 => Doctrine::ERR_CONSTRAINT_NOT_NULL, +                                      1407 => Doctrine::ERR_CONSTRAINT_NOT_NULL,
52                                      1418 => Doctrine::ERR_NOT_FOUND, +                                      1418 => Doctrine::ERR_NOT_FOUND,
53                                      1476 => Doctrine::ERR_DIVZERO, +                                      1476 => Doctrine::ERR_DIVZERO,
54                                      1722 => Doctrine::ERR_INVALID_NUMBER, +                                      1722 => Doctrine::ERR_INVALID_NUMBER,
55                                      2289 => Doctrine::ERR_NOSUCHTABLE, +                                      2289 => Doctrine::ERR_NOSUCHTABLE,
56                                      2291 => Doctrine::ERR_CONSTRAINT, +                                      2291 => Doctrine::ERR_CONSTRAINT,
57                                      2292 => Doctrine::ERR_CONSTRAINT, +                                      2292 => Doctrine::ERR_CONSTRAINT,
58                                      2449 => Doctrine::ERR_CONSTRAINT, +                                      2449 => Doctrine::ERR_CONSTRAINT,
59                                      ); +                                      );
60 +
61    /** +    /**
62     * This method checks if native error code/message can be +     * This method checks if native error code/message can be
63     * converted into a portable code and then adds this +     * converted into a portable code and then adds this
64     * portable error code to $portableCode field +     * portable error code to $portableCode field
65     * +     *
66     * @param array $errorInfo      error info array +     * @param array $errorInfo      error info array
67     * @since 1.0 +     * @since 1.0
68     * @return boolean              whether or not the error info processing was successfull +     * @return boolean              whether or not the error info processing was successfull
69     *                              (the process is successfull if portable error code was found) +     *                              (the process is successfull if portable error code was found)
70     */ +     */
71    public function processErrorInfo(array $errorInfo) +    public function processErrorInfo(array $errorInfo)
72    { +    {
73        $code = $errorInfo[1]; +        $code = $errorInfo[1];
74        if (isset(self::$errorCodeMap[$code])) { +        if (isset(self::$errorCodeMap[$code])) {
75            $this->portableCode = self::$errorCodeMap[$code]; +            $this->portableCode = self::$errorCodeMap[$code];
76            return true; +            return true;
77        } +        }
78        return false; +        return false;
79    } +    }
80 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Connection_Pgsql_Exception.html b/tests_old/coverage/Doctrine_Connection_Pgsql_Exception.html index 2fbd9cc42..000a8367d 100644 --- a/tests_old/coverage/Doctrine_Connection_Pgsql_Exception.html +++ b/tests_old/coverage/Doctrine_Connection_Pgsql_Exception.html @@ -10,325 +10,325 @@

Coverage for Doctrine_Connection_Pgsql_Exception

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Pgsql.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Pgsql.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload("Doctrine_Connection_Common"); +Doctrine::autoload("Doctrine_Connection_Common");
22/** +/**
23 * Doctrine_Connection_Pgsql + * Doctrine_Connection_Pgsql
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Connection + * @subpackage  Connection
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
29 * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library) + * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
30 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
31 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
32 * @since       1.0 + * @since       1.0
33 */ + */
34class Doctrine_Connection_Pgsql extends Doctrine_Connection_Common +class Doctrine_Connection_Pgsql extends Doctrine_Connection_Common
35{ +{
36    /** +    /**
37     * @var string $driverName                  the name of this connection driver +     * @var string $driverName                  the name of this connection driver
38     */ +     */
39    protected $driverName = 'Pgsql'; +    protected $driverName = 'Pgsql';
40 +
41    /** +    /**
42     * the constructor +     * the constructor
43     * +     *
44     * @param Doctrine_Manager $manager +     * @param Doctrine_Manager $manager
45     * @param PDO $pdo                          database handle +     * @param PDO $pdo                          database handle
46     */ +     */
47    public function __construct(Doctrine_Manager $manager, $adapter) +    public function __construct(Doctrine_Manager $manager, $adapter)
48    { +    {
49        // initialize all driver options +        // initialize all driver options
50        $this->supported = array( +        $this->supported = array(
51                          'sequences'               => true, +                          'sequences'               => true,
52                          'indexes'                 => true, +                          'indexes'                 => true,
53                          'affected_rows'           => true, +                          'affected_rows'           => true,
54                          'summary_functions'       => true, +                          'summary_functions'       => true,
55                          'order_by_text'           => true, +                          'order_by_text'           => true,
56                          'transactions'            => true, +                          'transactions'            => true,
57                          'savepoints'              => true, +                          'savepoints'              => true,
58                          'current_id'              => true, +                          'current_id'              => true,
59                          'limit_queries'           => true, +                          'limit_queries'           => true,
60                          'LOBs'                    => true, +                          'LOBs'                    => true,
61                          'replace'                 => 'emulated', +                          'replace'                 => 'emulated',
62                          'sub_selects'             => true, +                          'sub_selects'             => true,
63                          'auto_increment'          => 'emulated', +                          'auto_increment'          => 'emulated',
64                          'primary_key'             => true, +                          'primary_key'             => true,
65                          'result_introspection'    => true, +                          'result_introspection'    => true,
66                          'prepared_statements'     => true, +                          'prepared_statements'     => true,
67                          'identifier_quoting'      => true, +                          'identifier_quoting'      => true,
68                          'pattern_escaping'        => true, +                          'pattern_escaping'        => true,
69                          ); +                          );
70 +
71        $this->properties['string_quoting'] = array('start' => "'", +        $this->properties['string_quoting'] = array('start' => "'",
72                                                    'end' => "'", +                                                    'end' => "'",
73                                                    'escape' => "'", +                                                    'escape' => "'",
74                                                    'escape_pattern' => '\\'); +                                                    'escape_pattern' => '\\');
75 +
76        $this->properties['identifier_quoting'] = array('start' => '"', +        $this->properties['identifier_quoting'] = array('start' => '"',
77                                                        'end' => '"', +                                                        'end' => '"',
78                                                        'escape' => '"'); +                                                        'escape' => '"');
79        parent::__construct($manager, $adapter); +        parent::__construct($manager, $adapter);
80    } +    }
81 +
82    /** +    /**
83     * Set the charset on the current connection +     * Set the charset on the current connection
84     * +     *
85     * @param string    charset +     * @param string    charset
86     * +     *
87     * @return void +     * @return void
88     */ +     */
89    public function setCharset($charset) +    public function setCharset($charset)
90    { +    {
91        $query = 'SET NAMES '.$this->dbh->quote($charset); +        $query = 'SET NAMES '.$this->dbh->quote($charset);
92        $this->exec($query); +        $this->exec($query);
93    } +    }
94 +
95    /** +    /**
96     * convertBoolean +     * convertBoolean
97     * some drivers need the boolean values to be converted into integers +     * some drivers need the boolean values to be converted into integers
98     * when using DQL API +     * when using DQL API
99     * +     *
100     * This method takes care of that conversion +     * This method takes care of that conversion
101     * +     *
102     * @param array $item +     * @param array $item
103     * @return void +     * @return void
104     */ +     */
105    public function convertBooleans($item) +    public function convertBooleans($item)
106    { +    {
107        if (is_array($item)) { +        if (is_array($item)) {
108            foreach ($item as $key => $value) { +            foreach ($item as $key => $value) {
109                if (is_bool($value)) { +                if (is_bool($value)) {
110                    $item[$key] = ($value) ? 'true' : 'false'; +                    $item[$key] = ($value) ? 'true' : 'false';
111                } +                }
112            } +            }
113        } else { +        } else {
114           if (is_bool($item)) { +           if (is_bool($item)) {
115               $item = ($item) ? 'true' : 'false'; +               $item = ($item) ? 'true' : 'false';
116           } +           }
117        } +        }
118        return $item; +        return $item;
119    } +    }
120 +
121    /** +    /**
122     * Changes a query string for various DBMS specific reasons +     * Changes a query string for various DBMS specific reasons
123     * +     *
124     * @param string $query         query to modify +     * @param string $query         query to modify
125     * @param integer $limit        limit the number of rows +     * @param integer $limit        limit the number of rows
126     * @param integer $offset       start reading from given offset +     * @param integer $offset       start reading from given offset
127     * @param boolean $isManip      if the query is a DML query +     * @param boolean $isManip      if the query is a DML query
128     * @return string               modified query +     * @return string               modified query
129     */ +     */
130    public function modifyLimitQuery($query, $limit = false, $offset = false, $isManip = false) +    public function modifyLimitQuery($query, $limit = false, $offset = false, $isManip = false)
131    { +    {
132        if ($limit > 0) { +        if ($limit > 0) {
133            $query = rtrim($query); +            $query = rtrim($query);
134 +
135            if (substr($query, -1) == ';') { +            if (substr($query, -1) == ';') {
136                $query = substr($query, 0, -1); +                $query = substr($query, 0, -1);
137            } +            }
138 +
139            if ($isManip) { +            if ($isManip) {
140                $manip = preg_replace('/^(DELETE FROM|UPDATE).*$/', '\\1', $query); +                $manip = preg_replace('/^(DELETE FROM|UPDATE).*$/', '\\1', $query);
141                $from  = $match[2]; +                $from  = $match[2];
142                $where = $match[3]; +                $where = $match[3];
143                $query = $manip . ' ' . $from . ' WHERE ctid=(SELECT ctid FROM ' +                $query = $manip . ' ' . $from . ' WHERE ctid=(SELECT ctid FROM '
144                       . $from . ' ' . $where . ' LIMIT ' . $limit . ')'; +                       . $from . ' ' . $where . ' LIMIT ' . $limit . ')';
145 +
146            } else { +            } else {
147                if ( ! empty($limit)) { +                if ( ! empty($limit)) {
148                  $query .= ' LIMIT ' . $limit; +                  $query .= ' LIMIT ' . $limit;
149                } +                }
150                if ( ! empty($offset)) { +                if ( ! empty($offset)) {
151                  $query .= ' OFFSET ' . $offset; +                  $query .= ' OFFSET ' . $offset;
152                } +                }
153            } +            }
154        } +        }
155        return $query; +        return $query;
156    } +    }
157 +
158    /** +    /**
159     * return version information about the server +     * return version information about the server
160     * +     *
161     * @param string $native    determines if the raw version string should be returned +     * @param string $native    determines if the raw version string should be returned
162     * @return array|string     an array or string with version information +     * @return array|string     an array or string with version information
163     */ +     */
164    public function getServerVersion($native = false) +    public function getServerVersion($native = false)
165    { +    {
166        $query = 'SHOW SERVER_VERSION'; +        $query = 'SHOW SERVER_VERSION';
167 +
168        $serverInfo = $this->fetchOne($query); +        $serverInfo = $this->fetchOne($query);
169 +
170        if ( ! $native) { +        if ( ! $native) {
171            $tmp = explode('.', $serverInfo, 3); +            $tmp = explode('.', $serverInfo, 3);
172 +
173            if (empty($tmp[2]) && isset($tmp[1]) +            if (empty($tmp[2]) && isset($tmp[1])
174                && preg_match('/(\d+)(.*)/', $tmp[1], $tmp2) +                && preg_match('/(\d+)(.*)/', $tmp[1], $tmp2)
175            ) { +            ) {
176                $serverInfo = array( +                $serverInfo = array(
177                    'major' => $tmp[0], +                    'major' => $tmp[0],
178                    'minor' => $tmp2[1], +                    'minor' => $tmp2[1],
179                    'patch' => null, +                    'patch' => null,
180                    'extra' => $tmp2[2], +                    'extra' => $tmp2[2],
181                    'native' => $serverInfo, +                    'native' => $serverInfo,
182                ); +                );
183            } else { +            } else {
184                $serverInfo = array( +                $serverInfo = array(
185                    'major' => isset($tmp[0]) ? $tmp[0] : null, +                    'major' => isset($tmp[0]) ? $tmp[0] : null,
186                    'minor' => isset($tmp[1]) ? $tmp[1] : null, +                    'minor' => isset($tmp[1]) ? $tmp[1] : null,
187                    'patch' => isset($tmp[2]) ? $tmp[2] : null, +                    'patch' => isset($tmp[2]) ? $tmp[2] : null,
188                    'extra' => null, +                    'extra' => null,
189                    'native' => $serverInfo, +                    'native' => $serverInfo,
190                ); +                );
191            } +            }
192        } +        }
193        return $serverInfo; +        return $serverInfo;
194    } +    }
195 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Connection_Profiler.html b/tests_old/coverage/Doctrine_Connection_Profiler.html index 59502767e..d5646324d 100644 --- a/tests_old/coverage/Doctrine_Connection_Profiler.html +++ b/tests_old/coverage/Doctrine_Connection_Profiler.html @@ -10,550 +10,550 @@

Coverage for Doctrine_Connection_Profiler

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Exception.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Exception.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Connection_Exception'); +Doctrine::autoload('Doctrine_Connection_Exception');
22/** +/**
23 * Doctrine_Connection_Pgsql_Exception + * Doctrine_Connection_Pgsql_Exception
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Connection + * @subpackage  Connection
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
30 * @author      Paul Cooper <pgc@ucecom.com> (PEAR MDB2 Pgsql driver) + * @author      Paul Cooper <pgc@ucecom.com> (PEAR MDB2 Pgsql driver)
31 * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library) + * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
32 * @since       1.0 + * @since       1.0
33 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
34 */ + */
35class Doctrine_Connection_Pgsql_Exception extends Doctrine_Connection_Exception +class Doctrine_Connection_Pgsql_Exception extends Doctrine_Connection_Exception
36{ +{
37    /** +    /**
38     * @var array $errorRegexps         an array that is used for determining portable +     * @var array $errorRegexps         an array that is used for determining portable
39     *                                  error code from a native database error message +     *                                  error code from a native database error message
40     */ +     */
41    protected static $errorRegexps = array( +    protected static $errorRegexps = array(
42                                    '/parser: parse error at or near/i' +                                    '/parser: parse error at or near/i'
43                                        => Doctrine::ERR_SYNTAX, +                                        => Doctrine::ERR_SYNTAX,
44                                    '/syntax error at/' +                                    '/syntax error at/'
45                                        => Doctrine::ERR_SYNTAX, +                                        => Doctrine::ERR_SYNTAX,
46                                    '/column reference .* is ambiguous/i' +                                    '/column reference .* is ambiguous/i'
47                                        => Doctrine::ERR_SYNTAX, +                                        => Doctrine::ERR_SYNTAX,
48                                    '/column .* (of relation .*)?does not exist/i' +                                    '/column .* (of relation .*)?does not exist/i'
49                                        => Doctrine::ERR_NOSUCHFIELD, +                                        => Doctrine::ERR_NOSUCHFIELD,
50                                    '/attribute .* not found|relation .* does not have attribute/i' +                                    '/attribute .* not found|relation .* does not have attribute/i'
51                                        => Doctrine::ERR_NOSUCHFIELD, +                                        => Doctrine::ERR_NOSUCHFIELD,
52                                    '/column .* specified in USING clause does not exist in (left|right) table/i' +                                    '/column .* specified in USING clause does not exist in (left|right) table/i'
53                                        => Doctrine::ERR_NOSUCHFIELD, +                                        => Doctrine::ERR_NOSUCHFIELD,
54                                    '/(relation|sequence|table).*does not exist|class .* not found/i' +                                    '/(relation|sequence|table).*does not exist|class .* not found/i'
55                                        => Doctrine::ERR_NOSUCHTABLE, +                                        => Doctrine::ERR_NOSUCHTABLE,
56                                    '/index .* does not exist/' +                                    '/index .* does not exist/'
57                                        => Doctrine::ERR_NOT_FOUND, +                                        => Doctrine::ERR_NOT_FOUND,
58                                    '/relation .* already exists/i' +                                    '/relation .* already exists/i'
59                                        => Doctrine::ERR_ALREADY_EXISTS, +                                        => Doctrine::ERR_ALREADY_EXISTS,
60                                    '/(divide|division) by zero$/i' +                                    '/(divide|division) by zero$/i'
61                                        => Doctrine::ERR_DIVZERO, +                                        => Doctrine::ERR_DIVZERO,
62                                    '/pg_atoi: error in .*: can\'t parse /i' +                                    '/pg_atoi: error in .*: can\'t parse /i'
63                                        => Doctrine::ERR_INVALID_NUMBER, +                                        => Doctrine::ERR_INVALID_NUMBER,
64                                    '/invalid input syntax for( type)? (integer|numeric)/i' +                                    '/invalid input syntax for( type)? (integer|numeric)/i'
65                                        => Doctrine::ERR_INVALID_NUMBER, +                                        => Doctrine::ERR_INVALID_NUMBER,
66                                    '/value .* is out of range for type \w*int/i' +                                    '/value .* is out of range for type \w*int/i'
67                                        => Doctrine::ERR_INVALID_NUMBER, +                                        => Doctrine::ERR_INVALID_NUMBER,
68                                    '/integer out of range/i' +                                    '/integer out of range/i'
69                                        => Doctrine::ERR_INVALID_NUMBER, +                                        => Doctrine::ERR_INVALID_NUMBER,
70                                    '/value too long for type character/i' +                                    '/value too long for type character/i'
71                                        => Doctrine::ERR_INVALID, +                                        => Doctrine::ERR_INVALID,
72                                    '/permission denied/' +                                    '/permission denied/'
73                                        => Doctrine::ERR_ACCESS_VIOLATION, +                                        => Doctrine::ERR_ACCESS_VIOLATION,
74                                    '/violates [\w ]+ constraint/' +                                    '/violates [\w ]+ constraint/'
75                                        => Doctrine::ERR_CONSTRAINT, +                                        => Doctrine::ERR_CONSTRAINT,
76                                    '/referential integrity violation/' +                                    '/referential integrity violation/'
77                                        => Doctrine::ERR_CONSTRAINT, +                                        => Doctrine::ERR_CONSTRAINT,
78                                    '/violates not-null constraint/' +                                    '/violates not-null constraint/'
79                                        => Doctrine::ERR_CONSTRAINT_NOT_NULL, +                                        => Doctrine::ERR_CONSTRAINT_NOT_NULL,
80                                    '/more expressions than target columns/i' +                                    '/more expressions than target columns/i'
81                                        => Doctrine::ERR_VALUE_COUNT_ON_ROW, +                                        => Doctrine::ERR_VALUE_COUNT_ON_ROW,
82                                ); +                                );
83 +
84    /** +    /**
85     * This method checks if native error code/message can be +     * This method checks if native error code/message can be
86     * converted into a portable code and then adds this +     * converted into a portable code and then adds this
87     * portable error code to $portableCode field +     * portable error code to $portableCode field
88     * +     *
89     * the portable error code is added at the end of array +     * the portable error code is added at the end of array
90     * +     *
91     * @param array $errorInfo      error info array +     * @param array $errorInfo      error info array
92     * @since 1.0 +     * @since 1.0
93     * @see Doctrine::ERR_* constants +     * @see Doctrine::ERR_* constants
94     * @see Doctrine_Connection::$portableCode +     * @see Doctrine_Connection::$portableCode
95     * @return boolean              whether or not the error info processing was successfull +     * @return boolean              whether or not the error info processing was successfull
96     *                              (the process is successfull if portable error code was found) +     *                              (the process is successfull if portable error code was found)
97     */ +     */
98    public function processErrorInfo(array $errorInfo) +    public function processErrorInfo(array $errorInfo)
99    { +    {
100        foreach (self::$errorRegexps as $regexp => $code) { +        foreach (self::$errorRegexps as $regexp => $code) {
101            if (preg_match($regexp, $errorInfo[2])) { +            if (preg_match($regexp, $errorInfo[2])) {
102                $this->portableCode = $code; +                $this->portableCode = $code;
103                return true; +                return true;
104            } +            }
105        } +        }
106        return false; +        return false;
107    } +    }
108 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Connection_Sqlite.html b/tests_old/coverage/Doctrine_Connection_Sqlite.html index afec04ed2..ab64b9678 100644 --- a/tests_old/coverage/Doctrine_Connection_Sqlite.html +++ b/tests_old/coverage/Doctrine_Connection_Sqlite.html @@ -10,333 +10,333 @@

Coverage for Doctrine_Connection_Sqlite

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id$ + *  $Id$
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Overloadable'); +Doctrine::autoload('Doctrine_Overloadable');
22/** +/**
23 * Doctrine_Connection_Profiler + * Doctrine_Connection_Profiler
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Connection + * @subpackage  Connection
27 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30 * @since       1.0 + * @since       1.0
31 * @version     $Revision$ + * @version     $Revision$
32 */ + */
33class Doctrine_Connection_Profiler implements Doctrine_Overloadable, IteratorAggregate, Countable +class Doctrine_Connection_Profiler implements Doctrine_Overloadable, IteratorAggregate, Countable
34{ +{
35    /** +    /**
36     * @param array $listeners      an array containing all availible listeners +     * @param array $listeners      an array containing all availible listeners
37     */ +     */
38    private $listeners  = array('query', +    private $listeners  = array('query',
39                                'prepare', +                                'prepare',
40                                'commit', +                                'commit',
41                                'rollback', +                                'rollback',
42                                'connect', +                                'connect',
43                                'begintransaction', +                                'begintransaction',
44                                'exec', +                                'exec',
45                                'execute', +                                'execute',
46                                ); +                                );
47 +
48    /** +    /**
49     * @param array $events         an array containing all listened events +     * @param array $events         an array containing all listened events
50     */ +     */
51    private $events     = array(); +    private $events     = array();
52 +
53    /** +    /**
54     * constructor +     * constructor
55     */ +     */
56    public function __construct() { +    public function __construct() {
57 +
58    } +    }
59 +
60    /** +    /**
61     * setFilterQueryType +     * setFilterQueryType
62     * +     *
63     * @param integer $filter +     * @param integer $filter
64     * @return boolean +     * @return boolean
65     */ +     */
66    public function setFilterQueryType() { +    public function setFilterQueryType() {
67                                              +                                             
68    }                                          +    }                                         
69    /** +    /**
70     * method overloader +     * method overloader
71     * this method is used for invoking different listeners, for the full +     * this method is used for invoking different listeners, for the full
72     * list of availible listeners, see Doctrine_EventListener +     * list of availible listeners, see Doctrine_EventListener
73     * +     *
74     * @param string $m     the name of the method +     * @param string $m     the name of the method
75     * @param array $a      method arguments +     * @param array $a      method arguments
76     * @see Doctrine_EventListener +     * @see Doctrine_EventListener
77     * @return boolean +     * @return boolean
78     */ +     */
79    public function __call($m, $a) +    public function __call($m, $a)
80    { +    {
81        // first argument should be an instance of Doctrine_Event +        // first argument should be an instance of Doctrine_Event
82        if ( ! ($a[0] instanceof Doctrine_Event)) { +        if ( ! ($a[0] instanceof Doctrine_Event)) {
83            throw new Doctrine_Connection_Profiler_Exception("Couldn't listen event. Event should be an instance of Doctrine_Event."); +            throw new Doctrine_Connection_Profiler_Exception("Couldn't listen event. Event should be an instance of Doctrine_Event.");
84        } +        }
85 +
86 +
87        if (substr($m, 0, 3) === 'pre') { +        if (substr($m, 0, 3) === 'pre') {
88            // pre-event listener found +            // pre-event listener found
89            $a[0]->start(); +            $a[0]->start();
90 +
91            if ( ! in_array($a[0], $this->events, true)) { +            if ( ! in_array($a[0], $this->events, true)) {
92                $this->events[] = $a[0]; +                $this->events[] = $a[0];
93            } +            }
94        } else { +        } else {
95            // after-event listener found +            // after-event listener found
96            $a[0]->end(); +            $a[0]->end();
97        } +        }
98        /** +        /**
99         * If filtering by query type is enabled, only keep the query if +         * If filtering by query type is enabled, only keep the query if
100         * it was one of the allowed types. +         * it was one of the allowed types.
101         */ +         */
102         /** +         /**
103        if ( ! is_null($this->filterTypes)) { +        if ( ! is_null($this->filterTypes)) {
104            if ( ! ($a[0]->getQueryType() & $this->_filterTypes)) { +            if ( ! ($a[0]->getQueryType() & $this->_filterTypes)) {
105 +
106            } +            }
107        } +        }
108        */ +        */
109 +
110    } +    }
111 +
112    /** +    /**
113     * get +     * get
114     * +     *
115     * @param mixed $key +     * @param mixed $key
116     * @return Doctrine_Event +     * @return Doctrine_Event
117     */ +     */
118    public function get($key)  +    public function get($key) 
119    { +    {
120        if (isset($this->events[$key])) { +        if (isset($this->events[$key])) {
121            return $this->events[$key]; +            return $this->events[$key];
122        } +        }
123        return null; +        return null;
124    } +    }
125 +
126    /** +    /**
127     * getAll +     * getAll
128     * returns all profiled events as an array +     * returns all profiled events as an array
129     * +     *
130     * @return array        all events in an array +     * @return array        all events in an array
131     */ +     */
132    public function getAll()  +    public function getAll() 
133    { +    {
134        return $this->events; +        return $this->events;
135    } +    }
136 +
137    /** +    /**
138     * getIterator +     * getIterator
139     * returns an iterator that iterates through the logged events +     * returns an iterator that iterates through the logged events
140     * +     *
141     * @return ArrayIterator +     * @return ArrayIterator
142     */ +     */
143    public function getIterator() +    public function getIterator()
144    { +    {
145        return new ArrayIterator($this->events); +        return new ArrayIterator($this->events);
146    } +    }
147 +
148    /** +    /**
149     * count +     * count
150     *  +     * 
151     * @return integer +     * @return integer
152     */ +     */
153    public function count()  +    public function count() 
154    { +    {
155        return count($this->events); +        return count($this->events);
156    } +    }
157 +
158    /** +    /**
159     * pop the last event from the event stack +     * pop the last event from the event stack
160     * +     *
161     * @return Doctrine_Event +     * @return Doctrine_Event
162     */ +     */
163    public function pop()  +    public function pop() 
164    { +    {
165        return array_pop($this->events); +        return array_pop($this->events);
166    } +    }
167 +
168    /** +    /**
169     * Get the Doctrine_Event object for the last query that was run, regardless if it has +     * Get the Doctrine_Event object for the last query that was run, regardless if it has
170     * ended or not. If the event has not ended, it's end time will be Null. +     * ended or not. If the event has not ended, it's end time will be Null.
171     * +     *
172     * @return Doctrine_Event +     * @return Doctrine_Event
173     */ +     */
174    public function lastEvent() +    public function lastEvent()
175    { +    {
176        if (empty($this->events)) { +        if (empty($this->events)) {
177            return false; +            return false;
178        } +        }
179 +
180        end($this->events); +        end($this->events);
181        return current($this->events); +        return current($this->events);
182    } +    }
183 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: Sqlite.php 3032 2007-10-29 19:50:16Z meus $ + *  $Id: Sqlite.php 3032 2007-10-29 19:50:16Z meus $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22Doctrine::autoload("Doctrine_Connection_Common"); +Doctrine::autoload("Doctrine_Connection_Common");
23 +
24/** +/**
25 * Doctrine_Connection_Sqlite + * Doctrine_Connection_Sqlite
26 * + *
27 * @package     Doctrine + * @package     Doctrine
28 * @subpackage  Connection + * @subpackage  Connection
29 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
30 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
31 * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library) + * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
32 * @version     $Revision: 3032 $ + * @version     $Revision: 3032 $
33 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
34 * @since       1.0 + * @since       1.0
35 */ + */
36class Doctrine_Connection_Sqlite extends Doctrine_Connection_Common +class Doctrine_Connection_Sqlite extends Doctrine_Connection_Common
37{ +{
38    /** +    /**
39     * @var string $driverName                  the name of this connection driver +     * @var string $driverName                  the name of this connection driver
40     */ +     */
41    protected $driverName = 'Sqlite'; +    protected $driverName = 'Sqlite';
42 +
43    /** +    /**
44     * the constructor +     * the constructor
45     * +     *
46     * @param Doctrine_Manager $manager +     * @param Doctrine_Manager $manager
47     * @param PDO $pdo                          database handle +     * @param PDO $pdo                          database handle
48     */ +     */
49    public function __construct(Doctrine_Manager $manager, $adapter) +    public function __construct(Doctrine_Manager $manager, $adapter)
50    { +    {
51        $this->supported = array('sequences'            => 'emulated', +        $this->supported = array('sequences'            => 'emulated',
52                          'indexes'              => true, +                          'indexes'              => true,
53                          'affected_rows'        => true, +                          'affected_rows'        => true,
54                          'summary_functions'    => true, +                          'summary_functions'    => true,
55                          'order_by_text'        => true, +                          'order_by_text'        => true,
56                          'current_id'           => 'emulated', +                          'current_id'           => 'emulated',
57                          'limit_queries'        => true, +                          'limit_queries'        => true,
58                          'LOBs'                 => true, +                          'LOBs'                 => true,
59                          'replace'              => true, +                          'replace'              => true,
60                          'transactions'         => true, +                          'transactions'         => true,
61                          'savepoints'           => false, +                          'savepoints'           => false,
62                          'sub_selects'          => true, +                          'sub_selects'          => true,
63                          'auto_increment'       => true, +                          'auto_increment'       => true,
64                          'primary_key'          => true, +                          'primary_key'          => true,
65                          'result_introspection' => false, // not implemented +                          'result_introspection' => false, // not implemented
66                          'prepared_statements'  => 'emulated', +                          'prepared_statements'  => 'emulated',
67                          'identifier_quoting'   => true, +                          'identifier_quoting'   => true,
68                          'pattern_escaping'     => false, +                          'pattern_escaping'     => false,
69                          ); +                          );
70         parent::__construct($manager, $adapter); +         parent::__construct($manager, $adapter);
71 +
72        if ($this->isConnected) { +        if ($this->isConnected) {
73            $this->dbh->sqliteCreateFunction('mod',    array('Doctrine_Expression_Sqlite', 'modImpl'), 2); +            $this->dbh->sqliteCreateFunction('mod',    array('Doctrine_Expression_Sqlite', 'modImpl'), 2);
74            $this->dbh->sqliteCreateFunction('concat', array('Doctrine_Expression_Sqlite', 'concatImpl')); +            $this->dbh->sqliteCreateFunction('concat', array('Doctrine_Expression_Sqlite', 'concatImpl'));
75            $this->dbh->sqliteCreateFunction('md5', 'md5', 1); +            $this->dbh->sqliteCreateFunction('md5', 'md5', 1);
76            $this->dbh->sqliteCreateFunction('now', 'time', 0); +            $this->dbh->sqliteCreateFunction('now', 'time', 0);
77        } +        }
78    } +    }
79 +
80    /** +    /**
81     * initializes database functions missing in sqlite +     * initializes database functions missing in sqlite
82     * +     *
83     * @see Doctrine_Expression +     * @see Doctrine_Expression
84     * @return void +     * @return void
85     */ +     */
86    public function connect()  +    public function connect() 
87    { +    {
88        if ($this->isConnected) { +        if ($this->isConnected) {
89            return false; +            return false;
90        } +        }
91 +
92        parent::connect(); +        parent::connect();
93 +
94        $this->dbh->sqliteCreateFunction('mod',    array('Doctrine_Expression_Sqlite', 'modImpl'), 2); +        $this->dbh->sqliteCreateFunction('mod',    array('Doctrine_Expression_Sqlite', 'modImpl'), 2);
95        $this->dbh->sqliteCreateFunction('concat', array('Doctrine_Expression_Sqlite', 'concatImpl')); +        $this->dbh->sqliteCreateFunction('concat', array('Doctrine_Expression_Sqlite', 'concatImpl'));
96        $this->dbh->sqliteCreateFunction('md5', 'md5', 1); +        $this->dbh->sqliteCreateFunction('md5', 'md5', 1);
97        $this->dbh->sqliteCreateFunction('now', 'time', 0); +        $this->dbh->sqliteCreateFunction('now', 'time', 0);
98    } +    }
99 +
100    /** +    /**
101     * getDatabaseFile +     * getDatabaseFile
102     * +     *
103     * @param string $name      the name of the database +     * @param string $name      the name of the database
104     * @return string +     * @return string
105     */ +     */
106    public function getDatabaseFile($name) +    public function getDatabaseFile($name)
107    { +    {
108        return $name . '.db'; +        return $name . '.db';
109    } +    }
110} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Connection_Sqlite_Exception.html b/tests_old/coverage/Doctrine_Connection_Sqlite_Exception.html index c7d8c8ba4..f01f7231c 100644 --- a/tests_old/coverage/Doctrine_Connection_Sqlite_Exception.html +++ b/tests_old/coverage/Doctrine_Connection_Sqlite_Exception.html @@ -10,235 +10,235 @@

Coverage for Doctrine_Connection_Sqlite_Exception

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Connection_Statement.html b/tests_old/coverage/Doctrine_Connection_Statement.html index 3feffc43a..81c11d37a 100644 --- a/tests_old/coverage/Doctrine_Connection_Statement.html +++ b/tests_old/coverage/Doctrine_Connection_Statement.html @@ -10,1380 +10,1380 @@

Coverage for Doctrine_Connection_Statement

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Exception.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Exception.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Connection_Exception'); +Doctrine::autoload('Doctrine_Connection_Exception');
22/** +/**
23 * Doctrine_Connection_Sqlite_Exception + * Doctrine_Connection_Sqlite_Exception
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Connection + * @subpackage  Connection
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
29 * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library) + * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
30 * @since       1.0 + * @since       1.0
31 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
32 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
33 */ + */
34class Doctrine_Connection_Sqlite_Exception extends Doctrine_Connection_Exception +class Doctrine_Connection_Sqlite_Exception extends Doctrine_Connection_Exception
35{ +{
36    /** +    /**
37     * @var array $errorRegexps         an array that is used for determining portable +     * @var array $errorRegexps         an array that is used for determining portable
38     *                                  error code from a native database error message +     *                                  error code from a native database error message
39     */ +     */
40    protected static $errorRegexps = array( +    protected static $errorRegexps = array(
41                              '/^no such table:/'                    => Doctrine::ERR_NOSUCHTABLE, +                              '/^no such table:/'                    => Doctrine::ERR_NOSUCHTABLE,
42                              '/^no such index:/'                    => Doctrine::ERR_NOT_FOUND, +                              '/^no such index:/'                    => Doctrine::ERR_NOT_FOUND,
43                              '/^(table|index) .* already exists$/'  => Doctrine::ERR_ALREADY_EXISTS, +                              '/^(table|index) .* already exists$/'  => Doctrine::ERR_ALREADY_EXISTS,
44                              '/PRIMARY KEY must be unique/i'        => Doctrine::ERR_CONSTRAINT, +                              '/PRIMARY KEY must be unique/i'        => Doctrine::ERR_CONSTRAINT,
45                              '/is not unique/'                      => Doctrine::ERR_CONSTRAINT, +                              '/is not unique/'                      => Doctrine::ERR_CONSTRAINT,
46                              '/columns .* are not unique/i'         => Doctrine::ERR_CONSTRAINT, +                              '/columns .* are not unique/i'         => Doctrine::ERR_CONSTRAINT,
47                              '/uniqueness constraint failed/'       => Doctrine::ERR_CONSTRAINT, +                              '/uniqueness constraint failed/'       => Doctrine::ERR_CONSTRAINT,
48                              '/may not be NULL/'                    => Doctrine::ERR_CONSTRAINT_NOT_NULL, +                              '/may not be NULL/'                    => Doctrine::ERR_CONSTRAINT_NOT_NULL,
49                              '/^no such column:/'                   => Doctrine::ERR_NOSUCHFIELD, +                              '/^no such column:/'                   => Doctrine::ERR_NOSUCHFIELD,
50                              '/column not present in both tables/i' => Doctrine::ERR_NOSUCHFIELD, +                              '/column not present in both tables/i' => Doctrine::ERR_NOSUCHFIELD,
51                              '/^near ".*": syntax error$/'          => Doctrine::ERR_SYNTAX, +                              '/^near ".*": syntax error$/'          => Doctrine::ERR_SYNTAX,
52                              '/[0-9]+ values for [0-9]+ columns/i'  => Doctrine::ERR_VALUE_COUNT_ON_ROW, +                              '/[0-9]+ values for [0-9]+ columns/i'  => Doctrine::ERR_VALUE_COUNT_ON_ROW,
53                              ); +                              );
54 +
55    /** +    /**
56     * This method checks if native error code/message can be +     * This method checks if native error code/message can be
57     * converted into a portable code and then adds this +     * converted into a portable code and then adds this
58     * portable error code to $portableCode field +     * portable error code to $portableCode field
59     * +     *
60     * @param array $errorInfo      error info array +     * @param array $errorInfo      error info array
61     * @since 1.0 +     * @since 1.0
62     * @see Doctrine::ERR_* constants +     * @see Doctrine::ERR_* constants
63     * @see Doctrine_Connection::$portableCode +     * @see Doctrine_Connection::$portableCode
64     * @return boolean              whether or not the error info processing was successfull +     * @return boolean              whether or not the error info processing was successfull
65     *                              (the process is successfull if portable error code was found) +     *                              (the process is successfull if portable error code was found)
66     */ +     */
67    public function processErrorInfo(array $errorInfo) +    public function processErrorInfo(array $errorInfo)
68    { +    {
69        foreach (self::$errorRegexps as $regexp => $code) { +        foreach (self::$errorRegexps as $regexp => $code) {
70            if (preg_match($regexp, $errorInfo[2])) { +            if (preg_match($regexp, $errorInfo[2])) {
71 +
72                $this->portableCode = $code; +                $this->portableCode = $code;
73                return true; +                return true;
74            } +            }
75        } +        }
76        return false; +        return false;
77    } +    }
78 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: Statement.php 1532 2007-05-31 17:45:07Z zYne $ + *  $Id: Statement.php 1532 2007-05-31 17:45:07Z zYne $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Adapter_Statement_Interface'); +Doctrine::autoload('Doctrine_Adapter_Statement_Interface');
22/** +/**
23 * Doctrine_Connection_Statement + * Doctrine_Connection_Statement
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Connection + * @subpackage  Connection
27 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30 * @since       1.0 + * @since       1.0
31 * @version     $Revision: 1532 $ + * @version     $Revision: 1532 $
32 */ + */
33class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interface +class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interface
34{ +{
35    /** +    /**
36     * @var Doctrine_Connection $conn       Doctrine_Connection object, every connection +     * @var Doctrine_Connection $conn       Doctrine_Connection object, every connection
37     *                                      statement holds an instance of Doctrine_Connection +     *                                      statement holds an instance of Doctrine_Connection
38     */ +     */
39    protected $_conn; +    protected $_conn;
40 +
41    /** +    /**
42     * @var mixed $_stmt                    PDOStatement object, boolean false or Doctrine_Adapter_Statement object +     * @var mixed $_stmt                    PDOStatement object, boolean false or Doctrine_Adapter_Statement object
43     */ +     */
44    protected $_stmt; +    protected $_stmt;
45 +
46    /** +    /**
47     * constructor +     * constructor
48     * +     *
49     * @param Doctrine_Connection $conn     Doctrine_Connection object, every connection +     * @param Doctrine_Connection $conn     Doctrine_Connection object, every connection
50     *                                      statement holds an instance of Doctrine_Connection +     *                                      statement holds an instance of Doctrine_Connection
51     * @param mixed $stmt +     * @param mixed $stmt
52     */ +     */
53    public function __construct(Doctrine_Connection $conn, $stmt) +    public function __construct(Doctrine_Connection $conn, $stmt)
54    { +    {
55        $this->_conn = $conn; +        $this->_conn = $conn;
56        $this->_stmt = $stmt; +        $this->_stmt = $stmt;
57 +
58        if ($stmt === false) { +        if ($stmt === false) {
59            throw new Doctrine_Exception('Unknown statement object given.'); +            throw new Doctrine_Exception('Unknown statement object given.');
60        } +        }
61    } +    }
62 +
63    /** +    /**
64     * getConnection +     * getConnection
65     * returns the connection object this statement uses +     * returns the connection object this statement uses
66     * +     *
67     * @return Doctrine_Connection +     * @return Doctrine_Connection
68     */ +     */
69    public function getConnection() +    public function getConnection()
70    { +    {
71        return $this->_conn; +        return $this->_conn;
72    } +    }
73    public function getStatement() +    public function getStatement()
74    { +    {
75        return $this->_stmt; +        return $this->_stmt;
76    } +    }
77    public function getQuery() +    public function getQuery()
78    { +    {
79        return $this->_stmt->queryString; +        return $this->_stmt->queryString;
80    } +    }
81 +
82    /** +    /**
83     * bindColumn +     * bindColumn
84     * Bind a column to a PHP variable +     * Bind a column to a PHP variable
85     * +     *
86     * @param mixed $column         Number of the column (1-indexed) or name of the column in the result set. +     * @param mixed $column         Number of the column (1-indexed) or name of the column in the result set.
87     *                              If using the column name, be aware that the name should match +     *                              If using the column name, be aware that the name should match
88     *                              the case of the column, as returned by the driver. +     *                              the case of the column, as returned by the driver.
89     * +     *
90     * @param string $param         Name of the PHP variable to which the column will be bound. +     * @param string $param         Name of the PHP variable to which the column will be bound.
91     * @param integer $type         Data type of the parameter, specified by the Doctrine::PARAM_* constants. +     * @param integer $type         Data type of the parameter, specified by the Doctrine::PARAM_* constants.
92     * @return boolean              Returns TRUE on success or FALSE on failure +     * @return boolean              Returns TRUE on success or FALSE on failure
93     */ +     */
94    public function bindColumn($column, $param, $type = null) +    public function bindColumn($column, $param, $type = null)
95    { +    {
96        if ($type === null) { +        if ($type === null) {
97            return $this->_stmt->bindColumn($column, $param); +            return $this->_stmt->bindColumn($column, $param);
98        } else { +        } else {
99            return $this->_stmt->bindColumn($column, $param, $type); +            return $this->_stmt->bindColumn($column, $param, $type);
100        } +        }
101    } +    }
102 +
103    /** +    /**
104     * bindValue +     * bindValue
105     * Binds a value to a corresponding named or question mark +     * Binds a value to a corresponding named or question mark
106     * placeholder in the SQL statement that was use to prepare the statement. +     * placeholder in the SQL statement that was use to prepare the statement.
107     * +     *
108     * @param mixed $param          Parameter identifier. For a prepared statement using named placeholders, +     * @param mixed $param          Parameter identifier. For a prepared statement using named placeholders,
109     *                              this will be a parameter name of the form :name. For a prepared statement +     *                              this will be a parameter name of the form :name. For a prepared statement
110     *                              using question mark placeholders, this will be the 1-indexed position of the parameter +     *                              using question mark placeholders, this will be the 1-indexed position of the parameter
111     * +     *
112     * @param mixed $value          The value to bind to the parameter. +     * @param mixed $value          The value to bind to the parameter.
113     * @param integer $type         Explicit data type for the parameter using the Doctrine::PARAM_* constants. +     * @param integer $type         Explicit data type for the parameter using the Doctrine::PARAM_* constants.
114     * +     *
115     * @return boolean              Returns TRUE on success or FALSE on failure. +     * @return boolean              Returns TRUE on success or FALSE on failure.
116     */ +     */
117    public function bindValue($param, $value, $type = null) +    public function bindValue($param, $value, $type = null)
118    { +    {
119        if ($type === null) { +        if ($type === null) {
120            return $this->_stmt->bindValue($param, $value); +            return $this->_stmt->bindValue($param, $value);
121        } else { +        } else {
122            return $this->_stmt->bindValue($param, $value, $type); +            return $this->_stmt->bindValue($param, $value, $type);
123        } +        }
124    } +    }
125 +
126    /** +    /**
127     * bindParam +     * bindParam
128     * Binds a PHP variable to a corresponding named or question mark placeholder in the +     * Binds a PHP variable to a corresponding named or question mark placeholder in the
129     * SQL statement that was use to prepare the statement. Unlike Doctrine_Adapter_Statement_Interface->bindValue(), +     * SQL statement that was use to prepare the statement. Unlike Doctrine_Adapter_Statement_Interface->bindValue(),
130     * the variable is bound as a reference and will only be evaluated at the time +     * the variable is bound as a reference and will only be evaluated at the time
131     * that Doctrine_Adapter_Statement_Interface->execute() is called. +     * that Doctrine_Adapter_Statement_Interface->execute() is called.
132     * +     *
133     * Most parameters are input parameters, that is, parameters that are +     * Most parameters are input parameters, that is, parameters that are
134     * used in a read-only fashion to build up the query. Some drivers support the invocation +     * used in a read-only fashion to build up the query. Some drivers support the invocation
135     * of stored procedures that return data as output parameters, and some also as input/output +     * of stored procedures that return data as output parameters, and some also as input/output
136     * parameters that both send in data and are updated to receive it. +     * parameters that both send in data and are updated to receive it.
137     * +     *
138     * @param mixed $param          Parameter identifier. For a prepared statement using named placeholders, +     * @param mixed $param          Parameter identifier. For a prepared statement using named placeholders,
139     *                              this will be a parameter name of the form :name. For a prepared statement +     *                              this will be a parameter name of the form :name. For a prepared statement
140     *                              using question mark placeholders, this will be the 1-indexed position of the parameter +     *                              using question mark placeholders, this will be the 1-indexed position of the parameter
141     * +     *
142     * @param mixed $variable       Name of the PHP variable to bind to the SQL statement parameter. +     * @param mixed $variable       Name of the PHP variable to bind to the SQL statement parameter.
143     * +     *
144     * @param integer $type         Explicit data type for the parameter using the Doctrine::PARAM_* constants. To return +     * @param integer $type         Explicit data type for the parameter using the Doctrine::PARAM_* constants. To return
145     *                              an INOUT parameter from a stored procedure, use the bitwise OR operator to set the +     *                              an INOUT parameter from a stored procedure, use the bitwise OR operator to set the
146     *                              Doctrine::PARAM_INPUT_OUTPUT bits for the data_type parameter. +     *                              Doctrine::PARAM_INPUT_OUTPUT bits for the data_type parameter.
147     * +     *
148     * @param integer $length       Length of the data type. To indicate that a parameter is an OUT parameter +     * @param integer $length       Length of the data type. To indicate that a parameter is an OUT parameter
149     *                              from a stored procedure, you must explicitly set the length. +     *                              from a stored procedure, you must explicitly set the length.
150     * @param mixed $driverOptions +     * @param mixed $driverOptions
151     * @return boolean              Returns TRUE on success or FALSE on failure. +     * @return boolean              Returns TRUE on success or FALSE on failure.
152     */ +     */
153    public function bindParam($column, &$variable, $type = null, $length = null, $driverOptions = array()) +    public function bindParam($column, &$variable, $type = null, $length = null, $driverOptions = array())
154    { +    {
155        if ($type === null) { +        if ($type === null) {
156            return $this->_stmt->bindParam($column, $variable); +            return $this->_stmt->bindParam($column, $variable);
157        } else { +        } else {
158            return $this->_stmt->bindParam($column, $variable, $type, $length, $driverOptions); +            return $this->_stmt->bindParam($column, $variable, $type, $length, $driverOptions);
159        } +        }
160    } +    }
161 +
162    /** +    /**
163     * closeCursor +     * closeCursor
164     * Closes the cursor, enabling the statement to be executed again. +     * Closes the cursor, enabling the statement to be executed again.
165     * +     *
166     * @return boolean              Returns TRUE on success or FALSE on failure. +     * @return boolean              Returns TRUE on success or FALSE on failure.
167     */ +     */
168    public function closeCursor() +    public function closeCursor()
169    { +    {
170        return $this->_stmt->closeCursor(); +        return $this->_stmt->closeCursor();
171    } +    }
172 +
173    /** +    /**
174     * columnCount +     * columnCount
175     * Returns the number of columns in the result set +     * Returns the number of columns in the result set
176     * +     *
177     * @return integer              Returns the number of columns in the result set represented +     * @return integer              Returns the number of columns in the result set represented
178     *                              by the Doctrine_Adapter_Statement_Interface object. If there is no result set, +     *                              by the Doctrine_Adapter_Statement_Interface object. If there is no result set,
179     *                              this method should return 0. +     *                              this method should return 0.
180     */ +     */
181    public function columnCount() +    public function columnCount()
182    { +    {
183        return $this->_stmt->columnCount(); +        return $this->_stmt->columnCount();
184    } +    }
185 +
186    /** +    /**
187     * errorCode +     * errorCode
188     * Fetch the SQLSTATE associated with the last operation on the statement handle +     * Fetch the SQLSTATE associated with the last operation on the statement handle
189     * +     *
190     * @see Doctrine_Adapter_Interface::errorCode() +     * @see Doctrine_Adapter_Interface::errorCode()
191     * @return string       error code string +     * @return string       error code string
192     */ +     */
193    public function errorCode() +    public function errorCode()
194    { +    {
195        return $this->_stmt->errorCode(); +        return $this->_stmt->errorCode();
196    } +    }
197 +
198    /** +    /**
199     * errorInfo +     * errorInfo
200     * Fetch extended error information associated with the last operation on the statement handle +     * Fetch extended error information associated with the last operation on the statement handle
201     * +     *
202     * @see Doctrine_Adapter_Interface::errorInfo() +     * @see Doctrine_Adapter_Interface::errorInfo()
203     * @return array        error info array +     * @return array        error info array
204     */ +     */
205    public function errorInfo() +    public function errorInfo()
206    { +    {
207        return $this->_stmt->errorInfo(); +        return $this->_stmt->errorInfo();
208    } +    }
209 +
210    /** +    /**
211     * execute +     * execute
212     * Executes a prepared statement +     * Executes a prepared statement
213     * +     *
214     * If the prepared statement included parameter markers, you must either: +     * If the prepared statement included parameter markers, you must either:
215     * call PDOStatement->bindParam() to bind PHP variables to the parameter markers: +     * call PDOStatement->bindParam() to bind PHP variables to the parameter markers:
216     * bound variables pass their value as input and receive the output value, +     * bound variables pass their value as input and receive the output value,
217     * if any, of their associated parameter markers or pass an array of input-only +     * if any, of their associated parameter markers or pass an array of input-only
218     * parameter values +     * parameter values
219     * +     *
220     * +     *
221     * @param array $params             An array of values with as many elements as there are +     * @param array $params             An array of values with as many elements as there are
222     *                                  bound parameters in the SQL statement being executed. +     *                                  bound parameters in the SQL statement being executed.
223     * @return boolean                  Returns TRUE on success or FALSE on failure. +     * @return boolean                  Returns TRUE on success or FALSE on failure.
224     */ +     */
225    public function execute($params = null) +    public function execute($params = null)
226    { +    {
227        try { +        try {
228            $event = new Doctrine_Event($this, Doctrine_Event::STMT_EXECUTE, $this->getQuery(), $params); +            $event = new Doctrine_Event($this, Doctrine_Event::STMT_EXECUTE, $this->getQuery(), $params);
229            $this->_conn->getListener()->preStmtExecute($event); +            $this->_conn->getListener()->preStmtExecute($event);
230 +
231            $result = true; +            $result = true;
232            if ( ! $event->skipOperation) { +            if ( ! $event->skipOperation) {
233                $result = $this->_stmt->execute($params); +                $result = $this->_stmt->execute($params);
234                $this->_conn->incrementQueryCount(); +                $this->_conn->incrementQueryCount();
235            } +            }
236 +
237            $this->_conn->getListener()->postStmtExecute($event); +            $this->_conn->getListener()->postStmtExecute($event);
238 +
239            return $result; +            return $result;
240        } catch (PDOException $e) { +        } catch (PDOException $e) {
241        } catch (Doctrine_Adapter_Exception $e) { +        } catch (Doctrine_Adapter_Exception $e) {
242        } +        }
243 +
244        $this->_conn->rethrowException($e, $this); +        $this->_conn->rethrowException($e, $this);
245 +
246        return false; +        return false;
247    } +    }
248 +
249    /** +    /**
250     * fetch +     * fetch
251     * +     *
252     * @see Doctrine::FETCH_* constants +     * @see Doctrine::FETCH_* constants
253     * @param integer $fetchStyle           Controls how the next row will be returned to the caller. +     * @param integer $fetchStyle           Controls how the next row will be returned to the caller.
254     *                                      This value must be one of the Doctrine::FETCH_* constants, +     *                                      This value must be one of the Doctrine::FETCH_* constants,
255     *                                      defaulting to Doctrine::FETCH_BOTH +     *                                      defaulting to Doctrine::FETCH_BOTH
256     * +     *
257     * @param integer $cursorOrientation    For a PDOStatement object representing a scrollable cursor, +     * @param integer $cursorOrientation    For a PDOStatement object representing a scrollable cursor,
258     *                                      this value determines which row will be returned to the caller. +     *                                      this value determines which row will be returned to the caller.
259     *                                      This value must be one of the Doctrine::FETCH_ORI_* constants, defaulting to +     *                                      This value must be one of the Doctrine::FETCH_ORI_* constants, defaulting to
260     *                                      Doctrine::FETCH_ORI_NEXT. To request a scrollable cursor for your +     *                                      Doctrine::FETCH_ORI_NEXT. To request a scrollable cursor for your
261     *                                      Doctrine_Adapter_Statement_Interface object, +     *                                      Doctrine_Adapter_Statement_Interface object,
262     *                                      you must set the Doctrine::ATTR_CURSOR attribute to Doctrine::CURSOR_SCROLL when you +     *                                      you must set the Doctrine::ATTR_CURSOR attribute to Doctrine::CURSOR_SCROLL when you
263     *                                      prepare the SQL statement with Doctrine_Adapter_Interface->prepare(). +     *                                      prepare the SQL statement with Doctrine_Adapter_Interface->prepare().
264     * +     *
265     * @param integer $cursorOffset         For a Doctrine_Adapter_Statement_Interface object representing a scrollable cursor for which the +     * @param integer $cursorOffset         For a Doctrine_Adapter_Statement_Interface object representing a scrollable cursor for which the
266     *                                      $cursorOrientation parameter is set to Doctrine::FETCH_ORI_ABS, this value specifies +     *                                      $cursorOrientation parameter is set to Doctrine::FETCH_ORI_ABS, this value specifies
267     *                                      the absolute number of the row in the result set that shall be fetched. +     *                                      the absolute number of the row in the result set that shall be fetched.
268     * +     *
269     *                                      For a Doctrine_Adapter_Statement_Interface object representing a scrollable cursor for +     *                                      For a Doctrine_Adapter_Statement_Interface object representing a scrollable cursor for
270     *                                      which the $cursorOrientation parameter is set to Doctrine::FETCH_ORI_REL, this value +     *                                      which the $cursorOrientation parameter is set to Doctrine::FETCH_ORI_REL, this value
271     *                                      specifies the row to fetch relative to the cursor position before +     *                                      specifies the row to fetch relative to the cursor position before
272     *                                      Doctrine_Adapter_Statement_Interface->fetch() was called. +     *                                      Doctrine_Adapter_Statement_Interface->fetch() was called.
273     * +     *
274     * @return mixed +     * @return mixed
275     */ +     */
276    public function fetch($fetchMode = Doctrine::FETCH_BOTH, +    public function fetch($fetchMode = Doctrine::FETCH_BOTH,
277                          $cursorOrientation = Doctrine::FETCH_ORI_NEXT, +                          $cursorOrientation = Doctrine::FETCH_ORI_NEXT,
278                          $cursorOffset = null) +                          $cursorOffset = null)
279    { +    {
280        $event = new Doctrine_Event($this, Doctrine_Event::STMT_FETCH, $this->getQuery()); +        $event = new Doctrine_Event($this, Doctrine_Event::STMT_FETCH, $this->getQuery());
281 +
282        $event->fetchMode = $fetchMode; +        $event->fetchMode = $fetchMode;
283        $event->cursorOrientation = $cursorOrientation; +        $event->cursorOrientation = $cursorOrientation;
284        $event->cursorOffset = $cursorOffset; +        $event->cursorOffset = $cursorOffset;
285 +
286        $data = $this->_conn->getListener()->preFetch($event); +        $data = $this->_conn->getListener()->preFetch($event);
287 +
288        if ( ! $event->skipOperation) { +        if ( ! $event->skipOperation) {
289            $data = $this->_stmt->fetch($fetchMode, $cursorOrientation, $cursorOffset); +            $data = $this->_stmt->fetch($fetchMode, $cursorOrientation, $cursorOffset);
290        } +        }
291 +
292        $this->_conn->getListener()->postFetch($event); +        $this->_conn->getListener()->postFetch($event);
293 +
294        return $data; +        return $data;
295    } +    }
296 +
297    /** +    /**
298     * fetchAll +     * fetchAll
299     * Returns an array containing all of the result set rows +     * Returns an array containing all of the result set rows
300     * +     *
301     * @param integer $fetchMode            Controls how the next row will be returned to the caller. +     * @param integer $fetchMode            Controls how the next row will be returned to the caller.
302     *                                      This value must be one of the Doctrine::FETCH_* constants, +     *                                      This value must be one of the Doctrine::FETCH_* constants,
303     *                                      defaulting to Doctrine::FETCH_BOTH +     *                                      defaulting to Doctrine::FETCH_BOTH
304     * +     *
305     * @param integer $columnIndex          Returns the indicated 0-indexed column when the value of $fetchStyle is +     * @param integer $columnIndex          Returns the indicated 0-indexed column when the value of $fetchStyle is
306     *                                      Doctrine::FETCH_COLUMN. Defaults to 0. +     *                                      Doctrine::FETCH_COLUMN. Defaults to 0.
307     * +     *
308     * @return array +     * @return array
309     */ +     */
310    public function fetchAll($fetchMode = Doctrine::FETCH_BOTH, +    public function fetchAll($fetchMode = Doctrine::FETCH_BOTH,
311                             $columnIndex = null) +                             $columnIndex = null)
312    { +    {
313        $event = new Doctrine_Event($this, Doctrine_Event::STMT_FETCHALL, $this->getQuery()); +        $event = new Doctrine_Event($this, Doctrine_Event::STMT_FETCHALL, $this->getQuery());
314        $event->fetchMode = $fetchMode; +        $event->fetchMode = $fetchMode;
315        $event->columnIndex = $columnIndex; +        $event->columnIndex = $columnIndex;
316 +
317        $this->_conn->getListener()->preFetchAll($event); +        $this->_conn->getListener()->preFetchAll($event);
318 +
319        if ( ! $event->skipOperation) { +        if ( ! $event->skipOperation) {
320            if ($columnIndex !== null) { +            if ($columnIndex !== null) {
321                $data = $this->_stmt->fetchAll($fetchMode, $columnIndex); +                $data = $this->_stmt->fetchAll($fetchMode, $columnIndex);
322            } else { +            } else {
323                $data = $this->_stmt->fetchAll($fetchMode); +                $data = $this->_stmt->fetchAll($fetchMode);
324            } +            }
325 +
326            $event->data = $data; +            $event->data = $data;
327        } +        }
328 +
329        $this->_conn->getListener()->postFetchAll($event); +        $this->_conn->getListener()->postFetchAll($event);
330 +
331        return $data; +        return $data;
332    } +    }
333 +
334    /** +    /**
335     * fetchColumn +     * fetchColumn
336     * Returns a single column from the next row of a +     * Returns a single column from the next row of a
337     * result set or FALSE if there are no more rows. +     * result set or FALSE if there are no more rows.
338     * +     *
339     * @param integer $columnIndex          0-indexed number of the column you wish to retrieve from the row. If no +     * @param integer $columnIndex          0-indexed number of the column you wish to retrieve from the row. If no
340     *                                      value is supplied, Doctrine_Adapter_Statement_Interface->fetchColumn() +     *                                      value is supplied, Doctrine_Adapter_Statement_Interface->fetchColumn()
341     *                                      fetches the first column. +     *                                      fetches the first column.
342     * +     *
343     * @return string                       returns a single column in the next row of a result set. +     * @return string                       returns a single column in the next row of a result set.
344     */ +     */
345    public function fetchColumn($columnIndex = 0) +    public function fetchColumn($columnIndex = 0)
346    { +    {
347        return $this->_stmt->fetchColumn($columnIndex); +        return $this->_stmt->fetchColumn($columnIndex);
348    } +    }
349 +
350    /** +    /**
351     * fetchObject +     * fetchObject
352     * Fetches the next row and returns it as an object. +     * Fetches the next row and returns it as an object.
353     * +     *
354     * Fetches the next row and returns it as an object. This function is an alternative to +     * Fetches the next row and returns it as an object. This function is an alternative to
355     * Doctrine_Adapter_Statement_Interface->fetch() with Doctrine::FETCH_CLASS or Doctrine::FETCH_OBJ style. +     * Doctrine_Adapter_Statement_Interface->fetch() with Doctrine::FETCH_CLASS or Doctrine::FETCH_OBJ style.
356     * +     *
357     * @param string $className             Name of the created class, defaults to stdClass. +     * @param string $className             Name of the created class, defaults to stdClass.
358     * @param array $args                   Elements of this array are passed to the constructor. +     * @param array $args                   Elements of this array are passed to the constructor.
359     * +     *
360     * @return mixed                        an instance of the required class with property names that correspond +     * @return mixed                        an instance of the required class with property names that correspond
361     *                                      to the column names or FALSE in case of an error. +     *                                      to the column names or FALSE in case of an error.
362     */ +     */
363    public function fetchObject($className = 'stdClass', $args = array()) +    public function fetchObject($className = 'stdClass', $args = array())
364    { +    {
365        return $this->_stmt->fetchObject($className, $args); +        return $this->_stmt->fetchObject($className, $args);
366    } +    }
367 +
368    /** +    /**
369     * getAttribute +     * getAttribute
370     * Retrieve a statement attribute +     * Retrieve a statement attribute
371     * +     *
372     * @param integer $attribute +     * @param integer $attribute
373     * @see Doctrine::ATTR_* constants +     * @see Doctrine::ATTR_* constants
374     * @return mixed                        the attribute value +     * @return mixed                        the attribute value
375     */ +     */
376    public function getAttribute($attribute) +    public function getAttribute($attribute)
377    { +    {
378        return $this->_stmt->getAttribute($attribute); +        return $this->_stmt->getAttribute($attribute);
379    } +    }
380 +
381    /** +    /**
382     * getColumnMeta +     * getColumnMeta
383     * Returns metadata for a column in a result set +     * Returns metadata for a column in a result set
384     * +     *
385     * @param integer $column               The 0-indexed column in the result set. +     * @param integer $column               The 0-indexed column in the result set.
386     * +     *
387     * @return array                        Associative meta data array with the following structure: +     * @return array                        Associative meta data array with the following structure:
388     * +     *
389     *          native_type                 The PHP native type used to represent the column value. +     *          native_type                 The PHP native type used to represent the column value.
390     *          driver:decl_                type The SQL type used to represent the column value in the database. If the column in the result set is the result of a function, this value is not returned by PDOStatement->getColumnMeta(). +     *          driver:decl_                type The SQL type used to represent the column value in the database. If the column in the result set is the result of a function, this value is not returned by PDOStatement->getColumnMeta().
391     *          flags                       Any flags set for this column. +     *          flags                       Any flags set for this column.
392     *          name                        The name of this column as returned by the database. +     *          name                        The name of this column as returned by the database.
393     *          len                         The length of this column. Normally -1 for types other than floating point decimals. +     *          len                         The length of this column. Normally -1 for types other than floating point decimals.
394     *          precision                   The numeric precision of this column. Normally 0 for types other than floating point decimals. +     *          precision                   The numeric precision of this column. Normally 0 for types other than floating point decimals.
395     *          pdo_type                    The type of this column as represented by the PDO::PARAM_* constants. +     *          pdo_type                    The type of this column as represented by the PDO::PARAM_* constants.
396     */ +     */
397    public function getColumnMeta($column) +    public function getColumnMeta($column)
398    { +    {
399        return $this->_stmt->getColumnMeta($column); +        return $this->_stmt->getColumnMeta($column);
400    } +    }
401 +
402    /** +    /**
403     * nextRowset +     * nextRowset
404     * Advances to the next rowset in a multi-rowset statement handle +     * Advances to the next rowset in a multi-rowset statement handle
405     * +     *
406     * Some database servers support stored procedures that return more than one rowset +     * Some database servers support stored procedures that return more than one rowset
407     * (also known as a result set). The nextRowset() method enables you to access the second +     * (also known as a result set). The nextRowset() method enables you to access the second
408     * and subsequent rowsets associated with a PDOStatement object. Each rowset can have a +     * and subsequent rowsets associated with a PDOStatement object. Each rowset can have a
409     * different set of columns from the preceding rowset. +     * different set of columns from the preceding rowset.
410     * +     *
411     * @return boolean                      Returns TRUE on success or FALSE on failure. +     * @return boolean                      Returns TRUE on success or FALSE on failure.
412     */ +     */
413    public function nextRowset() +    public function nextRowset()
414    { +    {
415        return $this->_stmt->nextRowset(); +        return $this->_stmt->nextRowset();
416    } +    }
417 +
418    /** +    /**
419     * rowCount +     * rowCount
420     * rowCount() returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement +     * rowCount() returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement
421     * executed by the corresponding object. +     * executed by the corresponding object.
422     * +     *
423     * If the last SQL statement executed by the associated Statement object was a SELECT statement, +     * If the last SQL statement executed by the associated Statement object was a SELECT statement,
424     * some databases may return the number of rows returned by that statement. However, +     * some databases may return the number of rows returned by that statement. However,
425     * this behaviour is not guaranteed for all databases and should not be +     * this behaviour is not guaranteed for all databases and should not be
426     * relied on for portable applications. +     * relied on for portable applications.
427     * +     *
428     * @return integer                      Returns the number of rows. +     * @return integer                      Returns the number of rows.
429     */ +     */
430    public function rowCount() +    public function rowCount()
431    { +    {
432        return $this->_stmt->rowCount(); +        return $this->_stmt->rowCount();
433    } +    }
434 +
435    /** +    /**
436     * setAttribute +     * setAttribute
437     * Set a statement attribute +     * Set a statement attribute
438     * +     *
439     * @param integer $attribute +     * @param integer $attribute
440     * @param mixed $value                  the value of given attribute +     * @param mixed $value                  the value of given attribute
441     * @return boolean                      Returns TRUE on success or FALSE on failure. +     * @return boolean                      Returns TRUE on success or FALSE on failure.
442     */ +     */
443    public function setAttribute($attribute, $value) +    public function setAttribute($attribute, $value)
444    { +    {
445        return $this->_stmt->setAttribute($attribute, $value); +        return $this->_stmt->setAttribute($attribute, $value);
446    } +    }
447 +
448    /** +    /**
449     * setFetchMode +     * setFetchMode
450     * Set the default fetch mode for this statement +     * Set the default fetch mode for this statement
451     * +     *
452     * @param integer $mode                 The fetch mode must be one of the Doctrine::FETCH_* constants. +     * @param integer $mode                 The fetch mode must be one of the Doctrine::FETCH_* constants.
453     * @return boolean                      Returns 1 on success or FALSE on failure. +     * @return boolean                      Returns 1 on success or FALSE on failure.
454     */ +     */
455    public function setFetchMode($mode, $arg1 = null, $arg2 = null) +    public function setFetchMode($mode, $arg1 = null, $arg2 = null)
456    { +    {
457        return $this->_stmt->setFetchMode($mode, $arg1, $arg2); +        return $this->_stmt->setFetchMode($mode, $arg1, $arg2);
458    } +    }
459} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Connection_UnitOfWork.html b/tests_old/coverage/Doctrine_Connection_UnitOfWork.html index cad1980a6..b36ab6554 100644 --- a/tests_old/coverage/Doctrine_Connection_UnitOfWork.html +++ b/tests_old/coverage/Doctrine_Connection_UnitOfWork.html @@ -64,7 +64,7 @@  * and is licensed under the LGPL. For more information, see 19 - * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>. 20  */ @@ -91,7 +91,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL 28 - * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org 29  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_DataDict.html b/tests_old/coverage/Doctrine_DataDict.html index 71f61ee50..530615124 100644 --- a/tests_old/coverage/Doctrine_DataDict.html +++ b/tests_old/coverage/Doctrine_DataDict.html @@ -64,7 +64,7 @@  * and is licensed under the LGPL. For more information, see 19 - * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>. 20  */ @@ -91,7 +91,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL 28 - * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org 29  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_DataDict_Exception.html b/tests_old/coverage/Doctrine_DataDict_Exception.html index 905c16c42..43d2be3ad 100644 --- a/tests_old/coverage/Doctrine_DataDict_Exception.html +++ b/tests_old/coverage/Doctrine_DataDict_Exception.html @@ -10,103 +10,103 @@

Coverage for Doctrine_DataDict_Exception

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_DataDict_Firebird.html b/tests_old/coverage/Doctrine_DataDict_Firebird.html index f401a7b71..82a878499 100644 --- a/tests_old/coverage/Doctrine_DataDict_Firebird.html +++ b/tests_old/coverage/Doctrine_DataDict_Firebird.html @@ -10,655 +10,655 @@

Coverage for Doctrine_DataDict_Firebird

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Exception.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $ + *  $Id: Exception.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Exception'); +Doctrine::autoload('Doctrine_Exception');
22/** +/**
23 * Doctrine_DataDict_Exception + * Doctrine_DataDict_Exception
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  DataDict + * @subpackage  DataDict
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 2702 $ + * @version     $Revision: 2702 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_DataDict_Exception extends Doctrine_Exception +class Doctrine_DataDict_Exception extends Doctrine_Exception
34 { }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_DataDict_Mssql.html b/tests_old/coverage/Doctrine_DataDict_Mssql.html index 53d9bd26f..a7083ef16 100644 --- a/tests_old/coverage/Doctrine_DataDict_Mssql.html +++ b/tests_old/coverage/Doctrine_DataDict_Mssql.html @@ -10,570 +10,570 @@

Coverage for Doctrine_DataDict_Mssql

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Firebird.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Firebird.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_DataDict'); +Doctrine::autoload('Doctrine_DataDict');
22/** +/**
23 * @package     Doctrine + * @package     Doctrine
24 * @subpackage  DataDict + * @subpackage  DataDict
25 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
26 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
27 * @author      Lorenzo Alberton <l.alberton@quipo.it> (PEAR MDB2 Interbase driver) + * @author      Lorenzo Alberton <l.alberton@quipo.it> (PEAR MDB2 Interbase driver)
28 * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library) + * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
29 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31 * @since       1.0 + * @since       1.0
32 */ + */
33class Doctrine_DataDict_Firebird extends Doctrine_DataDict +class Doctrine_DataDict_Firebird extends Doctrine_DataDict
34{ +{
35    /** +    /**
36     * Obtain DBMS specific SQL code portion needed to declare an text type +     * Obtain DBMS specific SQL code portion needed to declare an text type
37     * field to be used in statements like CREATE TABLE. +     * field to be used in statements like CREATE TABLE.
38     * +     *
39     * @param array $field  associative array with the name of the properties +     * @param array $field  associative array with the name of the properties
40     *      of the field being declared as array indexes. Currently, the types +     *      of the field being declared as array indexes. Currently, the types
41     *      of supported field properties are as follows: +     *      of supported field properties are as follows:
42     * +     *
43     *      length +     *      length
44     *          Integer value that determines the maximum length of the text +     *          Integer value that determines the maximum length of the text
45     *          field. If this argument is missing the field should be +     *          field. If this argument is missing the field should be
46     *          declared to have the longest length allowed by the DBMS. +     *          declared to have the longest length allowed by the DBMS.
47     * +     *
48     *      default +     *      default
49     *          Text value to be used as default for this field. +     *          Text value to be used as default for this field.
50     * +     *
51     *      notnull +     *      notnull
52     *          Boolean flag that indicates whether this field is constrained +     *          Boolean flag that indicates whether this field is constrained
53     *          to not be set to null. +     *          to not be set to null.
54     * @return string  DBMS specific SQL code portion that should be used to +     * @return string  DBMS specific SQL code portion that should be used to
55     *      declare the specified field. +     *      declare the specified field.
56     */ +     */
57    public function getNativeDeclaration($field) +    public function getNativeDeclaration($field)
58    { +    {
59        if ( ! isset($field['type'])) { +        if ( ! isset($field['type'])) {
60            throw new Doctrine_DataDict_Exception('Missing column type.'); +            throw new Doctrine_DataDict_Exception('Missing column type.');
61        } +        }
62        switch ($field['type']) { +        switch ($field['type']) {
63            case 'varchar': +            case 'varchar':
64            case 'string': +            case 'string':
65            case 'array': +            case 'array':
66            case 'object': +            case 'object':
67            case 'char': +            case 'char':
68            case 'text': +            case 'text':
69            case 'gzip': +            case 'gzip':
70                $length = !empty($field['length']) +                $length = !empty($field['length'])
71                    ? $field['length'] : 16777215; // TODO: $this->conn->options['default_text_field_length']; +                    ? $field['length'] : 16777215; // TODO: $this->conn->options['default_text_field_length'];
72 +
73                $fixed  = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false; +                $fixed  = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false;
74 +
75                return $fixed ? 'CHAR('.$length.')' : 'VARCHAR('.$length.')'; +                return $fixed ? 'CHAR('.$length.')' : 'VARCHAR('.$length.')';
76            case 'clob': +            case 'clob':
77                return 'BLOB SUB_TYPE 1'; +                return 'BLOB SUB_TYPE 1';
78            case 'blob': +            case 'blob':
79                return 'BLOB SUB_TYPE 0'; +                return 'BLOB SUB_TYPE 0';
80            case 'integer': +            case 'integer':
81            case 'enum': +            case 'enum':
82            case 'int': +            case 'int':
83                return 'INT'; +                return 'INT';
84            case 'boolean': +            case 'boolean':
85                return 'SMALLINT'; +                return 'SMALLINT';
86            case 'date': +            case 'date':
87                return 'DATE'; +                return 'DATE';
88            case 'time': +            case 'time':
89                return 'TIME'; +                return 'TIME';
90            case 'timestamp': +            case 'timestamp':
91                return 'TIMESTAMP'; +                return 'TIMESTAMP';
92            case 'float': +            case 'float':
93                return 'DOUBLE PRECISION'; +                return 'DOUBLE PRECISION';
94            case 'decimal': +            case 'decimal':
95                $length = !empty($field['length']) ? $field['length'] : 18; +                $length = !empty($field['length']) ? $field['length'] : 18;
96                $scale = !empty($field['scale']) ? $field['scale'] : $this->conn->getAttribute(Doctrine::ATTR_DECIMAL_PLACES); +                $scale = !empty($field['scale']) ? $field['scale'] : $this->conn->getAttribute(Doctrine::ATTR_DECIMAL_PLACES);
97                return 'DECIMAL('.$length.','.$scale.')'; +                return 'DECIMAL('.$length.','.$scale.')';
98        } +        }
99 +
100        throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] .  '\'.'); +        throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] .  '\'.');
101    } +    }
102 +
103    /** +    /**
104     * Maps a native array description of a field to a Doctrine datatype and length +     * Maps a native array description of a field to a Doctrine datatype and length
105     * +     *
106     * @param array  $field native field description +     * @param array  $field native field description
107     * @return array containing the various possible types, length, sign, fixed +     * @return array containing the various possible types, length, sign, fixed
108     */ +     */
109    public function getPortableDeclaration($field) +    public function getPortableDeclaration($field)
110    { +    {
111        $length  = (isset($field['length']) && $field['length'] > 0) ? $field['length'] : null; +        $length  = (isset($field['length']) && $field['length'] > 0) ? $field['length'] : null;
112 +
113        $type = array(); +        $type = array();
114        $unsigned = $fixed = null; +        $unsigned = $fixed = null;
115        $dbType = strtolower($field['type']); +        $dbType = strtolower($field['type']);
116        $field['field_sub_type'] = !empty($field['field_sub_type']) +        $field['field_sub_type'] = !empty($field['field_sub_type'])
117            ? strtolower($field['field_sub_type']) : null; +            ? strtolower($field['field_sub_type']) : null;
118 +
119        if ( ! isset($field['name'])) { +        if ( ! isset($field['name'])) {
120            $field['name'] = ''; +            $field['name'] = '';
121        } +        }
122 +
123        switch ($dbType) { +        switch ($dbType) {
124            case 'smallint': +            case 'smallint':
125            case 'integer': +            case 'integer':
126            case 'int64': +            case 'int64':
127                //these may be 'numeric' or 'decimal' +                //these may be 'numeric' or 'decimal'
128                if (isset($field['field_sub_type'])) { +                if (isset($field['field_sub_type'])) {
129                    $field['type'] = $field['field_sub_type']; +                    $field['type'] = $field['field_sub_type'];
130                    return $this->getPortableDeclaration($field); +                    return $this->getPortableDeclaration($field);
131                } +                }
132            case 'bigint': +            case 'bigint':
133            case 'quad': +            case 'quad':
134                $type[] = 'integer'; +                $type[] = 'integer';
135                if ($length == '1') { +                if ($length == '1') {
136                    $type[] = 'boolean'; +                    $type[] = 'boolean';
137                    if (preg_match('/^(is|has)/', $field['name'])) { +                    if (preg_match('/^(is|has)/', $field['name'])) {
138                        $type = array_reverse($type); +                        $type = array_reverse($type);
139                    } +                    }
140                } +                }
141                break; +                break;
142            case 'varchar': +            case 'varchar':
143                $fixed = false; +                $fixed = false;
144            case 'char': +            case 'char':
145            case 'cstring': +            case 'cstring':
146                $type[] = 'string'; +                $type[] = 'string';
147                if ($length == '1') { +                if ($length == '1') {
148                    $type[] = 'boolean'; +                    $type[] = 'boolean';
149                    if (preg_match('/^(is|has)/', $field['name'])) { +                    if (preg_match('/^(is|has)/', $field['name'])) {
150                        $type = array_reverse($type); +                        $type = array_reverse($type);
151                    } +                    }
152                } +                }
153                if ($fixed !== false) { +                if ($fixed !== false) {
154                    $fixed = true; +                    $fixed = true;
155                } +                }
156                break; +                break;
157            case 'date': +            case 'date':
158                $type[] = 'date'; +                $type[] = 'date';
159                $length = null; +                $length = null;
160                break; +                break;
161            case 'timestamp': +            case 'timestamp':
162                $type[] = 'timestamp'; +                $type[] = 'timestamp';
163                $length = null; +                $length = null;
164                break; +                break;
165            case 'time': +            case 'time':
166                $type[] = 'time'; +                $type[] = 'time';
167                $length = null; +                $length = null;
168                break; +                break;
169            case 'float': +            case 'float':
170            case 'double': +            case 'double':
171            case 'double precision': +            case 'double precision':
172            case 'd_float': +            case 'd_float':
173                $type[] = 'float'; +                $type[] = 'float';
174                break; +                break;
175            case 'decimal': +            case 'decimal':
176            case 'numeric': +            case 'numeric':
177                $type[] = 'decimal'; +                $type[] = 'decimal';
178                break; +                break;
179            case 'blob': +            case 'blob':
180                $type[] = ($field['field_sub_type'] == 'text') ? 'clob' : 'blob'; +                $type[] = ($field['field_sub_type'] == 'text') ? 'clob' : 'blob';
181                $length = null; +                $length = null;
182                break; +                break;
183            default: +            default:
184                throw new Doctrine_DataDict_Exception('unknown database attribute type: '.$dbType); +                throw new Doctrine_DataDict_Exception('unknown database attribute type: '.$dbType);
185        } +        }
186 +
187        return array('type'     => $type, +        return array('type'     => $type,
188                     'length'   => $length, +                     'length'   => $length,
189                     'unsigned' => $unsigned, +                     'unsigned' => $unsigned,
190                     'fixed'    => $fixed); +                     'fixed'    => $fixed);
191    } +    }
192 +
193    /** +    /**
194     * Obtain DBMS specific SQL code portion needed to set the CHARACTER SET +     * Obtain DBMS specific SQL code portion needed to set the CHARACTER SET
195     * of a field declaration to be used in statements like CREATE TABLE. +     * of a field declaration to be used in statements like CREATE TABLE.
196     * +     *
197     * @param string $charset   name of the charset +     * @param string $charset   name of the charset
198     * @return string  DBMS specific SQL code portion needed to set the CHARACTER SET +     * @return string  DBMS specific SQL code portion needed to set the CHARACTER SET
199     *                 of a field declaration. +     *                 of a field declaration.
200     */ +     */
201    public function getCharsetFieldDeclaration($charset) +    public function getCharsetFieldDeclaration($charset)
202    { +    {
203        return 'CHARACTER SET ' . $charset; +        return 'CHARACTER SET ' . $charset;
204    } +    }
205 +
206    /** +    /**
207     * Obtain DBMS specific SQL code portion needed to set the COLLATION +     * Obtain DBMS specific SQL code portion needed to set the COLLATION
208     * of a field declaration to be used in statements like CREATE TABLE. +     * of a field declaration to be used in statements like CREATE TABLE.
209     * +     *
210     * @param string $collation   name of the collation +     * @param string $collation   name of the collation
211     * @return string  DBMS specific SQL code portion needed to set the COLLATION +     * @return string  DBMS specific SQL code portion needed to set the COLLATION
212     *                 of a field declaration. +     *                 of a field declaration.
213     */ +     */
214    public function getCollationFieldDeclaration($collation) +    public function getCollationFieldDeclaration($collation)
215    { +    {
216        return 'COLLATE ' . $collation; +        return 'COLLATE ' . $collation;
217    } +    }
218 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: Mssql.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Mssql.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_DataDict'); +Doctrine::autoload('Doctrine_DataDict');
22/** +/**
23 * @package     Doctrine + * @package     Doctrine
24 * @subpackage  DataDict + * @subpackage  DataDict
25 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
26 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
27 * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library) + * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
28 * @author      Frank M. Kromann <frank@kromann.info> (PEAR MDB2 Mssql driver) + * @author      Frank M. Kromann <frank@kromann.info> (PEAR MDB2 Mssql driver)
29 * @author      David Coallier <davidc@php.net> (PEAR MDB2 Mssql driver) + * @author      David Coallier <davidc@php.net> (PEAR MDB2 Mssql driver)
30 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
31 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
32 * @since       1.0 + * @since       1.0
33 */ + */
34class Doctrine_DataDict_Mssql extends Doctrine_DataDict +class Doctrine_DataDict_Mssql extends Doctrine_DataDict
35{ +{
36    /** +    /**
37     * Obtain DBMS specific SQL code portion needed to declare an text type +     * Obtain DBMS specific SQL code portion needed to declare an text type
38     * field to be used in statements like CREATE TABLE. +     * field to be used in statements like CREATE TABLE.
39     * +     *
40     * @param array $field  associative array with the name of the properties +     * @param array $field  associative array with the name of the properties
41     *      of the field being declared as array indexes. Currently, the types +     *      of the field being declared as array indexes. Currently, the types
42     *      of supported field properties are as follows: +     *      of supported field properties are as follows:
43     * +     *
44     *      length +     *      length
45     *          Integer value that determines the maximum length of the text +     *          Integer value that determines the maximum length of the text
46     *          field. If this argument is missing the field should be +     *          field. If this argument is missing the field should be
47     *          declared to have the longest length allowed by the DBMS. +     *          declared to have the longest length allowed by the DBMS.
48     * +     *
49     *      default +     *      default
50     *          Text value to be used as default for this field. +     *          Text value to be used as default for this field.
51     * +     *
52     *      notnull +     *      notnull
53     *          Boolean flag that indicates whether this field is constrained +     *          Boolean flag that indicates whether this field is constrained
54     *          to not be set to null. +     *          to not be set to null.
55     * +     *
56     * @return      string      DBMS specific SQL code portion that should be used to +     * @return      string      DBMS specific SQL code portion that should be used to
57     *                          declare the specified field. +     *                          declare the specified field.
58     */ +     */
59    public function getNativeDeclaration($field) +    public function getNativeDeclaration($field)
60    { +    {
61        if ( ! isset($field['type'])) { +        if ( ! isset($field['type'])) {
62            throw new Doctrine_DataDict_Exception('Missing column type.'); +            throw new Doctrine_DataDict_Exception('Missing column type.');
63        } +        }
64        switch ($field['type']) { +        switch ($field['type']) {
65            case 'array': +            case 'array':
66            case 'object': +            case 'object':
67            case 'text': +            case 'text':
68            case 'char': +            case 'char':
69            case 'varchar': +            case 'varchar':
70            case 'string': +            case 'string':
71            case 'gzip': +            case 'gzip':
72                $length = !empty($field['length']) +                $length = !empty($field['length'])
73                    ? $field['length'] : false; +                    ? $field['length'] : false;
74 +
75                $fixed  = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false; +                $fixed  = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false;
76 +
77                return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR('.$this->conn->options['default_text_field_length'].')') +                return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR('.$this->conn->options['default_text_field_length'].')')
78                    : ($length ? 'VARCHAR('.$length.')' : 'TEXT'); +                    : ($length ? 'VARCHAR('.$length.')' : 'TEXT');
79            case 'clob': +            case 'clob':
80                if ( ! empty($field['length'])) { +                if ( ! empty($field['length'])) {
81                    $length = $field['length']; +                    $length = $field['length'];
82                    if ($length <= 8000) { +                    if ($length <= 8000) {
83                        return 'VARCHAR('.$length.')'; +                        return 'VARCHAR('.$length.')';
84                    } +                    }
85                 } +                 }
86                 return 'TEXT'; +                 return 'TEXT';
87            case 'blob': +            case 'blob':
88                if ( ! empty($field['length'])) { +                if ( ! empty($field['length'])) {
89                    $length = $field['length']; +                    $length = $field['length'];
90                    if ($length <= 8000) { +                    if ($length <= 8000) {
91                        return "VARBINARY($length)"; +                        return "VARBINARY($length)";
92                    } +                    }
93                } +                }
94                return 'IMAGE'; +                return 'IMAGE';
95            case 'integer': +            case 'integer':
96            case 'enum': +            case 'enum':
97            case 'int': +            case 'int':
98                return 'INT'; +                return 'INT';
99            case 'boolean': +            case 'boolean':
100                return 'BIT'; +                return 'BIT';
101            case 'date': +            case 'date':
102                return 'CHAR(' . strlen('YYYY-MM-DD') . ')'; +                return 'CHAR(' . strlen('YYYY-MM-DD') . ')';
103            case 'time': +            case 'time':
104                return 'CHAR(' . strlen('HH:MM:SS') . ')'; +                return 'CHAR(' . strlen('HH:MM:SS') . ')';
105            case 'timestamp': +            case 'timestamp':
106                return 'CHAR(' . strlen('YYYY-MM-DD HH:MM:SS') . ')'; +                return 'CHAR(' . strlen('YYYY-MM-DD HH:MM:SS') . ')';
107            case 'float': +            case 'float':
108                return 'FLOAT'; +                return 'FLOAT';
109            case 'decimal': +            case 'decimal':
110                $length = !empty($field['length']) ? $field['length'] : 18; +                $length = !empty($field['length']) ? $field['length'] : 18;
111                $scale = !empty($field['scale']) ? $field['scale'] : $this->conn->getAttribute(Doctrine::ATTR_DECIMAL_PLACES); +                $scale = !empty($field['scale']) ? $field['scale'] : $this->conn->getAttribute(Doctrine::ATTR_DECIMAL_PLACES);
112                return 'DECIMAL('.$length.','.$scale.')'; +                return 'DECIMAL('.$length.','.$scale.')';
113        } +        }
114 +
115        throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] .  '\'.'); +        throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] .  '\'.');
116    } +    }
117 +
118    /** +    /**
119     * Maps a native array description of a field to a MDB2 datatype and length +     * Maps a native array description of a field to a MDB2 datatype and length
120     * +     *
121     * @param   array           $field native field description +     * @param   array           $field native field description
122     * @return  array           containing the various possible types, length, sign, fixed +     * @return  array           containing the various possible types, length, sign, fixed
123     */ +     */
124    public function getPortableDeclaration($field) +    public function getPortableDeclaration($field)
125    { +    {
126        $db_type = preg_replace('/\d/','', strtolower($field['type']) ); +        $db_type = preg_replace('/\d/','', strtolower($field['type']) );
127        $length  = (isset($field['length']) && $field['length'] > 0) ? $field['length'] : null; +        $length  = (isset($field['length']) && $field['length'] > 0) ? $field['length'] : null;
128 +
129        $type = array(); +        $type = array();
130        // todo: unsigned handling seems to be missing +        // todo: unsigned handling seems to be missing
131        $unsigned = $fixed = null; +        $unsigned = $fixed = null;
132 +
133        if ( ! isset($field['name'])) +        if ( ! isset($field['name']))
134            $field['name'] = ''; +            $field['name'] = '';
135 +
136        switch ($db_type) { +        switch ($db_type) {
137            case 'bit': +            case 'bit':
138                $type[0] = 'boolean'; +                $type[0] = 'boolean';
139            break; +            break;
140            case 'int': +            case 'int':
141                $type[0] = 'integer'; +                $type[0] = 'integer';
142                if ($length == 1) { +                if ($length == 1) {
143                    $type[] = 'boolean'; +                    $type[] = 'boolean';
144                } +                }
145            break; +            break;
146            case 'datetime': +            case 'datetime':
147                $type[0] = 'timestamp'; +                $type[0] = 'timestamp';
148            break; +            break;
149            case 'float': +            case 'float':
150            case 'real': +            case 'real':
151            case 'numeric': +            case 'numeric':
152                $type[0] = 'float'; +                $type[0] = 'float';
153            break; +            break;
154            case 'decimal': +            case 'decimal':
155            case 'money': +            case 'money':
156                $type[0] = 'decimal'; +                $type[0] = 'decimal';
157            break; +            break;
158            case 'text': +            case 'text':
159            case 'varchar': +            case 'varchar':
160                $fixed = false; +                $fixed = false;
161            case 'char': +            case 'char':
162                $type[0] = 'string'; +                $type[0] = 'string';
163                if ($length == '1') { +                if ($length == '1') {
164                    $type[] = 'boolean'; +                    $type[] = 'boolean';
165                    if (preg_match('/^[is|has]/', $field['name'])) { +                    if (preg_match('/^[is|has]/', $field['name'])) {
166                        $type = array_reverse($type); +                        $type = array_reverse($type);
167                    } +                    }
168                } elseif (strstr($db_type, 'text')) { +                } elseif (strstr($db_type, 'text')) {
169                    $type[] = 'clob'; +                    $type[] = 'clob';
170                } +                }
171                if ($fixed !== false) { +                if ($fixed !== false) {
172                    $fixed = true; +                    $fixed = true;
173                } +                }
174            break; +            break;
175            case 'image': +            case 'image':
176            case 'varbinary': +            case 'varbinary':
177                $type[] = 'blob'; +                $type[] = 'blob';
178                $length = null; +                $length = null;
179            break; +            break;
180            default: +            default:
181                throw new Doctrine_DataDict_Exception('unknown database attribute type: '.$db_type); +                throw new Doctrine_DataDict_Exception('unknown database attribute type: '.$db_type);
182        } +        }
183 +
184        return array('type'     => $type, +        return array('type'     => $type,
185                     'length'   => $length, +                     'length'   => $length,
186                     'unsigned' => $unsigned, +                     'unsigned' => $unsigned,
187                     'fixed'    => $fixed); +                     'fixed'    => $fixed);
188    } +    }
189} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_DataDict_Mysql.html b/tests_old/coverage/Doctrine_DataDict_Mysql.html index 1c2ea9cc5..17c35bd20 100644 --- a/tests_old/coverage/Doctrine_DataDict_Mysql.html +++ b/tests_old/coverage/Doctrine_DataDict_Mysql.html @@ -64,7 +64,7 @@  * and is licensed under the LGPL. For more information, see 19 - * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>. 20  */ @@ -94,7 +94,7 @@  * @version     $Revision: 3084 $ 29 - * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org 30  * @since       1.0 @@ -1336,7 +1336,7 @@     public function getIntegerDeclaration($name, $field) 443 -    { +    { 444         $default = $autoinc = ''; @@ -1357,16 +1357,16 @@                 $field['default'] = empty($field['notnull']) ? null : 0; 450 -            } +            } 451 -            if (is_null($field['default'])) { +            if (is_null($field['default'])) { 452 -                $default = ' DEFAULT NULL'; +                $default = ' DEFAULT NULL'; 453 -            } else { +            } else { 454                 $default = ' DEFAULT '.$this->conn->quote($field['default']); diff --git a/tests_old/coverage/Doctrine_DataDict_Oracle.html b/tests_old/coverage/Doctrine_DataDict_Oracle.html index 4545a1269..d05b70542 100644 --- a/tests_old/coverage/Doctrine_DataDict_Oracle.html +++ b/tests_old/coverage/Doctrine_DataDict_Oracle.html @@ -10,600 +10,600 @@

Coverage for Doctrine_DataDict_Oracle

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: Oracle.php 3159 2007-11-15 05:16:31Z Jonathan.Wage $ + *  $Id: Oracle.php 3159 2007-11-15 05:16:31Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_DataDict'); +Doctrine::autoload('Doctrine_DataDict');
22/** +/**
23 * @package     Doctrine + * @package     Doctrine
24 * @subpackage  DataDict + * @subpackage  DataDict
25 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
26 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
27 * @version     $Revision: 3159 $ + * @version     $Revision: 3159 $
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 */ + */
31class Doctrine_DataDict_Oracle extends Doctrine_DataDict +class Doctrine_DataDict_Oracle extends Doctrine_DataDict
32{ +{
33    /** +    /**
34     * Obtain DBMS specific SQL code portion needed to declare an text type +     * Obtain DBMS specific SQL code portion needed to declare an text type
35     * field to be used in statements like CREATE TABLE. +     * field to be used in statements like CREATE TABLE.
36     * +     *
37     * @param array $field  associative array with the name of the properties +     * @param array $field  associative array with the name of the properties
38     *      of the field being declared as array indexes. Currently, the types +     *      of the field being declared as array indexes. Currently, the types
39     *      of supported field properties are as follows: +     *      of supported field properties are as follows:
40     * +     *
41     *      length +     *      length
42     *          Integer value that determines the maximum length of the text +     *          Integer value that determines the maximum length of the text
43     *          field. If this argument is missing the field should be +     *          field. If this argument is missing the field should be
44     *          declared to have the longest length allowed by the DBMS. +     *          declared to have the longest length allowed by the DBMS.
45     * +     *
46     *      default +     *      default
47     *          Text value to be used as default for this field. +     *          Text value to be used as default for this field.
48     * +     *
49     *      notnull +     *      notnull
50     *          Boolean flag that indicates whether this field is constrained +     *          Boolean flag that indicates whether this field is constrained
51     *          to not be set to null. +     *          to not be set to null.
52     * @return string  DBMS specific SQL code portion that should be used to +     * @return string  DBMS specific SQL code portion that should be used to
53     *      declare the specified field. +     *      declare the specified field.
54     */ +     */
55    public function getNativeDeclaration(array $field) +    public function getNativeDeclaration(array $field)
56    { +    {
57        if ( ! isset($field['type'])) { +        if ( ! isset($field['type'])) {
58            throw new Doctrine_DataDict_Exception('Missing column type.'); +            throw new Doctrine_DataDict_Exception('Missing column type.');
59        } +        }
60        switch ($field['type']) { +        switch ($field['type']) {
61            case 'string': +            case 'string':
62            case 'array': +            case 'array':
63            case 'object': +            case 'object':
64            case 'gzip': +            case 'gzip':
65            case 'char': +            case 'char':
66            case 'varchar': +            case 'varchar':
67                $length = !empty($field['length']) +                $length = !empty($field['length'])
68                    ? $field['length'] : 16777215; // TODO: $this->conn->options['default_text_field_length']; +                    ? $field['length'] : 16777215; // TODO: $this->conn->options['default_text_field_length'];
69 +
70                $fixed  = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false; +                $fixed  = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false;
71 +
72                return $fixed ? 'CHAR('.$length.')' : 'VARCHAR2('.$length.')'; +                return $fixed ? 'CHAR('.$length.')' : 'VARCHAR2('.$length.')';
73            case 'clob': +            case 'clob':
74                return 'CLOB'; +                return 'CLOB';
75            case 'blob': +            case 'blob':
76                return 'BLOB'; +                return 'BLOB';
77            case 'integer': +            case 'integer':
78            case 'enum': +            case 'enum':
79            case 'int': +            case 'int':
80                if ( ! empty($field['length'])) { +                if ( ! empty($field['length'])) {
81                    return 'NUMBER('.$field['length'].')'; +                    return 'NUMBER('.$field['length'].')';
82                } +                }
83                return 'INT'; +                return 'INT';
84            case 'boolean': +            case 'boolean':
85                return 'NUMBER(1)'; +                return 'NUMBER(1)';
86            case 'date': +            case 'date':
87            case 'time': +            case 'time':
88            case 'timestamp': +            case 'timestamp':
89                return 'DATE'; +                return 'DATE';
90            case 'float': +            case 'float':
91            case 'double': +            case 'double':
92                return 'NUMBER'; +                return 'NUMBER';
93            case 'decimal': +            case 'decimal':
94                $scale = !empty($field['scale']) ? $field['scale'] : $this->conn->getAttribute(Doctrine::ATTR_DECIMAL_PLACES); +                $scale = !empty($field['scale']) ? $field['scale'] : $this->conn->getAttribute(Doctrine::ATTR_DECIMAL_PLACES);
95                return 'NUMBER(*,'.$scale.')'; +                return 'NUMBER(*,'.$scale.')';
96            default: +            default:
97        } +        }
98        throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] .  '\'.'); +        throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] .  '\'.');
99    } +    }
100 +
101    /** +    /**
102     * Maps a native array description of a field to a doctrine datatype and length +     * Maps a native array description of a field to a doctrine datatype and length
103     * +     *
104     * @param array  $field native field description +     * @param array  $field native field description
105     * @return array containing the various possible types, length, sign, fixed +     * @return array containing the various possible types, length, sign, fixed
106     * @throws Doctrine_DataDict_Oracle_Exception +     * @throws Doctrine_DataDict_Oracle_Exception
107     */ +     */
108    public function getPortableDeclaration(array $field) +    public function getPortableDeclaration(array $field)
109    { +    {
110        if ( ! isset($field['data_type'])) { +        if ( ! isset($field['data_type'])) {
111            throw new Doctrine_DataDict_Exception('Native oracle definition must have a data_type key specified'); +            throw new Doctrine_DataDict_Exception('Native oracle definition must have a data_type key specified');
112        } +        }
113         +        
114        $dbType = strtolower($field['data_type']); +        $dbType = strtolower($field['data_type']);
115        $type = array(); +        $type = array();
116        $length = $unsigned = $fixed = null; +        $length = $unsigned = $fixed = null;
117        if ( ! empty($field['data_length'])) { +        if ( ! empty($field['data_length'])) {
118            $length = $field['data_length']; +            $length = $field['data_length'];
119        } +        }
120 +
121        if ( ! isset($field['column_name'])) { +        if ( ! isset($field['column_name'])) {
122            $field['column_name'] = ''; +            $field['column_name'] = '';
123        } +        }
124 +
125        switch ($dbType) { +        switch ($dbType) {
126            case 'integer': +            case 'integer':
127            case 'pls_integer': +            case 'pls_integer':
128            case 'binary_integer': +            case 'binary_integer':
129                $type[] = 'integer'; +                $type[] = 'integer';
130                if ($length == '1') { +                if ($length == '1') {
131                    $type[] = 'boolean'; +                    $type[] = 'boolean';
132                    if (preg_match('/^(is|has)/', $field['column_name'])) { +                    if (preg_match('/^(is|has)/', $field['column_name'])) {
133                        $type = array_reverse($type); +                        $type = array_reverse($type);
134                    } +                    }
135                } +                }
136                break; +                break;
137            case 'varchar': +            case 'varchar':
138            case 'varchar2': +            case 'varchar2':
139            case 'nvarchar2': +            case 'nvarchar2':
140                $fixed = false; +                $fixed = false;
141            case 'char': +            case 'char':
142            case 'nchar': +            case 'nchar':
143                $type[] = 'string'; +                $type[] = 'string';
144                if ($length == '1') { +                if ($length == '1') {
145                    $type[] = 'boolean'; +                    $type[] = 'boolean';
146                    if (preg_match('/^(is|has)/', $field['column_name'])) { +                    if (preg_match('/^(is|has)/', $field['column_name'])) {
147                        $type = array_reverse($type); +                        $type = array_reverse($type);
148                    } +                    }
149                } +                }
150                if ($fixed !== false) { +                if ($fixed !== false) {
151                    $fixed = true; +                    $fixed = true;
152                } +                }
153                break; +                break;
154            case 'date': +            case 'date':
155            case 'timestamp': +            case 'timestamp':
156                $type[] = 'timestamp'; +                $type[] = 'timestamp';
157                $length = null; +                $length = null;
158                break; +                break;
159            case 'float': +            case 'float':
160                $type[] = 'float'; +                $type[] = 'float';
161                break; +                break;
162            case 'number': +            case 'number':
163                if ( ! empty($field['data_scale'])) { +                if ( ! empty($field['data_scale'])) {
164                    $type[] = 'decimal'; +                    $type[] = 'decimal';
165                } else { +                } else {
166                    $type[] = 'integer'; +                    $type[] = 'integer';
167                    if ($length == '1') { +                    if ($length == '1') {
168                        $type[] = 'boolean'; +                        $type[] = 'boolean';
169                        if (preg_match('/^(is|has)/', $field['column_name'])) { +                        if (preg_match('/^(is|has)/', $field['column_name'])) {
170                            $type = array_reverse($type); +                            $type = array_reverse($type);
171                        } +                        }
172                    } +                    }
173                } +                }
174                break; +                break;
175            case 'long': +            case 'long':
176                $type[] = 'string'; +                $type[] = 'string';
177            case 'clob': +            case 'clob':
178            case 'nclob': +            case 'nclob':
179                $type[] = 'clob'; +                $type[] = 'clob';
180                break; +                break;
181            case 'blob': +            case 'blob':
182            case 'raw': +            case 'raw':
183            case 'long raw': +            case 'long raw':
184            case 'bfile': +            case 'bfile':
185                $type[] = 'blob'; +                $type[] = 'blob';
186                $length = null; +                $length = null;
187            break; +            break;
188            case 'rowid': +            case 'rowid':
189            case 'urowid': +            case 'urowid':
190            default: +            default:
191                throw new Doctrine_DataDict_Exception('unknown database attribute type: ' . $dbType); +                throw new Doctrine_DataDict_Exception('unknown database attribute type: ' . $dbType);
192        } +        }
193 +
194        return array('type'     => $type, +        return array('type'     => $type,
195                     'length'   => $length, +                     'length'   => $length,
196                     'unsigned' => $unsigned, +                     'unsigned' => $unsigned,
197                     'fixed'    => $fixed); +                     'fixed'    => $fixed);
198    } +    }
199} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_DataDict_Pgsql.html b/tests_old/coverage/Doctrine_DataDict_Pgsql.html index 2576f305c..a65daaa91 100644 --- a/tests_old/coverage/Doctrine_DataDict_Pgsql.html +++ b/tests_old/coverage/Doctrine_DataDict_Pgsql.html @@ -64,7 +64,7 @@  * and is licensed under the LGPL. For more information, see 19 - * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>. 20  */ @@ -97,7 +97,7 @@  * @version     $Revision: 2963 $ 30 - * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org 31  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_DataDict_Sqlite.html b/tests_old/coverage/Doctrine_DataDict_Sqlite.html index 0a340b707..e6bc23894 100644 --- a/tests_old/coverage/Doctrine_DataDict_Sqlite.html +++ b/tests_old/coverage/Doctrine_DataDict_Sqlite.html @@ -10,901 +10,901 @@

Coverage for Doctrine_DataDict_Sqlite

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Event.html b/tests_old/coverage/Doctrine_Event.html index c8fe58a7b..dd683b06b 100644 --- a/tests_old/coverage/Doctrine_Event.html +++ b/tests_old/coverage/Doctrine_Event.html @@ -10,990 +10,990 @@

Coverage for Doctrine_Event

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Sqlite.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Sqlite.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_DataDict'); +Doctrine::autoload('Doctrine_DataDict');
22/** +/**
23 * @package     Doctrine + * @package     Doctrine
24 * @subpackage  DataDict + * @subpackage  DataDict
25 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
26 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
27 * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library) + * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
28 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30 * @since       1.0 + * @since       1.0
31 */ + */
32class Doctrine_DataDict_Sqlite extends Doctrine_DataDict +class Doctrine_DataDict_Sqlite extends Doctrine_DataDict
33{ +{
34    /** +    /**
35     * Obtain DBMS specific SQL code portion needed to declare an text type +     * Obtain DBMS specific SQL code portion needed to declare an text type
36     * field to be used in statements like CREATE TABLE. +     * field to be used in statements like CREATE TABLE.
37     * +     *
38     * @param array $field  associative array with the name of the properties +     * @param array $field  associative array with the name of the properties
39     *      of the field being declared as array indexes. Currently, the types +     *      of the field being declared as array indexes. Currently, the types
40     *      of supported field properties are as follows: +     *      of supported field properties are as follows:
41     * +     *
42     *      length +     *      length
43     *          Integer value that determines the maximum length of the text +     *          Integer value that determines the maximum length of the text
44     *          field. If this argument is missing the field should be +     *          field. If this argument is missing the field should be
45     *          declared to have the longest length allowed by the DBMS. +     *          declared to have the longest length allowed by the DBMS.
46     * +     *
47     *      default +     *      default
48     *          Text value to be used as default for this field. +     *          Text value to be used as default for this field.
49     * +     *
50     *      notnull +     *      notnull
51     *          Boolean flag that indicates whether this field is constrained +     *          Boolean flag that indicates whether this field is constrained
52     *          to not be set to null. +     *          to not be set to null.
53     * @author Lukas Smith (PEAR MDB2 library) +     * @author Lukas Smith (PEAR MDB2 library)
54     * @return string  DBMS specific SQL code portion that should be used to +     * @return string  DBMS specific SQL code portion that should be used to
55     *      declare the specified field. +     *      declare the specified field.
56     */ +     */
57    public function getNativeDeclaration(array $field) +    public function getNativeDeclaration(array $field)
58    { +    {
59        if ( ! isset($field['type'])) { +        if ( ! isset($field['type'])) {
60            throw new Doctrine_DataDict_Exception('Missing column type.'); +            throw new Doctrine_DataDict_Exception('Missing column type.');
61        } +        }
62        switch ($field['type']) { +        switch ($field['type']) {
63            case 'text': +            case 'text':
64            case 'object': +            case 'object':
65            case 'array': +            case 'array':
66            case 'string': +            case 'string':
67            case 'char': +            case 'char':
68            case 'gzip': +            case 'gzip':
69            case 'varchar': +            case 'varchar':
70                $length = (isset($field['length']) && $field['length']) ? $field['length'] : null; +                $length = (isset($field['length']) && $field['length']) ? $field['length'] : null;
71 +
72                $fixed  = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false; +                $fixed  = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false;
73 +
74                return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR('.$this->conn->getAttribute(Doctrine::ATTR_DEFAULT_TEXTFLD_LENGTH).')') +                return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR('.$this->conn->getAttribute(Doctrine::ATTR_DEFAULT_TEXTFLD_LENGTH).')')
75                    : ($length ? 'VARCHAR('.$length.')' : 'TEXT'); +                    : ($length ? 'VARCHAR('.$length.')' : 'TEXT');
76            case 'clob': +            case 'clob':
77                if ( ! empty($field['length'])) { +                if ( ! empty($field['length'])) {
78                    $length = $field['length']; +                    $length = $field['length'];
79                    if ($length <= 255) { +                    if ($length <= 255) {
80                        return 'TINYTEXT'; +                        return 'TINYTEXT';
81                    } elseif ($length <= 65535) { +                    } elseif ($length <= 65535) {
82                        return 'TEXT'; +                        return 'TEXT';
83                    } elseif ($length <= 16777215) { +                    } elseif ($length <= 16777215) {
84                        return 'MEDIUMTEXT'; +                        return 'MEDIUMTEXT';
85                    } +                    }
86                } +                }
87                return 'LONGTEXT'; +                return 'LONGTEXT';
88            case 'blob': +            case 'blob':
89                if ( ! empty($field['length'])) { +                if ( ! empty($field['length'])) {
90                    $length = $field['length']; +                    $length = $field['length'];
91                    if ($length <= 255) { +                    if ($length <= 255) {
92                        return 'TINYBLOB'; +                        return 'TINYBLOB';
93                    } elseif ($length <= 65535) { +                    } elseif ($length <= 65535) {
94                        return 'BLOB'; +                        return 'BLOB';
95                    } elseif ($length <= 16777215) { +                    } elseif ($length <= 16777215) {
96                        return 'MEDIUMBLOB'; +                        return 'MEDIUMBLOB';
97                    } +                    }
98                } +                }
99                return 'LONGBLOB'; +                return 'LONGBLOB';
100            case 'enum': +            case 'enum':
101            case 'integer': +            case 'integer':
102            case 'boolean': +            case 'boolean':
103            case 'int': +            case 'int':
104                return 'INTEGER'; +                return 'INTEGER';
105            case 'date': +            case 'date':
106                return 'DATE'; +                return 'DATE';
107            case 'time': +            case 'time':
108                return 'TIME'; +                return 'TIME';
109            case 'timestamp': +            case 'timestamp':
110                return 'DATETIME'; +                return 'DATETIME';
111            case 'float': +            case 'float':
112            case 'double': +            case 'double':
113                return 'DOUBLE';//($this->conn->options['fixed_float'] ? '('. +                return 'DOUBLE';//($this->conn->options['fixed_float'] ? '('.
114                    //($this->conn->options['fixed_float']+2).','.$this->conn->options['fixed_float'].')' : ''); +                    //($this->conn->options['fixed_float']+2).','.$this->conn->options['fixed_float'].')' : '');
115            case 'decimal': +            case 'decimal':
116                $length = !empty($field['length']) ? $field['length'] : 18; +                $length = !empty($field['length']) ? $field['length'] : 18;
117                $scale = !empty($field['scale']) ? $field['scale'] : $this->conn->getAttribute(Doctrine::ATTR_DECIMAL_PLACES); +                $scale = !empty($field['scale']) ? $field['scale'] : $this->conn->getAttribute(Doctrine::ATTR_DECIMAL_PLACES);
118                return 'DECIMAL('.$length.','.$scale.')'; +                return 'DECIMAL('.$length.','.$scale.')';
119        } +        }
120        throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] .  '\'.'); +        throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] .  '\'.');
121    } +    }
122 +
123    /** +    /**
124     * Maps a native array description of a field to Doctrine datatype and length +     * Maps a native array description of a field to Doctrine datatype and length
125     * +     *
126     * @param array  $field native field description +     * @param array  $field native field description
127     * @return array containing the various possible types, length, sign, fixed +     * @return array containing the various possible types, length, sign, fixed
128     */ +     */
129    public function getPortableDeclaration(array $field) +    public function getPortableDeclaration(array $field)
130    { +    {
131        $dbType = strtolower($field['type']); +        $dbType = strtolower($field['type']);
132        $length = (isset($field['length'])) ? $field['length'] : null; +        $length = (isset($field['length'])) ? $field['length'] : null;
133        $unsigned = (isset($field['unsigned'])) ? $field['unsigned'] : null; +        $unsigned = (isset($field['unsigned'])) ? $field['unsigned'] : null;
134        $fixed = null; +        $fixed = null;
135        $type = array(); +        $type = array();
136 +
137        if ( ! isset($field['name'])) { +        if ( ! isset($field['name'])) {
138            $field['name'] = ''; +            $field['name'] = '';
139        } +        }
140 +
141        switch ($dbType) { +        switch ($dbType) {
142            case 'boolean': +            case 'boolean':
143                $type[] = 'boolean'; +                $type[] = 'boolean';
144                break; +                break;
145            case 'tinyint': +            case 'tinyint':
146                $type[] = 'integer'; +                $type[] = 'integer';
147                $type[] = 'boolean'; +                $type[] = 'boolean';
148                if (preg_match('/^(is|has)/', $field['name'])) { +                if (preg_match('/^(is|has)/', $field['name'])) {
149                    $type = array_reverse($type); +                    $type = array_reverse($type);
150                } +                }
151                $unsigned = preg_match('/ unsigned/i', $field['type']); +                $unsigned = preg_match('/ unsigned/i', $field['type']);
152                $length = 1; +                $length = 1;
153                break; +                break;
154            case 'smallint': +            case 'smallint':
155                $type[] = 'integer'; +                $type[] = 'integer';
156                $unsigned = preg_match('/ unsigned/i', $field['type']); +                $unsigned = preg_match('/ unsigned/i', $field['type']);
157                $length = 2; +                $length = 2;
158                break; +                break;
159            case 'mediumint': +            case 'mediumint':
160                $type[] = 'integer'; +                $type[] = 'integer';
161                $unsigned = preg_match('/ unsigned/i', $field['type']); +                $unsigned = preg_match('/ unsigned/i', $field['type']);
162                $length = 3; +                $length = 3;
163                break; +                break;
164            case 'int': +            case 'int':
165            case 'integer': +            case 'integer':
166            case 'serial': +            case 'serial':
167                $type[] = 'integer'; +                $type[] = 'integer';
168                $unsigned = preg_match('/ unsigned/i', $field['type']); +                $unsigned = preg_match('/ unsigned/i', $field['type']);
169                $length = 4; +                $length = 4;
170                break; +                break;
171            case 'bigint': +            case 'bigint':
172            case 'bigserial': +            case 'bigserial':
173                $type[] = 'integer'; +                $type[] = 'integer';
174                $unsigned = preg_match('/ unsigned/i', $field['type']); +                $unsigned = preg_match('/ unsigned/i', $field['type']);
175                $length = 8; +                $length = 8;
176                break; +                break;
177            case 'clob': +            case 'clob':
178            case 'tinytext': +            case 'tinytext':
179            case 'mediumtext': +            case 'mediumtext':
180            case 'longtext': +            case 'longtext':
181            case 'text': +            case 'text':
182            case 'varchar': +            case 'varchar':
183            case 'varchar2': +            case 'varchar2':
184                $fixed = false; +                $fixed = false;
185            case 'char': +            case 'char':
186                $type[] = 'text'; +                $type[] = 'text';
187                if ($length == '1') { +                if ($length == '1') {
188                    $type[] = 'boolean'; +                    $type[] = 'boolean';
189                    if (preg_match('/^(is|has)/', $field['name'])) { +                    if (preg_match('/^(is|has)/', $field['name'])) {
190                        $type = array_reverse($type); +                        $type = array_reverse($type);
191                    } +                    }
192                } elseif (strstr($dbType, 'text')) { +                } elseif (strstr($dbType, 'text')) {
193                    $type[] = 'clob'; +                    $type[] = 'clob';
194                } +                }
195                if ($fixed !== false) { +                if ($fixed !== false) {
196                    $fixed = true; +                    $fixed = true;
197                } +                }
198                break; +                break;
199            case 'date': +            case 'date':
200                $type[] = 'date'; +                $type[] = 'date';
201                $length = null; +                $length = null;
202                break; +                break;
203            case 'datetime': +            case 'datetime':
204            case 'timestamp': +            case 'timestamp':
205                $type[] = 'timestamp'; +                $type[] = 'timestamp';
206                $length = null; +                $length = null;
207                break; +                break;
208            case 'time': +            case 'time':
209                $type[] = 'time'; +                $type[] = 'time';
210                $length = null; +                $length = null;
211                break; +                break;
212            case 'float': +            case 'float':
213            case 'double': +            case 'double':
214            case 'real': +            case 'real':
215                $type[] = 'float'; +                $type[] = 'float';
216                $length = null; +                $length = null;
217                break; +                break;
218            case 'decimal': +            case 'decimal':
219            case 'numeric': +            case 'numeric':
220                $type[] = 'decimal'; +                $type[] = 'decimal';
221                $length = null; +                $length = null;
222                break; +                break;
223            case 'tinyblob': +            case 'tinyblob':
224            case 'mediumblob': +            case 'mediumblob':
225            case 'longblob': +            case 'longblob':
226            case 'blob': +            case 'blob':
227                $type[] = 'blob'; +                $type[] = 'blob';
228                $length = null; +                $length = null;
229                break; +                break;
230            case 'year': +            case 'year':
231                $type[] = 'integer'; +                $type[] = 'integer';
232                $type[] = 'date'; +                $type[] = 'date';
233                $length = null; +                $length = null;
234                break; +                break;
235            default: +            default:
236                throw new Doctrine_DataDict_Exception('unknown database attribute type: '.$dbType); +                throw new Doctrine_DataDict_Exception('unknown database attribute type: '.$dbType);
237        } +        }
238 +
239        return array('type'     => $type, +        return array('type'     => $type,
240                     'length'   => $length, +                     'length'   => $length,
241                     'unsigned' => $unsigned, +                     'unsigned' => $unsigned,
242                     'fixed'    => $fixed); +                     'fixed'    => $fixed);
243    } +    }
244 +
245    /** +    /**
246     * Obtain DBMS specific SQL code portion needed to declare an integer type +     * Obtain DBMS specific SQL code portion needed to declare an integer type
247     * field to be used in statements like CREATE TABLE. +     * field to be used in statements like CREATE TABLE.
248     * +     *
249     * @param string  $name   name the field to be declared. +     * @param string  $name   name the field to be declared.
250     * @param array  $field   associative array with the name of the properties +     * @param array  $field   associative array with the name of the properties
251     *                        of the field being declared as array indexes. +     *                        of the field being declared as array indexes.
252     *                        Currently, the types of supported field +     *                        Currently, the types of supported field
253     *                        properties are as follows: +     *                        properties are as follows:
254     * +     *
255     *                       unsigned +     *                       unsigned
256     *                        Boolean flag that indicates whether the field +     *                        Boolean flag that indicates whether the field
257     *                        should be declared as unsigned integer if +     *                        should be declared as unsigned integer if
258     *                        possible. +     *                        possible.
259     * +     *
260     *                       default +     *                       default
261     *                        Integer value to be used as default for this +     *                        Integer value to be used as default for this
262     *                        field. +     *                        field.
263     * +     *
264     *                       notnull +     *                       notnull
265     *                        Boolean flag that indicates whether this field is +     *                        Boolean flag that indicates whether this field is
266     *                        constrained to not be set to null. +     *                        constrained to not be set to null.
267     * @return string  DBMS specific SQL code portion that should be used to +     * @return string  DBMS specific SQL code portion that should be used to
268     *                 declare the specified field. +     *                 declare the specified field.
269     * @access protected +     * @access protected
270     */ +     */
271    public function getIntegerDeclaration($name, array $field) +    public function getIntegerDeclaration($name, array $field)
272    { +    {
273        $default = $autoinc = ''; +        $default = $autoinc = '';
274        $type    = $this->getNativeDeclaration($field); +        $type    = $this->getNativeDeclaration($field);
275 +
276        $autoincrement = isset($field['autoincrement']) && $field['autoincrement']; +        $autoincrement = isset($field['autoincrement']) && $field['autoincrement'];
277 +
278        if ($autoincrement) { +        if ($autoincrement) {
279            $autoinc = ' PRIMARY KEY AUTOINCREMENT'; +            $autoinc = ' PRIMARY KEY AUTOINCREMENT';
280            $type    = 'INTEGER'; +            $type    = 'INTEGER';
281        } elseif (array_key_exists('default', $field)) { +        } elseif (array_key_exists('default', $field)) {
282            if ($field['default'] === '') { +            if ($field['default'] === '') {
283                $field['default'] = empty($field['notnull']) ? null : 0; +                $field['default'] = empty($field['notnull']) ? null : 0;
284            } +            }
285            $default = ' DEFAULT ' . $this->conn->quote($field['default'], $field['type']); +            $default = ' DEFAULT ' . $this->conn->quote($field['default'], $field['type']);
286        }/** +        }/**
287        elseif (empty($field['notnull'])) { +        elseif (empty($field['notnull'])) {
288            $default = ' DEFAULT NULL'; +            $default = ' DEFAULT NULL';
289        } +        }
290        */ +        */
291 +
292        $notnull  = (isset($field['notnull']) && $field['notnull']) ? ' NOT NULL' : ''; +        $notnull  = (isset($field['notnull']) && $field['notnull']) ? ' NOT NULL' : '';
293 +
294        // sqlite does not support unsigned attribute for autoinremented fields +        // sqlite does not support unsigned attribute for autoinremented fields
295        $unsigned = (isset($field['unsigned']) && $field['unsigned'] && !$autoincrement) ? ' UNSIGNED' : ''; +        $unsigned = (isset($field['unsigned']) && $field['unsigned'] && !$autoincrement) ? ' UNSIGNED' : '';
296 +
297        $name = $this->conn->quoteIdentifier($name, true); +        $name = $this->conn->quoteIdentifier($name, true);
298        return $name . ' ' . $type . $unsigned . $default . $notnull . $autoinc; +        return $name . ' ' . $type . $unsigned . $default . $notnull . $autoinc;
299    } +    }
300 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id$ + *  $Id$
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Event + * Doctrine_Event
24 * + *
25 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
26 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
27 * @package     Doctrine + * @package     Doctrine
28 * @subpackage  Event + * @subpackage  Event
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30 * @since       1.0 + * @since       1.0
31 * @version     $Revision$ + * @version     $Revision$
32 */ + */
33class Doctrine_Event +class Doctrine_Event
34{ +{
35    /** +    /**
36     * CONNECTION EVENT CODES +     * CONNECTION EVENT CODES
37     */ +     */
38    const CONN_QUERY         = 1; +    const CONN_QUERY         = 1;
39    const CONN_EXEC          = 2; +    const CONN_EXEC          = 2;
40    const CONN_PREPARE       = 3; +    const CONN_PREPARE       = 3;
41    const CONN_CONNECT       = 4; +    const CONN_CONNECT       = 4;
42    const CONN_CLOSE         = 5; +    const CONN_CLOSE         = 5;
43    const CONN_ERROR         = 6; +    const CONN_ERROR         = 6;
44 +
45    const STMT_EXECUTE       = 10; +    const STMT_EXECUTE       = 10;
46    const STMT_FETCH         = 11; +    const STMT_FETCH         = 11;
47    const STMT_FETCHALL      = 12; +    const STMT_FETCHALL      = 12;
48 +
49    const TX_BEGIN           = 31; +    const TX_BEGIN           = 31;
50    const TX_COMMIT          = 32; +    const TX_COMMIT          = 32;
51    const TX_ROLLBACK        = 33; +    const TX_ROLLBACK        = 33;
52    const SAVEPOINT_CREATE   = 34; +    const SAVEPOINT_CREATE   = 34;
53    const SAVEPOINT_ROLLBACK = 35; +    const SAVEPOINT_ROLLBACK = 35;
54    const SAVEPOINT_COMMIT   = 36; +    const SAVEPOINT_COMMIT   = 36;
55 +
56    const HYDRATE            = 40; +    const HYDRATE            = 40;
57 +
58    /* +    /*
59     * RECORD EVENT CODES +     * RECORD EVENT CODES
60     */ +     */
61    const RECORD_DELETE      = 21; +    const RECORD_DELETE      = 21;
62    const RECORD_SAVE        = 22; +    const RECORD_SAVE        = 22;
63    const RECORD_UPDATE      = 23; +    const RECORD_UPDATE      = 23;
64    const RECORD_INSERT      = 24; +    const RECORD_INSERT      = 24;
65    const RECORD_SERIALIZE   = 25; +    const RECORD_SERIALIZE   = 25;
66    const RECORD_UNSERIALIZE = 26; +    const RECORD_UNSERIALIZE = 26;
67 +
68    /** +    /**
69     * @var mixed $_invoker             the handler which invoked this event +     * @var mixed $_invoker             the handler which invoked this event
70     */ +     */
71    protected $_invoker; +    protected $_invoker;
72 +
73    /** +    /**
74     * @var string $_query              the sql query associated with this event (if any) +     * @var string $_query              the sql query associated with this event (if any)
75     */ +     */
76    protected $_query; +    protected $_query;
77 +
78    /** +    /**
79     * @var string $_params             the parameters associated with the query (if any) +     * @var string $_params             the parameters associated with the query (if any)
80     */ +     */
81    protected $_params; +    protected $_params;
82 +
83    /** +    /**
84     * @see Doctrine_Event constants +     * @see Doctrine_Event constants
85     * @var integer $_code              the event code +     * @var integer $_code              the event code
86     */ +     */
87    protected $_code; +    protected $_code;
88 +
89    /** +    /**
90     * @var integer $_startedMicrotime  the time point in which this event was started +     * @var integer $_startedMicrotime  the time point in which this event was started
91     */ +     */
92    protected $_startedMicrotime; +    protected $_startedMicrotime;
93 +
94    /** +    /**
95     * @var integer $_endedMicrotime    the time point in which this event was ended +     * @var integer $_endedMicrotime    the time point in which this event was ended
96     */ +     */
97    protected $_endedMicrotime; +    protected $_endedMicrotime;
98 +
99    /** +    /**
100     * @var array $_options             an array of options +     * @var array $_options             an array of options
101     */ +     */
102    protected $_options = array(); +    protected $_options = array();
103 +
104    /** +    /**
105     * constructor +     * constructor
106     * +     *
107     * @param Doctrine_Connection|Doctrine_Connection_Statement| +     * @param Doctrine_Connection|Doctrine_Connection_Statement|
108              Doctrine_Connection_UnitOfWork|Doctrine_Transaction $invoker   the handler which invoked this event +              Doctrine_Connection_UnitOfWork|Doctrine_Transaction $invoker   the handler which invoked this event
109     * @param integer $code                                                  the event code +     * @param integer $code                                                  the event code
110     * @param string $query                                                  the sql query associated with this event (if any) +     * @param string $query                                                  the sql query associated with this event (if any)
111     */ +     */
112    public function __construct($invoker, $code, $query = null, $params = array()) +    public function __construct($invoker, $code, $query = null, $params = array())
113    { +    {
114        $this->_invoker = $invoker; +        $this->_invoker = $invoker;
115        $this->_code    = $code; +        $this->_code    = $code;
116        $this->_query   = $query; +        $this->_query   = $query;
117        $this->_params  = $params; +        $this->_params  = $params;
118    } +    }
119 +
120    /** +    /**
121     * getQuery +     * getQuery
122     * +     *
123     * @return string       returns the query associated with this event (if any) +     * @return string       returns the query associated with this event (if any)
124     */ +     */
125    public function getQuery() +    public function getQuery()
126    { +    {
127        return $this->_query; +        return $this->_query;
128    } +    }
129 +
130    /** +    /**
131     * getName +     * getName
132     * returns the name of this event +     * returns the name of this event
133     * +     *
134     * @return string       the name of this event +     * @return string       the name of this event
135     */ +     */
136    public function getName()  +    public function getName() 
137    { +    {
138        switch ($this->_code) { +        switch ($this->_code) {
139            case self::CONN_QUERY: +            case self::CONN_QUERY:
140                return 'query'; +                return 'query';
141            case self::CONN_EXEC: +            case self::CONN_EXEC:
142                return 'exec'; +                return 'exec';
143            case self::CONN_PREPARE: +            case self::CONN_PREPARE:
144                return 'prepare'; +                return 'prepare';
145            case self::CONN_CONNECT: +            case self::CONN_CONNECT:
146                return 'connect'; +                return 'connect';
147            case self::CONN_CLOSE: +            case self::CONN_CLOSE:
148                return 'close'; +                return 'close';
149            case self::CONN_ERROR: +            case self::CONN_ERROR:
150                return 'error'; +                return 'error';
151 +
152            case self::STMT_EXECUTE: +            case self::STMT_EXECUTE:
153                return 'execute'; +                return 'execute';
154            case self::STMT_FETCH: +            case self::STMT_FETCH:
155                return 'fetch'; +                return 'fetch';
156            case self::STMT_FETCHALL: +            case self::STMT_FETCHALL:
157                return 'fetch all'; +                return 'fetch all';
158             +            
159            case self::TX_BEGIN: +            case self::TX_BEGIN:
160                return 'begin'; +                return 'begin';
161            case self::TX_COMMIT: +            case self::TX_COMMIT:
162                return 'commit'; +                return 'commit';
163            case self::TX_ROLLBACK: +            case self::TX_ROLLBACK:
164                return 'rollback'; +                return 'rollback';
165 +
166            case self::SAVEPOINT_CREATE: +            case self::SAVEPOINT_CREATE:
167                return 'create savepoint'; +                return 'create savepoint';
168            case self::SAVEPOINT_ROLLBACK: +            case self::SAVEPOINT_ROLLBACK:
169                return 'rollback savepoint'; +                return 'rollback savepoint';
170            case self::SAVEPOINT_COMMIT: +            case self::SAVEPOINT_COMMIT:
171                return 'commit savepoint'; +                return 'commit savepoint';
172  + 
173            case self::RECORD_DELETE: +            case self::RECORD_DELETE:
174                return 'delete record'; +                return 'delete record';
175            case self::RECORD_SAVE: +            case self::RECORD_SAVE:
176                return 'save record'; +                return 'save record';
177            case self::RECORD_UPDATE: +            case self::RECORD_UPDATE:
178                return 'update record'; +                return 'update record';
179            case self::RECORD_INSERT: +            case self::RECORD_INSERT:
180                return 'insert record'; +                return 'insert record';
181            case self::RECORD_SERIALIZE: +            case self::RECORD_SERIALIZE:
182                return 'serialize record'; +                return 'serialize record';
183            case self::RECORD_UNSERIALIZE: +            case self::RECORD_UNSERIALIZE:
184                return 'unserialize record'; +                return 'unserialize record';
185        } +        }
186    } +    }
187 +
188    /** +    /**
189     * getCode +     * getCode
190     * +     *
191     * @return integer      returns the code associated with this event +     * @return integer      returns the code associated with this event
192     */ +     */
193    public function getCode() +    public function getCode()
194    { +    {
195        return $this->_code; +        return $this->_code;
196    } +    }
197 +
198    /** +    /**
199     * getOption +     * getOption
200     * returns the value of an option +     * returns the value of an option
201     * +     *
202     * @param string $option    the name of the option +     * @param string $option    the name of the option
203     * @return mixed +     * @return mixed
204     */ +     */
205    public function __get($option) +    public function __get($option)
206    { +    {
207        if ( ! isset($this->_options[$option])) { +        if ( ! isset($this->_options[$option])) {
208            return null; +            return null;
209        } +        }
210         +        
211        return $this->_options[$option]; +        return $this->_options[$option];
212    } +    }
213 +
214    /** +    /**
215     * skipOperation +     * skipOperation
216     * skips the next operation +     * skips the next operation
217     * an alias for __set('skipOperation', true) +     * an alias for __set('skipOperation', true)
218     * +     *
219     * @return Doctrine_Event   this object +     * @return Doctrine_Event   this object
220     */ +     */
221    public function skipOperation() +    public function skipOperation()
222    { +    {
223        $this->_options['skipOperation'] = true; +        $this->_options['skipOperation'] = true;
224     +    
225        return $this; +        return $this;
226    } +    }
227 +
228    /** +    /**
229     * setOption +     * setOption
230     * sets the value of an option +     * sets the value of an option
231     * +     *
232     * @param string $option    the name of the option +     * @param string $option    the name of the option
233     * @param mixed $value      the value of the given option +     * @param mixed $value      the value of the given option
234     * @return Doctrine_Event   this object +     * @return Doctrine_Event   this object
235     */ +     */
236    public function __set($option, $value) +    public function __set($option, $value)
237    { +    {
238        $this->_options[$option] = $value; +        $this->_options[$option] = $value;
239 +
240        return $this; +        return $this;
241    } +    }
242 +
243    /** +    /**
244     * setOption +     * setOption
245     * sets the value of an option by reference +     * sets the value of an option by reference
246     * +     *
247     * @param string $option    the name of the option +     * @param string $option    the name of the option
248     * @param mixed $value      the value of the given option +     * @param mixed $value      the value of the given option
249     * @return Doctrine_Event   this object +     * @return Doctrine_Event   this object
250     */ +     */
251    public function set($option, &$value) +    public function set($option, &$value)
252    { +    {
253        $this->_options[$option] =& $value; +        $this->_options[$option] =& $value;
254 +
255        return $this; +        return $this;
256    } +    }
257 +
258    /** +    /**
259     * start +     * start
260     * starts the internal timer of this event +     * starts the internal timer of this event
261     * +     *
262     * @return Doctrine_Event   this object +     * @return Doctrine_Event   this object
263     */ +     */
264    public function start() +    public function start()
265    { +    {
266        $this->_startedMicrotime = microtime(true); +        $this->_startedMicrotime = microtime(true);
267    } +    }
268 +
269    /** +    /**
270     * hasEnded +     * hasEnded
271     * whether or not this event has ended +     * whether or not this event has ended
272     * +     *
273     * @return boolean +     * @return boolean
274     */ +     */
275    public function hasEnded() +    public function hasEnded()
276    { +    {
277        return ($this->_endedMicrotime != null); +        return ($this->_endedMicrotime != null);
278    } +    }
279 +
280    /** +    /**
281     * end +     * end
282     * ends the internal timer of this event +     * ends the internal timer of this event
283     * +     *
284     * @return Doctrine_Event   this object +     * @return Doctrine_Event   this object
285     */ +     */
286    public function end() +    public function end()
287    { +    {
288        $this->_endedMicrotime = microtime(true); +        $this->_endedMicrotime = microtime(true);
289         +        
290        return $this; +        return $this;
291    } +    }
292 +
293    /** +    /**
294     * getInvoker +     * getInvoker
295     * returns the handler that invoked this event +     * returns the handler that invoked this event
296     * +     *
297     * @return Doctrine_Connection|Doctrine_Connection_Statement| +     * @return Doctrine_Connection|Doctrine_Connection_Statement|
298     *         Doctrine_Connection_UnitOfWork|Doctrine_Transaction   the handler that invoked this event +     *         Doctrine_Connection_UnitOfWork|Doctrine_Transaction   the handler that invoked this event
299     */ +     */
300    public function getInvoker() +    public function getInvoker()
301    { +    {
302        return $this->_invoker; +        return $this->_invoker;
303    } +    }
304 +
305    /** +    /**
306     * getParams +     * getParams
307     * returns the parameters of the query +     * returns the parameters of the query
308     * +     *
309     * @return array   parameters of the query +     * @return array   parameters of the query
310     */ +     */
311    public function getParams() +    public function getParams()
312    { +    {
313        return $this->_params; +        return $this->_params;
314    } +    }
315 +
316    /** +    /**
317     * Get the elapsed time (in microseconds) that the event ran.  If the event has +     * Get the elapsed time (in microseconds) that the event ran.  If the event has
318     * not yet ended, return false. +     * not yet ended, return false.
319     * +     *
320     * @return mixed +     * @return mixed
321     */ +     */
322    public function getElapsedSecs() +    public function getElapsedSecs()
323    { +    {
324        if (is_null($this->_endedMicrotime)) { +        if (is_null($this->_endedMicrotime)) {
325            return false; +            return false;
326        } +        }
327        return ($this->_endedMicrotime - $this->_startedMicrotime); +        return ($this->_endedMicrotime - $this->_startedMicrotime);
328    } +    }
329} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_EventListener.html b/tests_old/coverage/Doctrine_EventListener.html index 7eca9e34a..e8c499588 100644 --- a/tests_old/coverage/Doctrine_EventListener.html +++ b/tests_old/coverage/Doctrine_EventListener.html @@ -10,363 +10,363 @@

Coverage for Doctrine_EventListener

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: EventListener.php 2758 2007-10-07 22:43:33Z zYne $ + *  $Id: EventListener.php 2758 2007-10-07 22:43:33Z zYne $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_EventListener_Interface'); +Doctrine::autoload('Doctrine_EventListener_Interface');
22/** +/**
23 * Doctrine_EventListener     all event listeners extend this base class + * Doctrine_EventListener     all event listeners extend this base class
24 *                            the empty methods allow child classes to only implement the methods they need to implement + *                            the empty methods allow child classes to only implement the methods they need to implement
25 * + *
26 * + *
27 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
28 * @package     Doctrine + * @package     Doctrine
29 * @subpackage  EventListener + * @subpackage  EventListener
30 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
31 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
32 * @since       1.0 + * @since       1.0
33 * @version     $Revision: 2758 $ + * @version     $Revision: 2758 $
34 */ + */
35class Doctrine_EventListener implements Doctrine_EventListener_Interface +class Doctrine_EventListener implements Doctrine_EventListener_Interface
36{ +{
37    public function preClose(Doctrine_Event $event) +    public function preClose(Doctrine_Event $event)
38    { } +    { }
39    public function postClose(Doctrine_Event $event) +    public function postClose(Doctrine_Event $event)
40    { } +    { }
41 +
42    public function onCollectionDelete(Doctrine_Collection $collection) +    public function onCollectionDelete(Doctrine_Collection $collection)
43    { } +    { }
44    public function onPreCollectionDelete(Doctrine_Collection $collection) +    public function onPreCollectionDelete(Doctrine_Collection $collection)
45    { } +    { }
46 +
47    public function onOpen(Doctrine_Connection $connection) +    public function onOpen(Doctrine_Connection $connection)
48    { } +    { }
49 +
50    public function preTransactionCommit(Doctrine_Event $event) +    public function preTransactionCommit(Doctrine_Event $event)
51    { } +    { }
52    public function postTransactionCommit(Doctrine_Event $event) +    public function postTransactionCommit(Doctrine_Event $event)
53    { } +    { }
54 +
55    public function preTransactionRollback(Doctrine_Event $event) +    public function preTransactionRollback(Doctrine_Event $event)
56    { } +    { }
57    public function postTransactionRollback(Doctrine_Event $event) +    public function postTransactionRollback(Doctrine_Event $event)
58    { } +    { }
59 +
60    public function preTransactionBegin(Doctrine_Event $event) +    public function preTransactionBegin(Doctrine_Event $event)
61    { } +    { }
62    public function postTransactionBegin(Doctrine_Event $event) +    public function postTransactionBegin(Doctrine_Event $event)
63    { } +    { }
64 +
65 +
66    public function preSavepointCommit(Doctrine_Event $event) +    public function preSavepointCommit(Doctrine_Event $event)
67    { } +    { }
68    public function postSavepointCommit(Doctrine_Event $event) +    public function postSavepointCommit(Doctrine_Event $event)
69    { } +    { }
70 +
71    public function preSavepointRollback(Doctrine_Event $event) +    public function preSavepointRollback(Doctrine_Event $event)
72    { } +    { }
73    public function postSavepointRollback(Doctrine_Event $event) +    public function postSavepointRollback(Doctrine_Event $event)
74    { } +    { }
75 +
76    public function preSavepointCreate(Doctrine_Event $event) +    public function preSavepointCreate(Doctrine_Event $event)
77    { } +    { }
78    public function postSavepointCreate(Doctrine_Event $event) +    public function postSavepointCreate(Doctrine_Event $event)
79    { } +    { }
80 +
81    public function postConnect(Doctrine_Event $event) +    public function postConnect(Doctrine_Event $event)
82    { } +    { }
83    public function preConnect(Doctrine_Event $event) +    public function preConnect(Doctrine_Event $event)
84    { } +    { }
85 +
86    public function preQuery(Doctrine_Event $event) +    public function preQuery(Doctrine_Event $event)
87    { } +    { }
88    public function postQuery(Doctrine_Event $event) +    public function postQuery(Doctrine_Event $event)
89    { } +    { }
90 +
91    public function prePrepare(Doctrine_Event $event) +    public function prePrepare(Doctrine_Event $event)
92    { } +    { }
93    public function postPrepare(Doctrine_Event $event) +    public function postPrepare(Doctrine_Event $event)
94    { } +    { }
95 +
96    public function preExec(Doctrine_Event $event) +    public function preExec(Doctrine_Event $event)
97    { } +    { }
98    public function postExec(Doctrine_Event $event) +    public function postExec(Doctrine_Event $event)
99    { } +    { }
100 +
101    public function preError(Doctrine_Event $event) +    public function preError(Doctrine_Event $event)
102    { } +    { }
103    public function postError(Doctrine_Event $event) +    public function postError(Doctrine_Event $event)
104    { } +    { }
105 +
106    public function preFetch(Doctrine_Event $event) +    public function preFetch(Doctrine_Event $event)
107    { } +    { }
108    public function postFetch(Doctrine_Event $event) +    public function postFetch(Doctrine_Event $event)
109    { } +    { }
110 +
111    public function preFetchAll(Doctrine_Event $event) +    public function preFetchAll(Doctrine_Event $event)
112    { } +    { }
113    public function postFetchAll(Doctrine_Event $event) +    public function postFetchAll(Doctrine_Event $event)
114    { } +    { }
115 +
116    public function preStmtExecute(Doctrine_Event $event) +    public function preStmtExecute(Doctrine_Event $event)
117    { } +    { }
118    public function postStmtExecute(Doctrine_Event $event) +    public function postStmtExecute(Doctrine_Event $event)
119    { } +    { }
120} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_EventListener_Chain.html b/tests_old/coverage/Doctrine_EventListener_Chain.html index cba245289..5f405ece0 100644 --- a/tests_old/coverage/Doctrine_EventListener_Chain.html +++ b/tests_old/coverage/Doctrine_EventListener_Chain.html @@ -10,1221 +10,1221 @@

Coverage for Doctrine_EventListener_Chain

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: Chain.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Chain.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Access'); +Doctrine::autoload('Doctrine_Access');
22 +
23/** +/**
24 * Doctrine_EventListener_Chain + * Doctrine_EventListener_Chain
25 * this class represents a chain of different listeners, + * this class represents a chain of different listeners,
26 * useful for having multiple listeners listening the events at the same time + * useful for having multiple listeners listening the events at the same time
27 * + *
28 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
29 * @package     Doctrine + * @package     Doctrine
30 * @subpackage  EventListener + * @subpackage  EventListener
31 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
32 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
33 * @since       1.0 + * @since       1.0
34 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
35 */ + */
36class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_EventListener_Interface +class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_EventListener_Interface
37{ +{
38    /** +    /**
39     * @var array $listeners        an array containing all listeners +     * @var array $listeners        an array containing all listeners
40     */ +     */
41    protected $_listeners = array(); +    protected $_listeners = array();
42 +
43    /** +    /**
44     * add +     * add
45     * adds a listener to the chain of listeners +     * adds a listener to the chain of listeners
46     * +     *
47     * @param object $listener +     * @param object $listener
48     * @param string $name +     * @param string $name
49     * @return void +     * @return void
50     */ +     */
51    public function add($listener, $name = null) +    public function add($listener, $name = null)
52    { +    {
53        if ( ! ($listener instanceof Doctrine_EventListener_Interface) && +        if ( ! ($listener instanceof Doctrine_EventListener_Interface) &&
54             ! ($listener instanceof Doctrine_Overloadable)) { +             ! ($listener instanceof Doctrine_Overloadable)) {
55             +            
56            throw new Doctrine_EventListener_Exception("Couldn't add eventlistener. EventListeners should implement either Doctrine_EventListener_Interface or Doctrine_Overloadable"); +            throw new Doctrine_EventListener_Exception("Couldn't add eventlistener. EventListeners should implement either Doctrine_EventListener_Interface or Doctrine_Overloadable");
57        } +        }
58        if ($name === null) { +        if ($name === null) {
59            $this->_listeners[] = $listener; +            $this->_listeners[] = $listener;
60        } else { +        } else {
61            $this->_listeners[$name] = $listener; +            $this->_listeners[$name] = $listener;
62        } +        }
63    } +    }
64 +
65    /** +    /**
66     * returns a Doctrine_EventListener on success +     * returns a Doctrine_EventListener on success
67     * and null on failure +     * and null on failure
68     * +     *
69     * @param mixed $key +     * @param mixed $key
70     * @return mixed +     * @return mixed
71     */ +     */
72    public function get($key) +    public function get($key)
73    { +    {
74        if ( ! isset($this->_listeners[$key])) { +        if ( ! isset($this->_listeners[$key])) {
75            return null; +            return null;
76        } +        }
77        return $this->_listeners[$key]; +        return $this->_listeners[$key];
78    } +    }
79 +
80    /** +    /**
81     * set +     * set
82     * +     *
83     * @param mixed $key +     * @param mixed $key
84     * @param Doctrine_EventListener $listener +     * @param Doctrine_EventListener $listener
85     * @return void +     * @return void
86     */ +     */
87    public function set($key, Doctrine_EventListener $listener) +    public function set($key, Doctrine_EventListener $listener)
88    { +    {
89        $this->_listeners[$key] = $listener; +        $this->_listeners[$key] = $listener;
90    } +    }
91 +
92    /** +    /**
93     * onLoad +     * onLoad
94     * an event invoked when Doctrine_Record is being loaded from database +     * an event invoked when Doctrine_Record is being loaded from database
95     * +     *
96     * @param Doctrine_Record $record +     * @param Doctrine_Record $record
97     * @return void +     * @return void
98     */ +     */
99    public function onLoad(Doctrine_Record $record) +    public function onLoad(Doctrine_Record $record)
100    { +    {
101        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
102            $listener->onLoad($record); +            $listener->onLoad($record);
103        } +        }
104    } +    }
105 +
106    /** +    /**
107     * onPreLoad +     * onPreLoad
108     * an event invoked when Doctrine_Record is being loaded +     * an event invoked when Doctrine_Record is being loaded
109     * from database but not yet initialized +     * from database but not yet initialized
110     * +     *
111     * @param Doctrine_Record $record +     * @param Doctrine_Record $record
112     * @return void +     * @return void
113     */ +     */
114    public function onPreLoad(Doctrine_Record $record) +    public function onPreLoad(Doctrine_Record $record)
115    { +    {
116        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
117            $listener->onPreLoad($record); +            $listener->onPreLoad($record);
118        } +        }
119    } +    }
120 +
121    /** +    /**
122     * onSleep +     * onSleep
123     * an event invoked when Doctrine_Record is serialized +     * an event invoked when Doctrine_Record is serialized
124     * +     *
125     * @param Doctrine_Record $record +     * @param Doctrine_Record $record
126     * @return void +     * @return void
127     */ +     */
128    public function onSleep(Doctrine_Record $record) +    public function onSleep(Doctrine_Record $record)
129    { +    {
130        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
131            $listener->onSleep($record); +            $listener->onSleep($record);
132        } +        }
133    } +    }
134 +
135    /** +    /**
136     * onWakeUp +     * onWakeUp
137     * an event invoked when Doctrine_Record is unserialized +     * an event invoked when Doctrine_Record is unserialized
138     * +     *
139     * @param Doctrine_Record $record +     * @param Doctrine_Record $record
140     * @return void +     * @return void
141     */ +     */
142    public function onWakeUp(Doctrine_Record $record) +    public function onWakeUp(Doctrine_Record $record)
143    { +    {
144        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
145            $listener->onWakeUp($record); +            $listener->onWakeUp($record);
146        } +        }
147    } +    }
148 +
149    /** +    /**
150     * postClose +     * postClose
151     * an event invoked after Doctrine_Connection is closed +     * an event invoked after Doctrine_Connection is closed
152     * +     *
153     * @param Doctrine_Event $event +     * @param Doctrine_Event $event
154     * @return void +     * @return void
155     */ +     */
156    public function postClose(Doctrine_Event $event) +    public function postClose(Doctrine_Event $event)
157    { +    {
158        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
159            $listener->postClose($event); +            $listener->postClose($event);
160        } +        }
161    } +    }
162 +
163    /** +    /**
164     * preClose +     * preClose
165     * an event invoked before Doctrine_Connection is closed +     * an event invoked before Doctrine_Connection is closed
166     * +     *
167     * @param Doctrine_Event $event +     * @param Doctrine_Event $event
168     * @return void +     * @return void
169     */ +     */
170    public function preClose(Doctrine_Event $event) +    public function preClose(Doctrine_Event $event)
171    { +    {
172        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
173            $listener->preClose($event); +            $listener->preClose($event);
174        } +        }
175    } +    }
176 +
177    /** +    /**
178     * onOpen +     * onOpen
179     * an event invoked after Doctrine_Connection is opened +     * an event invoked after Doctrine_Connection is opened
180     * +     *
181     * @param Doctrine_Connection $connection +     * @param Doctrine_Connection $connection
182     * @return void +     * @return void
183     */ +     */
184    public function onOpen(Doctrine_Connection $connection) +    public function onOpen(Doctrine_Connection $connection)
185    { +    {
186        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
187            $listener->onOpen($connection); +            $listener->onOpen($connection);
188        } +        }
189    } +    }
190 +
191    /** +    /**
192     * onTransactionCommit +     * onTransactionCommit
193     * an event invoked after a Doctrine_Connection transaction is committed +     * an event invoked after a Doctrine_Connection transaction is committed
194     * +     *
195     * @param Doctrine_Event $event +     * @param Doctrine_Event $event
196     * @return void +     * @return void
197     */ +     */
198    public function postTransactionCommit(Doctrine_Event $event) +    public function postTransactionCommit(Doctrine_Event $event)
199    { +    {
200        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
201            $listener->postTransactionCommit($event); +            $listener->postTransactionCommit($event);
202        } +        }
203    } +    }
204 +
205    /** +    /**
206     * onPreTransactionCommit +     * onPreTransactionCommit
207     * an event invoked before a Doctrine_Connection transaction is committed +     * an event invoked before a Doctrine_Connection transaction is committed
208     * +     *
209     * @param Doctrine_Event $event +     * @param Doctrine_Event $event
210     * @return void +     * @return void
211     */ +     */
212    public function preTransactionCommit(Doctrine_Event $event) +    public function preTransactionCommit(Doctrine_Event $event)
213    { +    {
214        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
215            $listener->preTransactionCommit($event); +            $listener->preTransactionCommit($event);
216        } +        }
217    } +    }
218 +
219    /** +    /**
220     * onTransactionRollback +     * onTransactionRollback
221     * an event invoked after a Doctrine_Connection transaction is being rolled back +     * an event invoked after a Doctrine_Connection transaction is being rolled back
222     * +     *
223     * @param Doctrine_Event $event +     * @param Doctrine_Event $event
224     * @return void +     * @return void
225     */ +     */
226    public function postTransactionRollback(Doctrine_Event $event) +    public function postTransactionRollback(Doctrine_Event $event)
227    { +    {
228        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
229            $listener->postTransactionRollback($event); +            $listener->postTransactionRollback($event);
230        } +        }
231    } +    }
232 +
233    /** +    /**
234     * onPreTransactionRollback +     * onPreTransactionRollback
235     * an event invoked before a Doctrine_Connection transaction is being rolled back +     * an event invoked before a Doctrine_Connection transaction is being rolled back
236     * +     *
237     * @param Doctrine_Event $event +     * @param Doctrine_Event $event
238     * @return void +     * @return void
239     */ +     */
240    public function preTransactionRollback(Doctrine_Event $event) +    public function preTransactionRollback(Doctrine_Event $event)
241    { +    {
242        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
243            $listener->preTransactionRollback($event); +            $listener->preTransactionRollback($event);
244        } +        }
245    } +    }
246 +
247    /** +    /**
248     * onTransactionBegin +     * onTransactionBegin
249     * an event invoked after a Doctrine_Connection transaction has been started +     * an event invoked after a Doctrine_Connection transaction has been started
250     * +     *
251     * @param Doctrine_Event $event +     * @param Doctrine_Event $event
252     * @return void +     * @return void
253     */ +     */
254    public function postTransactionBegin(Doctrine_Event $event) +    public function postTransactionBegin(Doctrine_Event $event)
255    { +    {
256        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
257            $listener->postTransactionBegin($event); +            $listener->postTransactionBegin($event);
258        } +        }
259    } +    }
260 +
261    /** +    /**
262     * onTransactionBegin +     * onTransactionBegin
263     * an event invoked before a Doctrine_Connection transaction is being started +     * an event invoked before a Doctrine_Connection transaction is being started
264     * +     *
265     * @param Doctrine_Event $event +     * @param Doctrine_Event $event
266     * @return void +     * @return void
267     */ +     */
268    public function preTransactionBegin(Doctrine_Event $event) +    public function preTransactionBegin(Doctrine_Event $event)
269    { +    {
270        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
271            $listener->preTransactionBegin($event); +            $listener->preTransactionBegin($event);
272        } +        }
273    } +    }
274 +
275    /** +    /**
276     * onCollectionDelete +     * onCollectionDelete
277     * an event invoked after a Doctrine_Collection is being deleted +     * an event invoked after a Doctrine_Collection is being deleted
278     * +     *
279     * @param Doctrine_Collection $collection +     * @param Doctrine_Collection $collection
280     * @return void +     * @return void
281     */ +     */
282    public function onCollectionDelete(Doctrine_Collection $collection) +    public function onCollectionDelete(Doctrine_Collection $collection)
283    { +    {
284        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
285            $listener->onCollectionDelete($collection); +            $listener->onCollectionDelete($collection);
286        } +        }
287    } +    }
288 +
289    /** +    /**
290     * onCollectionDelete +     * onCollectionDelete
291     * an event invoked after a Doctrine_Collection is being deleted +     * an event invoked after a Doctrine_Collection is being deleted
292     * +     *
293     * @param Doctrine_Collection $collection +     * @param Doctrine_Collection $collection
294     * @return void +     * @return void
295     */ +     */
296    public function onPreCollectionDelete(Doctrine_Collection $collection) +    public function onPreCollectionDelete(Doctrine_Collection $collection)
297    { +    {
298        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
299            $listener->onPreCollectionDelete($collection); +            $listener->onPreCollectionDelete($collection);
300        } +        }
301    } +    }
302    public function postConnect(Doctrine_Event $event) +    public function postConnect(Doctrine_Event $event)
303    { +    {
304        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
305            $listener->postConnect($event); +            $listener->postConnect($event);
306        } +        }
307    } +    }
308    public function preConnect(Doctrine_Event $event) +    public function preConnect(Doctrine_Event $event)
309    { +    {
310        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
311            $listener->preConnect($event); +            $listener->preConnect($event);
312        } +        }
313    } +    }
314    public function preQuery(Doctrine_Event $event) +    public function preQuery(Doctrine_Event $event)
315    {  +    { 
316        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
317            $listener->preQuery($event); +            $listener->preQuery($event);
318        } +        }
319    } +    }
320    public function postQuery(Doctrine_Event $event) +    public function postQuery(Doctrine_Event $event)
321    { +    {
322        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
323            $listener->postQuery($event); +            $listener->postQuery($event);
324        } +        }
325    } +    }
326 +
327    public function prePrepare(Doctrine_Event $event) +    public function prePrepare(Doctrine_Event $event)
328    {  +    { 
329        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
330            $listener->prePrepare($event); +            $listener->prePrepare($event);
331        } +        }
332    } +    }
333    public function postPrepare(Doctrine_Event $event) +    public function postPrepare(Doctrine_Event $event)
334    { +    {
335        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
336            $listener->postPrepare($event); +            $listener->postPrepare($event);
337        } +        }
338    } +    }
339 +
340    public function preExec(Doctrine_Event $event) +    public function preExec(Doctrine_Event $event)
341    { +    {
342        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
343            $listener->preExec($event); +            $listener->preExec($event);
344        } +        }
345    } +    }
346    public function postExec(Doctrine_Event $event) +    public function postExec(Doctrine_Event $event)
347    { +    {
348        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
349            $listener->postExec($event); +            $listener->postExec($event);
350        } +        }
351    } +    }
352 +
353    public function preError(Doctrine_Event $event) +    public function preError(Doctrine_Event $event)
354    {  +    { 
355        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
356            $listener->preError($event); +            $listener->preError($event);
357        } +        }
358    } +    }
359    public function postError(Doctrine_Event $event) +    public function postError(Doctrine_Event $event)
360    { +    {
361        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
362            $listener->postError($event); +            $listener->postError($event);
363        } +        }
364    } +    }
365 +
366    public function preFetch(Doctrine_Event $event) +    public function preFetch(Doctrine_Event $event)
367    {  +    { 
368        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
369            $listener->preFetch($event); +            $listener->preFetch($event);
370        } +        }
371    } +    }
372    public function postFetch(Doctrine_Event $event) +    public function postFetch(Doctrine_Event $event)
373    { +    {
374        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
375            $listener->postFetch($event); +            $listener->postFetch($event);
376        } +        }
377    } +    }
378 +
379    public function preFetchAll(Doctrine_Event $event) +    public function preFetchAll(Doctrine_Event $event)
380    {  +    { 
381        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
382            $listener->preFetchAll($event); +            $listener->preFetchAll($event);
383        } +        }
384    } +    }
385 +
386    public function postFetchAll(Doctrine_Event $event) +    public function postFetchAll(Doctrine_Event $event)
387    { +    {
388        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
389            $listener->postFetchAll($event); +            $listener->postFetchAll($event);
390        } +        }
391    } +    }
392 +
393    public function preStmtExecute(Doctrine_Event $event) +    public function preStmtExecute(Doctrine_Event $event)
394    { +    {
395        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
396            $listener->preStmtExecute($event); +            $listener->preStmtExecute($event);
397        } +        }
398    } +    }
399 +
400    public function postStmtExecute(Doctrine_Event $event) +    public function postStmtExecute(Doctrine_Event $event)
401    { +    {
402        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
403            $listener->postStmtExecute($event); +            $listener->postStmtExecute($event);
404        } +        }
405    } +    }
406} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Exception.html b/tests_old/coverage/Doctrine_Exception.html index eeb30b9cd..07a61f969 100644 --- a/tests_old/coverage/Doctrine_Exception.html +++ b/tests_old/coverage/Doctrine_Exception.html @@ -10,279 +10,279 @@

Coverage for Doctrine_Exception

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: Exception.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Exception.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Exception + * Doctrine_Exception
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Exception + * @subpackage  Exception
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Exception extends Exception +class Doctrine_Exception extends Exception
34{  +
35    /** +    /**
36     * @var array $_errorMessages       an array of error messages +     * @var array $_errorMessages       an array of error messages
37     */ +     */
38    protected static $_errorMessages = array( +    protected static $_errorMessages = array(
39                Doctrine::ERR                    => 'unknown error', +                Doctrine::ERR                    => 'unknown error',
40                Doctrine::ERR_ALREADY_EXISTS     => 'already exists', +                Doctrine::ERR_ALREADY_EXISTS     => 'already exists',
41                Doctrine::ERR_CANNOT_CREATE      => 'can not create', +                Doctrine::ERR_CANNOT_CREATE      => 'can not create',
42                Doctrine::ERR_CANNOT_ALTER       => 'can not alter', +                Doctrine::ERR_CANNOT_ALTER       => 'can not alter',
43                Doctrine::ERR_CANNOT_REPLACE     => 'can not replace', +                Doctrine::ERR_CANNOT_REPLACE     => 'can not replace',
44                Doctrine::ERR_CANNOT_DELETE      => 'can not delete', +                Doctrine::ERR_CANNOT_DELETE      => 'can not delete',
45                Doctrine::ERR_CANNOT_DROP        => 'can not drop', +                Doctrine::ERR_CANNOT_DROP        => 'can not drop',
46                Doctrine::ERR_CONSTRAINT         => 'constraint violation', +                Doctrine::ERR_CONSTRAINT         => 'constraint violation',
47                Doctrine::ERR_CONSTRAINT_NOT_NULL=> 'null value violates not-null constraint', +                Doctrine::ERR_CONSTRAINT_NOT_NULL=> 'null value violates not-null constraint',
48                Doctrine::ERR_DIVZERO            => 'division by zero', +                Doctrine::ERR_DIVZERO            => 'division by zero',
49                Doctrine::ERR_INVALID            => 'invalid', +                Doctrine::ERR_INVALID            => 'invalid',
50                Doctrine::ERR_INVALID_DATE       => 'invalid date or time', +                Doctrine::ERR_INVALID_DATE       => 'invalid date or time',
51                Doctrine::ERR_INVALID_NUMBER     => 'invalid number', +                Doctrine::ERR_INVALID_NUMBER     => 'invalid number',
52                Doctrine::ERR_MISMATCH           => 'mismatch', +                Doctrine::ERR_MISMATCH           => 'mismatch',
53                Doctrine::ERR_NODBSELECTED       => 'no database selected', +                Doctrine::ERR_NODBSELECTED       => 'no database selected',
54                Doctrine::ERR_NOSUCHFIELD        => 'no such field', +                Doctrine::ERR_NOSUCHFIELD        => 'no such field',
55                Doctrine::ERR_NOSUCHTABLE        => 'no such table', +                Doctrine::ERR_NOSUCHTABLE        => 'no such table',
56                Doctrine::ERR_NOT_CAPABLE        => 'Doctrine backend not capable', +                Doctrine::ERR_NOT_CAPABLE        => 'Doctrine backend not capable',
57                Doctrine::ERR_NOT_FOUND          => 'not found', +                Doctrine::ERR_NOT_FOUND          => 'not found',
58                Doctrine::ERR_NOT_LOCKED         => 'not locked', +                Doctrine::ERR_NOT_LOCKED         => 'not locked',
59                Doctrine::ERR_SYNTAX             => 'syntax error', +                Doctrine::ERR_SYNTAX             => 'syntax error',
60                Doctrine::ERR_UNSUPPORTED        => 'not supported', +                Doctrine::ERR_UNSUPPORTED        => 'not supported',
61                Doctrine::ERR_VALUE_COUNT_ON_ROW => 'value count on row', +                Doctrine::ERR_VALUE_COUNT_ON_ROW => 'value count on row',
62                Doctrine::ERR_INVALID_DSN        => 'invalid DSN', +                Doctrine::ERR_INVALID_DSN        => 'invalid DSN',
63                Doctrine::ERR_CONNECT_FAILED     => 'connect failed', +                Doctrine::ERR_CONNECT_FAILED     => 'connect failed',
64                Doctrine::ERR_NEED_MORE_DATA     => 'insufficient data supplied', +                Doctrine::ERR_NEED_MORE_DATA     => 'insufficient data supplied',
65                Doctrine::ERR_EXTENSION_NOT_FOUND=> 'extension not found', +                Doctrine::ERR_EXTENSION_NOT_FOUND=> 'extension not found',
66                Doctrine::ERR_NOSUCHDB           => 'no such database', +                Doctrine::ERR_NOSUCHDB           => 'no such database',
67                Doctrine::ERR_ACCESS_VIOLATION   => 'insufficient permissions', +                Doctrine::ERR_ACCESS_VIOLATION   => 'insufficient permissions',
68                Doctrine::ERR_LOADMODULE         => 'error while including on demand module', +                Doctrine::ERR_LOADMODULE         => 'error while including on demand module',
69                Doctrine::ERR_TRUNCATED          => 'truncated', +                Doctrine::ERR_TRUNCATED          => 'truncated',
70                Doctrine::ERR_DEADLOCK           => 'deadlock detected', +                Doctrine::ERR_DEADLOCK           => 'deadlock detected',
71            ); +            );
72 +
73    /** +    /**
74     * Return a textual error message for a Doctrine error code +     * Return a textual error message for a Doctrine error code
75     * +     *
76     * @param   int|array   integer error code, +     * @param   int|array   integer error code,
77     *                           null to get the current error code-message map, +     *                           null to get the current error code-message map,
78     *                           or an array with a new error code-message map +     *                           or an array with a new error code-message map
79     * +     *
80     * @return  string  error message +     * @return  string  error message
81     */ +     */
82    public function errorMessage($value = null) +    public function errorMessage($value = null)
83    { +    {
84        if (is_null($value)) { +        if (is_null($value)) {
85            return self::$_errorMessages; +            return self::$_errorMessages;
86        } +        }
87 +
88        return isset(self::$_errorMessages[$value]) ? +        return isset(self::$_errorMessages[$value]) ?
89           self::$_errorMessages[$value] : self::$_errorMessages[Doctrine::ERR]; +           self::$_errorMessages[$value] : self::$_errorMessages[Doctrine::ERR];
90    } +    }
91 +
92} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Export.html b/tests_old/coverage/Doctrine_Export.html index 10c96bfe4..fc4c0566b 100644 --- a/tests_old/coverage/Doctrine_Export.html +++ b/tests_old/coverage/Doctrine_Export.html @@ -64,7 +64,7 @@  * and is licensed under the LGPL. For more information, see 19 - * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>. 20  */ @@ -97,7 +97,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL 30 - * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org 31  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Export_Exception.html b/tests_old/coverage/Doctrine_Export_Exception.html index 1e38677e3..64db23262 100644 --- a/tests_old/coverage/Doctrine_Export_Exception.html +++ b/tests_old/coverage/Doctrine_Export_Exception.html @@ -10,103 +10,103 @@

Coverage for Doctrine_Export_Exception

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Export_Firebird.html b/tests_old/coverage/Doctrine_Export_Firebird.html index 3dd4e97a9..16390274f 100644 --- a/tests_old/coverage/Doctrine_Export_Firebird.html +++ b/tests_old/coverage/Doctrine_Export_Firebird.html @@ -64,7 +64,7 @@ - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: Exception.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $ + *  $Id: Exception.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Exception'); +Doctrine::autoload('Doctrine_Exception');
22/** +/**
23 * Doctrine_Export_Exception + * Doctrine_Export_Exception
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Export + * @subpackage  Export
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 2702 $ + * @version     $Revision: 2702 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Export_Exception extends Doctrine_Exception +class Doctrine_Export_Exception extends Doctrine_Exception
34 { }
 * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -100,7 +100,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
31 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
32  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Export_Mysql.html b/tests_old/coverage/Doctrine_Export_Mysql.html index 716884a42..87a3458cd 100644 --- a/tests_old/coverage/Doctrine_Export_Mysql.html +++ b/tests_old/coverage/Doctrine_Export_Mysql.html @@ -64,7 +64,7 @@  * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -97,7 +97,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Export_Oracle.html b/tests_old/coverage/Doctrine_Export_Oracle.html index d2ba7aee4..3afb9d5f1 100644 --- a/tests_old/coverage/Doctrine_Export_Oracle.html +++ b/tests_old/coverage/Doctrine_Export_Oracle.html @@ -64,7 +64,7 @@  * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -97,7 +97,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Export_Pgsql.html b/tests_old/coverage/Doctrine_Export_Pgsql.html index 81a742ed0..77915a4d9 100644 --- a/tests_old/coverage/Doctrine_Export_Pgsql.html +++ b/tests_old/coverage/Doctrine_Export_Pgsql.html @@ -64,7 +64,7 @@  * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -97,7 +97,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Export_Schema.html b/tests_old/coverage/Doctrine_Export_Schema.html index 1d28e1421..1251ae7f7 100644 --- a/tests_old/coverage/Doctrine_Export_Schema.html +++ b/tests_old/coverage/Doctrine_Export_Schema.html @@ -64,7 +64,7 @@  * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -94,7 +94,7 @@  * @subpackage  Export
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL diff --git a/tests_old/coverage/Doctrine_Export_Sqlite.html b/tests_old/coverage/Doctrine_Export_Sqlite.html index 024d9dde1..b28f15d2b 100644 --- a/tests_old/coverage/Doctrine_Export_Sqlite.html +++ b/tests_old/coverage/Doctrine_Export_Sqlite.html @@ -64,7 +64,7 @@  * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -97,7 +97,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Expression.html b/tests_old/coverage/Doctrine_Expression.html index 9304c2592..95ae4393a 100644 --- a/tests_old/coverage/Doctrine_Expression.html +++ b/tests_old/coverage/Doctrine_Expression.html @@ -10,435 +10,435 @@

Coverage for Doctrine_Expression

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: Expression.php 3212 2007-11-24 18:58:33Z romanb $ + *  $Id: Expression.php 3212 2007-11-24 18:58:33Z romanb $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Connection_Module'); +Doctrine::autoload('Doctrine_Connection_Module');
22/** +/**
23 * Doctrine_Expression + * Doctrine_Expression
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Expression + * @subpackage  Expression
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 3212 $ + * @version     $Revision: 3212 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Expression +class Doctrine_Expression
34{ +{
35    protected $_expression; +    protected $_expression;
36    protected $_conn; +    protected $_conn;
37    protected $_tokenizer; +    protected $_tokenizer;
38 +
39    /** +    /**
40     * Create an expression  +     * Create an expression 
41     *  +     * 
42     * @param string $expr The expression +     * @param string $expr The expression
43     * @param Doctrine_Connection $conn The connection (optional) +     * @param Doctrine_Connection $conn The connection (optional)
44     * @return void +     * @return void
45     */ +     */
46    public function __construct($expr, $conn = null) +    public function __construct($expr, $conn = null)
47    { +    {
48        $this->_tokenizer = new Doctrine_Query_Tokenizer(); +        $this->_tokenizer = new Doctrine_Query_Tokenizer();
49        $this->setExpression($expr); +        $this->setExpression($expr);
50        if ($conn !== null) { +        if ($conn !== null) {
51            $this->_conn = $conn; +            $this->_conn = $conn;
52        } +        }
53    } +    }
54 +
55    /** +    /**
56     * getConnection  +     * getConnection 
57     *  +     * 
58     * @return Doctrine_Connection The connection +     * @return Doctrine_Connection The connection
59     */ +     */
60    public function getConnection() +    public function getConnection()
61    { +    {
62        if ( ! isset($this->_conn)) { +        if ( ! isset($this->_conn)) {
63            return Doctrine_Manager::connection(); +            return Doctrine_Manager::connection();
64        } +        }
65 +
66        return $this->_conn; +        return $this->_conn;
67    } +    }
68 +
69    /** +    /**
70     * setExpression  +     * setExpression 
71     *  +     * 
72     * @param string $clause The expression to set +     * @param string $clause The expression to set
73     * @return void +     * @return void
74     */ +     */
75    public function setExpression($clause) +    public function setExpression($clause)
76    { +    {
77        $this->_expression = $this->parseClause($clause); +        $this->_expression = $this->parseClause($clause);
78    } +    }
79 +
80    /** +    /**
81     * parseExpression  +     * parseExpression 
82     * +     *
83     * @todo: What does this function do? +     * @todo: What does this function do?
84     *  +     * 
85     * @param string $expr The expression to parse +     * @param string $expr The expression to parse
86     * @return void +     * @return void
87     */ +     */
88    public function parseExpression($expr) +    public function parseExpression($expr)
89    { +    {
90        $pos  = strpos($expr, '('); +        $pos  = strpos($expr, '(');
91        if ($pos === false) { +        if ($pos === false) {
92            return $expr; +            return $expr;
93        } +        }
94 +
95        // get the name of the function +        // get the name of the function
96        $name   = substr($expr, 0, $pos); +        $name   = substr($expr, 0, $pos);
97        $argStr = substr($expr, ($pos + 1), -1); +        $argStr = substr($expr, ($pos + 1), -1);
98 +
99        // parse args +        // parse args
100        foreach ($this->_tokenizer->bracketExplode($argStr, ',') as $arg) { +        foreach ($this->_tokenizer->bracketExplode($argStr, ',') as $arg) {
101           $args[] = $this->parseClause($arg); +           $args[] = $this->parseClause($arg);
102        } +        }
103 +
104        return call_user_func_array(array($this->getConnection()->expression, $name), $args); +        return call_user_func_array(array($this->getConnection()->expression, $name), $args);
105    } +    }
106 +
107    /** +    /**
108     * parseClause  +     * parseClause 
109     *  +     * 
110     * @param string $clause The clause +     * @param string $clause The clause
111     * @return string The parse clause +     * @return string The parse clause
112     */ +     */
113    public function parseClause($clause) +    public function parseClause($clause)
114    { +    {
115        $e = $this->_tokenizer->bracketExplode($clause, ' '); +        $e = $this->_tokenizer->bracketExplode($clause, ' ');
116 +
117        foreach ($e as $k => $expr) { +        foreach ($e as $k => $expr) {
118            $e[$k] = $this->parseExpression($expr); +            $e[$k] = $this->parseExpression($expr);
119        } +        }
120         +        
121        return implode(' ', $e); +        return implode(' ', $e);
122    } +    }
123 +
124    /** +    /**
125     * getSql  +     * getSql 
126     *  +     * 
127     * @return string The expression +     * @return string The expression
128     */ +     */
129    public function getSql() +    public function getSql()
130    { +    {
131 +
132        return $this->_expression; +        return $this->_expression;
133    } +    }
134 +
135    /** +    /**
136     * __toString  +     * __toString 
137     *  +     * 
138     * @return void +     * @return void
139     */ +     */
140    public function __toString() +    public function __toString()
141    { +    {
142        return $this->getSql(); +        return $this->getSql();
143    } +    }
144} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Expression_Driver.html b/tests_old/coverage/Doctrine_Expression_Driver.html index 13a04bdf2..da38d4c77 100644 --- a/tests_old/coverage/Doctrine_Expression_Driver.html +++ b/tests_old/coverage/Doctrine_Expression_Driver.html @@ -10,2188 +10,2188 @@

Coverage for Doctrine_Expression_Driver

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Expression_Exception.html b/tests_old/coverage/Doctrine_Expression_Exception.html index 2ec28070d..369e031df 100644 --- a/tests_old/coverage/Doctrine_Expression_Exception.html +++ b/tests_old/coverage/Doctrine_Expression_Exception.html @@ -10,103 +10,103 @@

Coverage for Doctrine_Expression_Exception

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id$ + *  $Id$
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Connection_Module'); +Doctrine::autoload('Doctrine_Connection_Module');
22/** +/**
23 * Doctrine_Expression_Driver + * Doctrine_Expression_Driver
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Expression + * @subpackage  Expression
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision$ + * @version     $Revision$
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Expression_Driver extends Doctrine_Connection_Module +class Doctrine_Expression_Driver extends Doctrine_Connection_Module
34{ +{
35    public function getIdentifier($column) +    public function getIdentifier($column)
36    { +    {
37        return $column; +        return $column;
38    } +    }
39    public function getIdentifiers($columns) +    public function getIdentifiers($columns)
40    { +    {
41        return $columns; +        return $columns;
42    } +    }
43 +
44    /** +    /**
45     * regexp +     * regexp
46     * returns the regular expression operator +     * returns the regular expression operator
47     * +     *
48     * @return string +     * @return string
49     */ +     */
50    public function regexp() +    public function regexp()
51    { +    {
52        throw new Doctrine_Expression_Exception('Regular expression operator is not supported by this database driver.'); +        throw new Doctrine_Expression_Exception('Regular expression operator is not supported by this database driver.');
53    } +    }
54 +
55    /** +    /**
56     * Returns the average value of a column +     * Returns the average value of a column
57     * +     *
58     * @param string $column    the column to use +     * @param string $column    the column to use
59     * @return string           generated sql including an AVG aggregate function +     * @return string           generated sql including an AVG aggregate function
60     */ +     */
61    public function avg($column) +    public function avg($column)
62    { +    {
63        $column = $this->getIdentifier($column); +        $column = $this->getIdentifier($column);
64        return 'AVG(' .  $column . ')'; +        return 'AVG(' .  $column . ')';
65    } +    }
66 +
67    /** +    /**
68     * Returns the number of rows (without a NULL value) of a column +     * Returns the number of rows (without a NULL value) of a column
69     * +     *
70     * If a '*' is used instead of a column the number of selected rows +     * If a '*' is used instead of a column the number of selected rows
71     * is returned. +     * is returned.
72     * +     *
73     * @param string|integer $column    the column to use +     * @param string|integer $column    the column to use
74     * @return string                   generated sql including a COUNT aggregate function +     * @return string                   generated sql including a COUNT aggregate function
75     */ +     */
76    public function count($column) +    public function count($column)
77    { +    {
78        $column = $this->getIdentifier($column); +        $column = $this->getIdentifier($column);
79        return 'COUNT(' . $column . ')'; +        return 'COUNT(' . $column . ')';
80    } +    }
81 +
82    /** +    /**
83     * Returns the highest value of a column +     * Returns the highest value of a column
84     * +     *
85     * @param string $column    the column to use +     * @param string $column    the column to use
86     * @return string           generated sql including a MAX aggregate function +     * @return string           generated sql including a MAX aggregate function
87     */ +     */
88    public function max($column) +    public function max($column)
89    { +    {
90        $column = $this->getIdentifier($column); +        $column = $this->getIdentifier($column);
91        return 'MAX(' . $column . ')'; +        return 'MAX(' . $column . ')';
92    } +    }
93 +
94    /** +    /**
95     * Returns the lowest value of a column +     * Returns the lowest value of a column
96     * +     *
97     * @param string $column the column to use +     * @param string $column the column to use
98     * @return string +     * @return string
99     */ +     */
100    public function min($column) +    public function min($column)
101    { +    {
102        $column = $this->getIdentifier($column); +        $column = $this->getIdentifier($column);
103        return 'MIN(' . $column . ')'; +        return 'MIN(' . $column . ')';
104    } +    }
105 +
106    /** +    /**
107     * Returns the total sum of a column +     * Returns the total sum of a column
108     * +     *
109     * @param string $column the column to use +     * @param string $column the column to use
110     * @return string +     * @return string
111     */ +     */
112    public function sum($column) +    public function sum($column)
113    { +    {
114        $column = $this->getIdentifier($column); +        $column = $this->getIdentifier($column);
115        return 'SUM(' . $column . ')'; +        return 'SUM(' . $column . ')';
116    } +    }
117 +
118    // scalar functions +    // scalar functions
119 +
120    /** +    /**
121     * Returns the md5 sum of a field. +     * Returns the md5 sum of a field.
122     * +     *
123     * Note: Not SQL92, but common functionality +     * Note: Not SQL92, but common functionality
124     * +     *
125     * @return string +     * @return string
126     */ +     */
127    public function md5($column) +    public function md5($column)
128    { +    {
129        $column = $this->getIdentifier($column); +        $column = $this->getIdentifier($column);
130        return 'MD5(' . $column . ')'; +        return 'MD5(' . $column . ')';
131    } +    }
132 +
133    /** +    /**
134     * Returns the length of a text field. +     * Returns the length of a text field.
135     * +     *
136     * @param string $expression1 +     * @param string $expression1
137     * @param string $expression2 +     * @param string $expression2
138     * @return string +     * @return string
139     */ +     */
140    public function length($column) +    public function length($column)
141    { +    {
142        $column = $this->getIdentifier($column); +        $column = $this->getIdentifier($column);
143        return 'LENGTH(' . $column . ')'; +        return 'LENGTH(' . $column . ')';
144    } +    }
145 +
146    /** +    /**
147     * Rounds a numeric field to the number of decimals specified. +     * Rounds a numeric field to the number of decimals specified.
148     * +     *
149     * @param string $expression1 +     * @param string $expression1
150     * @param string $expression2 +     * @param string $expression2
151     * @return string +     * @return string
152     */ +     */
153    public function round($column, $decimals = 0) +    public function round($column, $decimals = 0)
154    { +    {
155        $column = $this->getIdentifier($column); +        $column = $this->getIdentifier($column);
156 +
157        return 'ROUND(' . $column . ', ' . $decimals . ')'; +        return 'ROUND(' . $column . ', ' . $decimals . ')';
158    } +    }
159 +
160    /** +    /**
161     * Returns the remainder of the division operation +     * Returns the remainder of the division operation
162     * $expression1 / $expression2. +     * $expression1 / $expression2.
163     * +     *
164     * @param string $expression1 +     * @param string $expression1
165     * @param string $expression2 +     * @param string $expression2
166     * @return string +     * @return string
167     */ +     */
168    public function mod($expression1, $expression2) +    public function mod($expression1, $expression2)
169    { +    {
170        $expression1 = $this->getIdentifier($expression1); +        $expression1 = $this->getIdentifier($expression1);
171        $expression2 = $this->getIdentifier($expression2); +        $expression2 = $this->getIdentifier($expression2);
172        return 'MOD(' . $expression1 . ', ' . $expression2 . ')'; +        return 'MOD(' . $expression1 . ', ' . $expression2 . ')';
173    } +    }
174 +
175    /** +    /**
176     * trim +     * trim
177     * returns the string $str with leading and proceeding space characters removed +     * returns the string $str with leading and proceeding space characters removed
178     * +     *
179     * @param string $str       literal string or column name +     * @param string $str       literal string or column name
180     * @return string +     * @return string
181     */ +     */
182    public function trim($str) +    public function trim($str)
183    { +    {
184        return 'TRIM(' . $str . ')'; +        return 'TRIM(' . $str . ')';
185    } +    }
186 +
187    /** +    /**
188     * rtrim +     * rtrim
189     * returns the string $str with proceeding space characters removed +     * returns the string $str with proceeding space characters removed
190     * +     *
191     * @param string $str       literal string or column name +     * @param string $str       literal string or column name
192     * @return string +     * @return string
193     */ +     */
194    public function rtrim($str) +    public function rtrim($str)
195    { +    {
196        return 'RTRIM(' . $str . ')'; +        return 'RTRIM(' . $str . ')';
197    } +    }
198 +
199    /** +    /**
200     * ltrim +     * ltrim
201     * returns the string $str with leading space characters removed +     * returns the string $str with leading space characters removed
202     * +     *
203     * @param string $str       literal string or column name +     * @param string $str       literal string or column name
204     * @return string +     * @return string
205     */ +     */
206    public function ltrim($str) +    public function ltrim($str)
207    { +    {
208        return 'LTRIM(' . $str . ')'; +        return 'LTRIM(' . $str . ')';
209    } +    }
210 +
211    /** +    /**
212     * upper +     * upper
213     * Returns the string $str with all characters changed to +     * Returns the string $str with all characters changed to
214     * uppercase according to the current character set mapping. +     * uppercase according to the current character set mapping.
215     * +     *
216     * @param string $str       literal string or column name +     * @param string $str       literal string or column name
217     * @return string +     * @return string
218     */ +     */
219    public function upper($str) +    public function upper($str)
220    { +    {
221        return 'UPPER(' . $str . ')'; +        return 'UPPER(' . $str . ')';
222    } +    }
223 +
224    /** +    /**
225     * lower +     * lower
226     * Returns the string $str with all characters changed to +     * Returns the string $str with all characters changed to
227     * lowercase according to the current character set mapping. +     * lowercase according to the current character set mapping.
228     * +     *
229     * @param string $str       literal string or column name +     * @param string $str       literal string or column name
230     * @return string +     * @return string
231     */ +     */
232    public function lower($str) +    public function lower($str)
233    { +    {
234        return 'LOWER(' . $str . ')'; +        return 'LOWER(' . $str . ')';
235    } +    }
236 +
237    /** +    /**
238     * locate +     * locate
239     * returns the position of the first occurrence of substring $substr in string $str +     * returns the position of the first occurrence of substring $substr in string $str
240     * +     *
241     * @param string $substr    literal string to find +     * @param string $substr    literal string to find
242     * @param string $str       literal string +     * @param string $str       literal string
243     * @return integer +     * @return integer
244     */ +     */
245    public function locate($str, $substr) +    public function locate($str, $substr)
246    { +    {
247        return 'LOCATE(' . $str . ', ' . $substr . ')'; +        return 'LOCATE(' . $str . ', ' . $substr . ')';
248    } +    }
249 +
250    /** +    /**
251     * Returns the current system date. +     * Returns the current system date.
252     * +     *
253     * @return string +     * @return string
254     */ +     */
255    public function now() +    public function now()
256    { +    {
257        return 'NOW()'; +        return 'NOW()';
258    } +    }
259 +
260    /** +    /**
261     * soundex +     * soundex
262     * Returns a string to call a function to compute the +     * Returns a string to call a function to compute the
263     * soundex encoding of a string +     * soundex encoding of a string
264     * +     *
265     * The string "?000" is returned if the argument is NULL. +     * The string "?000" is returned if the argument is NULL.
266     * +     *
267     * @param string $value +     * @param string $value
268     * @return string   SQL soundex function with given parameter +     * @return string   SQL soundex function with given parameter
269     */ +     */
270    public function soundex($value) +    public function soundex($value)
271    { +    {
272        throw new Doctrine_Expression_Exception('SQL soundex function not supported by this driver.'); +        throw new Doctrine_Expression_Exception('SQL soundex function not supported by this driver.');
273    } +    }
274 +
275    /** +    /**
276     * return string to call a function to get a substring inside an SQL statement +     * return string to call a function to get a substring inside an SQL statement
277     * +     *
278     * Note: Not SQL92, but common functionality. +     * Note: Not SQL92, but common functionality.
279     * +     *
280     * SQLite only supports the 2 parameter variant of this function +     * SQLite only supports the 2 parameter variant of this function
281     * +     *
282     * @param string $value         an sql string literal or column name/alias +     * @param string $value         an sql string literal or column name/alias
283     * @param integer $position     where to start the substring portion +     * @param integer $position     where to start the substring portion
284     * @param integer $length       the substring portion length +     * @param integer $length       the substring portion length
285     * @return string               SQL substring function with given parameters +     * @return string               SQL substring function with given parameters
286     */ +     */
287    public function substring($value, $from, $len = null) +    public function substring($value, $from, $len = null)
288    { +    {
289        $value = $this->getIdentifier($value); +        $value = $this->getIdentifier($value);
290        if ($len === null) +        if ($len === null)
291            return 'SUBSTRING(' . $value . ' FROM ' . $from . ')'; +            return 'SUBSTRING(' . $value . ' FROM ' . $from . ')';
292        else { +        else {
293            $len = $this->getIdentifier($len); +            $len = $this->getIdentifier($len);
294            return 'SUBSTRING(' . $value . ' FROM ' . $from . ' FOR ' . $len . ')'; +            return 'SUBSTRING(' . $value . ' FROM ' . $from . ' FOR ' . $len . ')';
295        } +        }
296    } +    }
297 +
298    /** +    /**
299     * Returns a series of strings concatinated +     * Returns a series of strings concatinated
300     * +     *
301     * concat() accepts an arbitrary number of parameters. Each parameter +     * concat() accepts an arbitrary number of parameters. Each parameter
302     * must contain an expression or an array with expressions. +     * must contain an expression or an array with expressions.
303     * +     *
304     * @param string|array(string) strings that will be concatinated. +     * @param string|array(string) strings that will be concatinated.
305     */ +     */
306    public function concat() +    public function concat()
307    { +    {
308        $args = func_get_args(); +        $args = func_get_args();
309 +
310        return 'CONCAT(' . join(', ', (array) $args) . ')'; +        return 'CONCAT(' . join(', ', (array) $args) . ')';
311    } +    }
312 +
313    /** +    /**
314     * Returns the SQL for a logical not. +     * Returns the SQL for a logical not.
315     * +     *
316     * Example: +     * Example:
317     * <code> +     * <code>
318     * $q = new Doctrine_Query(); +     * $q = new Doctrine_Query();
319     * $e = $q->expr; +     * $e = $q->expr;
320     * $q->select('*')->from('table') +     * $q->select('*')->from('table')
321     *   ->where($e->eq('id', $e->not('null')); +     *   ->where($e->eq('id', $e->not('null'));
322     * </code> +     * </code>
323     * +     *
324     * @return string a logical expression +     * @return string a logical expression
325     */ +     */
326    public function not($expression) +    public function not($expression)
327    { +    {
328        $expression = $this->getIdentifier($expression); +        $expression = $this->getIdentifier($expression);
329        return 'NOT(' . $expression . ')'; +        return 'NOT(' . $expression . ')';
330    } +    }
331 +
332    /** +    /**
333     * Returns the SQL to perform the same mathematical operation over an array +     * Returns the SQL to perform the same mathematical operation over an array
334     * of values or expressions. +     * of values or expressions.
335     * +     *
336     * basicMath() accepts an arbitrary number of parameters. Each parameter +     * basicMath() accepts an arbitrary number of parameters. Each parameter
337     * must contain a value or an expression or an array with values or +     * must contain a value or an expression or an array with values or
338     * expressions. +     * expressions.
339     * +     *
340     * @param string $type the type of operation, can be '+', '-', '*' or '/'. +     * @param string $type the type of operation, can be '+', '-', '*' or '/'.
341     * @param string|array(string) +     * @param string|array(string)
342     * @return string an expression +     * @return string an expression
343     */ +     */
344    private function basicMath($type, array $args) +    private function basicMath($type, array $args)
345    { +    {
346        $elements = $this->getIdentifiers($args); +        $elements = $this->getIdentifiers($args);
347        if (count($elements) < 1) { +        if (count($elements) < 1) {
348            return ''; +            return '';
349        } +        }
350        if (count($elements) == 1) { +        if (count($elements) == 1) {
351            return $elements[0]; +            return $elements[0];
352        } else { +        } else {
353            return '(' . implode(' ' . $type . ' ', $elements) . ')'; +            return '(' . implode(' ' . $type . ' ', $elements) . ')';
354        } +        }
355    } +    }
356 +
357    /** +    /**
358     * Returns the SQL to add values or expressions together. +     * Returns the SQL to add values or expressions together.
359     * +     *
360     * add() accepts an arbitrary number of parameters. Each parameter +     * add() accepts an arbitrary number of parameters. Each parameter
361     * must contain a value or an expression or an array with values or +     * must contain a value or an expression or an array with values or
362     * expressions. +     * expressions.
363     * +     *
364     * Example: +     * Example:
365     * <code> +     * <code>
366     * $q = new Doctrine_Query(); +     * $q = new Doctrine_Query();
367     * $e = $q->expr; +     * $e = $q->expr;
368     * +     *
369     * $q->select('u.*') +     * $q->select('u.*')
370     *   ->from('User u') +     *   ->from('User u')
371     *   ->where($e->eq($e->add('id', 2), 12)); +     *   ->where($e->eq($e->add('id', 2), 12));
372     * </code> +     * </code>
373     * +     *
374     * @param string|array(string) +     * @param string|array(string)
375     * @return string an expression +     * @return string an expression
376     */ +     */
377    public function add(array $args) +    public function add(array $args)
378    { +    {
379        return $this->basicMath('+', $args); +        return $this->basicMath('+', $args);
380    } +    }
381 +
382    /** +    /**
383     * Returns the SQL to subtract values or expressions from eachother. +     * Returns the SQL to subtract values or expressions from eachother.
384     * +     *
385     * subtract() accepts an arbitrary number of parameters. Each parameter +     * subtract() accepts an arbitrary number of parameters. Each parameter
386     * must contain a value or an expression or an array with values or +     * must contain a value or an expression or an array with values or
387     * expressions. +     * expressions.
388     * +     *
389     * Example: +     * Example:
390     * <code> +     * <code>
391     * $q = new Doctrine_Query(); +     * $q = new Doctrine_Query();
392     * $e = $q->expr; +     * $e = $q->expr;
393     * +     *
394     * $q->select('u.*') +     * $q->select('u.*')
395     *   ->from('User u') +     *   ->from('User u')
396     *   ->where($e->eq($e->sub('id', 2), 12)); +     *   ->where($e->eq($e->sub('id', 2), 12));
397     * </code> +     * </code>
398     * +     *
399     * @param string|array(string) +     * @param string|array(string)
400     * @return string an expression +     * @return string an expression
401     */ +     */
402    public function sub(array $args) +    public function sub(array $args)
403    { +    {
404        return $this->basicMath('-', $args ); +        return $this->basicMath('-', $args );
405    } +    }
406 +
407    /** +    /**
408     * Returns the SQL to multiply values or expressions by eachother. +     * Returns the SQL to multiply values or expressions by eachother.
409     * +     *
410     * multiply() accepts an arbitrary number of parameters. Each parameter +     * multiply() accepts an arbitrary number of parameters. Each parameter
411     * must contain a value or an expression or an array with values or +     * must contain a value or an expression or an array with values or
412     * expressions. +     * expressions.
413     * +     *
414     * Example: +     * Example:
415     * <code> +     * <code>
416     * $q = new Doctrine_Query(); +     * $q = new Doctrine_Query();
417     * $e = $q->expr; +     * $e = $q->expr;
418     * +     *
419     * $q->select('u.*') +     * $q->select('u.*')
420     *   ->from('User u') +     *   ->from('User u')
421     *   ->where($e->eq($e->mul('id', 2), 12)); +     *   ->where($e->eq($e->mul('id', 2), 12));
422     * </code> +     * </code>
423     * +     *
424     * @param string|array(string) +     * @param string|array(string)
425     * @return string an expression +     * @return string an expression
426     */ +     */
427    public function mul(array $args) +    public function mul(array $args)
428    { +    {
429        return $this->basicMath('*', $args); +        return $this->basicMath('*', $args);
430    } +    }
431 +
432    /** +    /**
433     * Returns the SQL to divide values or expressions by eachother. +     * Returns the SQL to divide values or expressions by eachother.
434     * +     *
435     * divide() accepts an arbitrary number of parameters. Each parameter +     * divide() accepts an arbitrary number of parameters. Each parameter
436     * must contain a value or an expression or an array with values or +     * must contain a value or an expression or an array with values or
437     * expressions. +     * expressions.
438     * +     *
439     * Example: +     * Example:
440     * <code> +     * <code>
441     * $q = new Doctrine_Query(); +     * $q = new Doctrine_Query();
442     * $e = $q->expr; +     * $e = $q->expr;
443     * +     *
444     * $q->select('u.*') +     * $q->select('u.*')
445     *   ->from('User u') +     *   ->from('User u')
446     *   ->where($e->eq($e->div('id', 2), 12)); +     *   ->where($e->eq($e->div('id', 2), 12));
447     * </code> +     * </code>
448     * +     *
449     * @param string|array(string) +     * @param string|array(string)
450     * @return string an expression +     * @return string an expression
451     */ +     */
452    public function div(array $args) +    public function div(array $args)
453    { +    {
454        return $this->basicMath('/', $args); +        return $this->basicMath('/', $args);
455    } +    }
456 +
457    /** +    /**
458     * Returns the SQL to check if two values are equal. +     * Returns the SQL to check if two values are equal.
459     * +     *
460     * Example: +     * Example:
461     * <code> +     * <code>
462     * $q = new Doctrine_Query(); +     * $q = new Doctrine_Query();
463     * $q->select('u.*') +     * $q->select('u.*')
464     *   ->from('User u') +     *   ->from('User u')
465     *   ->where($q->expr->eq('id', 1)); +     *   ->where($q->expr->eq('id', 1));
466     * </code> +     * </code>
467     * +     *
468     * @param string $value1 logical expression to compare +     * @param string $value1 logical expression to compare
469     * @param string $value2 logical expression to compare with +     * @param string $value2 logical expression to compare with
470     * @return string logical expression +     * @return string logical expression
471     */ +     */
472    public function eq($value1, $value2) +    public function eq($value1, $value2)
473    { +    {
474        $value1 = $this->getIdentifier($value1); +        $value1 = $this->getIdentifier($value1);
475        $value2 = $this->getIdentifier($value2); +        $value2 = $this->getIdentifier($value2);
476        return $value1 . ' = ' . $value2; +        return $value1 . ' = ' . $value2;
477    } +    }
478 +
479    /** +    /**
480     * Returns the SQL to check if two values are unequal. +     * Returns the SQL to check if two values are unequal.
481     * +     *
482     * Example: +     * Example:
483     * <code> +     * <code>
484     * $q = new Doctrine_Query(); +     * $q = new Doctrine_Query();
485     * $q->select('u.*') +     * $q->select('u.*')
486     *   ->from('User u') +     *   ->from('User u')
487     *   ->where($q->expr->neq('id', 1)); +     *   ->where($q->expr->neq('id', 1));
488     * </code> +     * </code>
489     * +     *
490     * @param string $value1 logical expression to compare +     * @param string $value1 logical expression to compare
491     * @param string $value2 logical expression to compare with +     * @param string $value2 logical expression to compare with
492     * @return string logical expression +     * @return string logical expression
493     */ +     */
494    public function neq($value1, $value2) +    public function neq($value1, $value2)
495    { +    {
496        $value1 = $this->getIdentifier($value1); +        $value1 = $this->getIdentifier($value1);
497        $value2 = $this->getIdentifier($value2); +        $value2 = $this->getIdentifier($value2);
498        return $value1 . ' <> ' . $value2; +        return $value1 . ' <> ' . $value2;
499    } +    }
500 +
501    /** +    /**
502     * Returns the SQL to check if one value is greater than another value. +     * Returns the SQL to check if one value is greater than another value.
503     * +     *
504     * Example: +     * Example:
505     * <code> +     * <code>
506     * $q = new Doctrine_Query(); +     * $q = new Doctrine_Query();
507     * $q->select('u.*') +     * $q->select('u.*')
508     *   ->from('User u') +     *   ->from('User u')
509     *   ->where($q->expr->gt('id', 1)); +     *   ->where($q->expr->gt('id', 1));
510     * </code> +     * </code>
511     * +     *
512     * @param string $value1 logical expression to compare +     * @param string $value1 logical expression to compare
513     * @param string $value2 logical expression to compare with +     * @param string $value2 logical expression to compare with
514     * @return string logical expression +     * @return string logical expression
515     */ +     */
516    public function gt($value1, $value2) +    public function gt($value1, $value2)
517    { +    {
518        $value1 = $this->getIdentifier($value1); +        $value1 = $this->getIdentifier($value1);
519        $value2 = $this->getIdentifier($value2); +        $value2 = $this->getIdentifier($value2);
520        return $value1 . ' > ' . $value2; +        return $value1 . ' > ' . $value2;
521    } +    }
522 +
523    /** +    /**
524     * Returns the SQL to check if one value is greater than or equal to +     * Returns the SQL to check if one value is greater than or equal to
525     * another value. +     * another value.
526     * +     *
527     * Example: +     * Example:
528     * <code> +     * <code>
529     * $q = new Doctrine_Query(); +     * $q = new Doctrine_Query();
530     * $q->select('u.*') +     * $q->select('u.*')
531     *   ->from('User u') +     *   ->from('User u')
532     *   ->where($q->expr->gte('id', 1)); +     *   ->where($q->expr->gte('id', 1));
533     * </code> +     * </code>
534     * +     *
535     * @param string $value1 logical expression to compare +     * @param string $value1 logical expression to compare
536     * @param string $value2 logical expression to compare with +     * @param string $value2 logical expression to compare with
537     * @return string logical expression +     * @return string logical expression
538     */ +     */
539    public function gte($value1, $value2) +    public function gte($value1, $value2)
540    { +    {
541        $value1 = $this->getIdentifier($value1); +        $value1 = $this->getIdentifier($value1);
542        $value2 = $this->getIdentifier($value2); +        $value2 = $this->getIdentifier($value2);
543        return $value1 . ' >= ' . $value2; +        return $value1 . ' >= ' . $value2;
544    } +    }
545 +
546    /** +    /**
547     * Returns the SQL to check if one value is less than another value. +     * Returns the SQL to check if one value is less than another value.
548     * +     *
549     * Example: +     * Example:
550     * <code> +     * <code>
551     * $q = new Doctrine_Query(); +     * $q = new Doctrine_Query();
552     * $q->select('u.*') +     * $q->select('u.*')
553     *   ->from('User u') +     *   ->from('User u')
554     *   ->where($q->expr->lt('id', 1)); +     *   ->where($q->expr->lt('id', 1));
555     * </code> +     * </code>
556     * +     *
557     * @param string $value1        logical expression to compare +     * @param string $value1        logical expression to compare
558     * @param string $value2        logical expression to compare with +     * @param string $value2        logical expression to compare with
559     * @return string logical expression +     * @return string logical expression
560     */ +     */
561    public function lt($value1, $value2) +    public function lt($value1, $value2)
562    { +    {
563        $value1 = $this->getIdentifier($value1); +        $value1 = $this->getIdentifier($value1);
564        $value2 = $this->getIdentifier($value2); +        $value2 = $this->getIdentifier($value2);
565        return $value1 . ' < ' . $value2; +        return $value1 . ' < ' . $value2;
566    } +    }
567 +
568    /** +    /**
569     * Returns the SQL to check if one value is less than or equal to +     * Returns the SQL to check if one value is less than or equal to
570     * another value. +     * another value.
571     * +     *
572     * Example: +     * Example:
573     * <code> +     * <code>
574     * $q = new Doctrine_Query(); +     * $q = new Doctrine_Query();
575     * $q->select('u.*') +     * $q->select('u.*')
576     *   ->from('User u') +     *   ->from('User u')
577     *   ->where($q->expr->lte('id', 1)); +     *   ->where($q->expr->lte('id', 1));
578     * </code> +     * </code>
579     * +     *
580     * @param string $value1        logical expression to compare +     * @param string $value1        logical expression to compare
581     * @param string $value2        logical expression to compare with +     * @param string $value2        logical expression to compare with
582     * @return string logical expression +     * @return string logical expression
583     */ +     */
584    public function lte($value1, $value2) +    public function lte($value1, $value2)
585    { +    {
586        $value1 = $this->getIdentifier($value1); +        $value1 = $this->getIdentifier($value1);
587        $value2 = $this->getIdentifier($value2); +        $value2 = $this->getIdentifier($value2);
588        return $value1 . ' <= ' . $value2; +        return $value1 . ' <= ' . $value2;
589    } +    }
590 +
591    /** +    /**
592     * Returns the SQL to check if a value is one in a set of +     * Returns the SQL to check if a value is one in a set of
593     * given values.. +     * given values..
594     * +     *
595     * in() accepts an arbitrary number of parameters. The first parameter +     * in() accepts an arbitrary number of parameters. The first parameter
596     * must always specify the value that should be matched against. Successive +     * must always specify the value that should be matched against. Successive
597     * must contain a logical expression or an array with logical expressions. +     * must contain a logical expression or an array with logical expressions.
598     * These expressions will be matched against the first parameter. +     * These expressions will be matched against the first parameter.
599     * +     *
600     * Example: +     * Example:
601     * <code> +     * <code>
602     * $q = new Doctrine_Query(); +     * $q = new Doctrine_Query();
603     * $q->select('u.*') +     * $q->select('u.*')
604     *   ->from('User u') +     *   ->from('User u')
605     *   ->where($q->expr->in( 'id', array(1,2,3))); +     *   ->where($q->expr->in( 'id', array(1,2,3)));
606     * </code> +     * </code>
607     * +     *
608     * @param string $column        the value that should be matched against +     * @param string $column        the value that should be matched against
609     * @param string|array(string)  values that will be matched against $column +     * @param string|array(string)  values that will be matched against $column
610     * @return string logical expression +     * @return string logical expression
611     */ +     */
612    public function in($column, $values) +    public function in($column, $values)
613    { +    {
614        if ( ! is_array($values)) { +        if ( ! is_array($values)) {
615            $values = array($values); +            $values = array($values);
616        } +        }
617        $values = $this->getIdentifiers($values); +        $values = $this->getIdentifiers($values);
618        $column = $this->getIdentifier($column); +        $column = $this->getIdentifier($column);
619 +
620        if (count($values) == 0) { +        if (count($values) == 0) {
621            throw new Doctrine_Expression_Exception('Values array for IN operator should not be empty.'); +            throw new Doctrine_Expression_Exception('Values array for IN operator should not be empty.');
622        } +        }
623        return $column . ' IN (' . implode(', ', $values) . ')'; +        return $column . ' IN (' . implode(', ', $values) . ')';
624    } +    }
625 +
626    /** +    /**
627     * Returns SQL that checks if a expression is null. +     * Returns SQL that checks if a expression is null.
628     * +     *
629     * Example: +     * Example:
630     * <code> +     * <code>
631     * $q = new Doctrine_Query(); +     * $q = new Doctrine_Query();
632     * $q->select('u.*') +     * $q->select('u.*')
633     *   ->from('User u') +     *   ->from('User u')
634     *   ->where($q->expr->isNull('id')); +     *   ->where($q->expr->isNull('id'));
635     * </code> +     * </code>
636     * +     *
637     * @param string $expression the expression that should be compared to null +     * @param string $expression the expression that should be compared to null
638     * @return string logical expression +     * @return string logical expression
639     */ +     */
640    public function isNull($expression) +    public function isNull($expression)
641    { +    {
642        $expression = $this->getIdentifier($expression); +        $expression = $this->getIdentifier($expression);
643        return $expression . ' IS NULL'; +        return $expression . ' IS NULL';
644    } +    }
645 +
646    /** +    /**
647     * Returns SQL that checks if a expression is not null. +     * Returns SQL that checks if a expression is not null.
648     * +     *
649     * Example: +     * Example:
650     * <code> +     * <code>
651     * $q = new Doctrine_Query(); +     * $q = new Doctrine_Query();
652     * $q->select('u.*') +     * $q->select('u.*')
653     *   ->from('User u') +     *   ->from('User u')
654     *   ->where($q->expr->isNotNull('id')); +     *   ->where($q->expr->isNotNull('id'));
655     * </code> +     * </code>
656     * +     *
657     * @param string $expression the expression that should be compared to null +     * @param string $expression the expression that should be compared to null
658     * @return string logical expression +     * @return string logical expression
659     */ +     */
660    public function isNotNull($expression) +    public function isNotNull($expression)
661    { +    {
662        $expression = $this->getIdentifier($expression); +        $expression = $this->getIdentifier($expression);
663        return $expression . ' IS NOT NULL'; +        return $expression . ' IS NOT NULL';
664    } +    }
665 +
666    /** +    /**
667     * Returns SQL that checks if an expression evaluates to a value between +     * Returns SQL that checks if an expression evaluates to a value between
668     * two values. +     * two values.
669     * +     *
670     * The parameter $expression is checked if it is between $value1 and $value2. +     * The parameter $expression is checked if it is between $value1 and $value2.
671     * +     *
672     * Note: There is a slight difference in the way BETWEEN works on some databases. +     * Note: There is a slight difference in the way BETWEEN works on some databases.
673     * http://www.w3schools.com/sql/sql_between.asp. If you want complete database +     * http://www.w3schools.com/sql/sql_between.asp. If you want complete database
674     * independence you should avoid using between(). +     * independence you should avoid using between().
675     * +     *
676     * Example: +     * Example:
677     * <code> +     * <code>
678     * $q = new Doctrine_Query(); +     * $q = new Doctrine_Query();
679     * $q->select('u.*') +     * $q->select('u.*')
680     *   ->from('User u') +     *   ->from('User u')
681     *   ->where($q->expr->between('id', 1, 5)); +     *   ->where($q->expr->between('id', 1, 5));
682     * </code> +     * </code>
683     * +     *
684     * @param string $expression the value to compare to +     * @param string $expression the value to compare to
685     * @param string $value1 the lower value to compare with +     * @param string $value1 the lower value to compare with
686     * @param string $value2 the higher value to compare with +     * @param string $value2 the higher value to compare with
687     * @return string logical expression +     * @return string logical expression
688     */ +     */
689    public function between($expression, $value1, $value2) +    public function between($expression, $value1, $value2)
690    { +    {
691        $expression = $this->getIdentifier($expression); +        $expression = $this->getIdentifier($expression);
692        $value1 = $this->getIdentifier($value1); +        $value1 = $this->getIdentifier($value1);
693        $value2 = $this->getIdentifier($value2); +        $value2 = $this->getIdentifier($value2);
694        return $expression . ' BETWEEN ' .$value1 . ' AND ' . $value2; +        return $expression . ' BETWEEN ' .$value1 . ' AND ' . $value2;
695    } +    }
696 +
697    /** +    /**
698     * Returns global unique identifier +     * Returns global unique identifier
699     * +     *
700     * @return string to get global unique identifier +     * @return string to get global unique identifier
701     */ +     */
702    public function guid() +    public function guid()
703    { +    {
704        throw new Doctrine_Expression_Exception('method not implemented'); +        throw new Doctrine_Expression_Exception('method not implemented');
705    } +    }
706 +
707    /** +    /**
708     * returns arcus cosine SQL string +     * returns arcus cosine SQL string
709     * +     *
710     * @return string +     * @return string
711     */ +     */
712    public function acos($value) +    public function acos($value)
713    { +    {
714        return 'ACOS(' . $value . ')'; +        return 'ACOS(' . $value . ')';
715    } +    }
716 +
717    /** +    /**
718     * __call +     * __call
719     * +     *
720     * for all native RDBMS functions the function name itself is returned +     * for all native RDBMS functions the function name itself is returned
721     */ +     */
722    public function __call($m, $a)  +    public function __call($m, $a) 
723    { +    {
724        if ($this->conn->getAttribute(Doctrine::ATTR_PORTABILITY) & Doctrine::PORTABILITY_EXPR) { +        if ($this->conn->getAttribute(Doctrine::ATTR_PORTABILITY) & Doctrine::PORTABILITY_EXPR) {
725            throw new Doctrine_Expression_Exception('Unknown expression ' . $m); +            throw new Doctrine_Expression_Exception('Unknown expression ' . $m);
726        } +        }
727        return $m . '(' . implode(', ', $a) . ')'; +        return $m . '(' . implode(', ', $a) . ')';
728    } +    }
729 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Expression_Mock.html b/tests_old/coverage/Doctrine_Expression_Mock.html index f709a383b..8d0b1a37a 100644 --- a/tests_old/coverage/Doctrine_Expression_Mock.html +++ b/tests_old/coverage/Doctrine_Expression_Mock.html @@ -10,106 +10,106 @@

Coverage for Doctrine_Expression_Mock

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Exception.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $ + *  $Id: Exception.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Exception'); +Doctrine::autoload('Doctrine_Exception');
22/** +/**
23 * Doctrine_Expression_Exception + * Doctrine_Expression_Exception
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Expression + * @subpackage  Expression
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 2702 $ + * @version     $Revision: 2702 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Expression_Exception extends Doctrine_Exception +class Doctrine_Expression_Exception extends Doctrine_Exception
34 { }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Expression_Mysql.html b/tests_old/coverage/Doctrine_Expression_Mysql.html index 02ee9f990..318cc1765 100644 --- a/tests_old/coverage/Doctrine_Expression_Mysql.html +++ b/tests_old/coverage/Doctrine_Expression_Mysql.html @@ -64,7 +64,7 @@ - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id$ + *  $Id$
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Connection_Module'); +Doctrine::autoload('Doctrine_Connection_Module');
22/** +/**
23 * Doctrine_Expression_Mock + * Doctrine_Expression_Mock
24 * Mock driver that is used for testing purposes + * Mock driver that is used for testing purposes
25 * + *
26 * @package     Doctrine + * @package     Doctrine
27 * @subpackage  Expression + * @subpackage  Expression
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30 * @since       1.0 + * @since       1.0
31 * @version     $Revision$ + * @version     $Revision$
32 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
33 */ + */
34class Doctrine_Expression_Mock extends Doctrine_Expression_Driver +class Doctrine_Expression_Mock extends Doctrine_Expression_Driver
35 { }
 * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -91,7 +91,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Expression_Pgsql.html b/tests_old/coverage/Doctrine_Expression_Pgsql.html index ee7198ced..f4764b0cd 100644 --- a/tests_old/coverage/Doctrine_Expression_Pgsql.html +++ b/tests_old/coverage/Doctrine_Expression_Pgsql.html @@ -64,7 +64,7 @@  * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -91,7 +91,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Expression_Sqlite.html b/tests_old/coverage/Doctrine_Expression_Sqlite.html index 74c6803e3..fdfaa5ac3 100644 --- a/tests_old/coverage/Doctrine_Expression_Sqlite.html +++ b/tests_old/coverage/Doctrine_Expression_Sqlite.html @@ -10,517 +10,517 @@

Coverage for Doctrine_Expression_Sqlite

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Formatter.html b/tests_old/coverage/Doctrine_Formatter.html index ff14bc921..71b6dcf9e 100644 --- a/tests_old/coverage/Doctrine_Formatter.html +++ b/tests_old/coverage/Doctrine_Formatter.html @@ -10,729 +10,729 @@

Coverage for Doctrine_Formatter

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Sqlite.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Sqlite.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Expression_Driver'); +Doctrine::autoload('Doctrine_Expression_Driver');
22/** +/**
23 * Doctrine_Expression_Sqlite + * Doctrine_Expression_Sqlite
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Expression + * @subpackage  Expression
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Expression_Sqlite extends Doctrine_Expression_Driver +class Doctrine_Expression_Sqlite extends Doctrine_Expression_Driver
34{ +{
35    /** +    /**
36     * Returns the md5 sum of the data that SQLite's md5() function receives. +     * Returns the md5 sum of the data that SQLite's md5() function receives.
37     * +     *
38     * @param mixed $data +     * @param mixed $data
39     * @return string +     * @return string
40     */ +     */
41    public static function md5Impl($data) +    public static function md5Impl($data)
42    { +    {
43        return md5($data); +        return md5($data);
44    } +    }
45 +
46    /** +    /**
47     * Returns the modules of the data that SQLite's mod() function receives. +     * Returns the modules of the data that SQLite's mod() function receives.
48     * +     *
49     * @param integer $dividend +     * @param integer $dividend
50     * @param integer $divisor +     * @param integer $divisor
51     * @return string +     * @return string
52     */ +     */
53    public static function modImpl($dividend, $divisor) +    public static function modImpl($dividend, $divisor)
54    { +    {
55        return $dividend % $divisor; +        return $dividend % $divisor;
56    } +    }
57 +
58    /** +    /**
59     * Returns a concatenation of the data that SQLite's concat() function receives. +     * Returns a concatenation of the data that SQLite's concat() function receives.
60     * +     *
61     * @return string +     * @return string
62     */ +     */
63    public static function concatImpl() +    public static function concatImpl()
64    { +    {
65        $args = func_get_args(); +        $args = func_get_args();
66        return join('', $args); +        return join('', $args);
67    } +    }
68 +
69    /** +    /**
70     * locate +     * locate
71     * returns the position of the first occurrence of substring $substr in string $str that +     * returns the position of the first occurrence of substring $substr in string $str that
72     * SQLite's locate() function receives +     * SQLite's locate() function receives
73     * +     *
74     * @param string $substr    literal string to find +     * @param string $substr    literal string to find
75     * @param string $str       literal string +     * @param string $str       literal string
76     * @return string +     * @return string
77     */ +     */
78    public static function locateImpl($substr, $str) +    public static function locateImpl($substr, $str)
79    { +    {
80        return strpos($str, $substr); +        return strpos($str, $substr);
81    } +    }
82    public static function sha1Impl($str) +    public static function sha1Impl($str)
83    { +    {
84        return sha1($str); +        return sha1($str);
85    } +    }
86    public static function ltrimImpl($str) +    public static function ltrimImpl($str)
87    { +    {
88        return ltrim($str); +        return ltrim($str);
89    } +    }
90    public static function rtrimImpl($str) +    public static function rtrimImpl($str)
91    { +    {
92        return rtrim($str); +        return rtrim($str);
93    } +    }
94    public static function trimImpl($str) +    public static function trimImpl($str)
95    { +    {
96        return trim($str); +        return trim($str);
97    } +    }
98 +
99    /** +    /**
100     * returns the regular expression operator +     * returns the regular expression operator
101     * +     *
102     * @return string +     * @return string
103     */ +     */
104    public function regexp() +    public function regexp()
105    { +    {
106        return 'RLIKE'; +        return 'RLIKE';
107    } +    }
108 +
109    /** +    /**
110     * soundex +     * soundex
111     * Returns a string to call a function to compute the +     * Returns a string to call a function to compute the
112     * soundex encoding of a string +     * soundex encoding of a string
113     * +     *
114     * The string "?000" is returned if the argument is NULL. +     * The string "?000" is returned if the argument is NULL.
115     * +     *
116     * @param string $value +     * @param string $value
117     * @return string   SQL soundex function with given parameter +     * @return string   SQL soundex function with given parameter
118     */ +     */
119    public function soundex($value) +    public function soundex($value)
120    { +    {
121        return 'SOUNDEX(' . $value . ')'; +        return 'SOUNDEX(' . $value . ')';
122    } +    }
123 +
124    /** +    /**
125     * Return string to call a variable with the current timestamp inside an SQL statement +     * Return string to call a variable with the current timestamp inside an SQL statement
126     * There are three special variables for current date and time. +     * There are three special variables for current date and time.
127     * +     *
128     * @return string       sqlite function as string +     * @return string       sqlite function as string
129     */ +     */
130    public function now($type = 'timestamp') +    public function now($type = 'timestamp')
131    { +    {
132        switch ($type) { +        switch ($type) {
133            case 'time': +            case 'time':
134                return 'time(\'now\')'; +                return 'time(\'now\')';
135            case 'date': +            case 'date':
136                return 'date(\'now\')'; +                return 'date(\'now\')';
137            case 'timestamp': +            case 'timestamp':
138            default: +            default:
139                return 'datetime(\'now\')'; +                return 'datetime(\'now\')';
140        } +        }
141    } +    }
142 +
143    /** +    /**
144     * return string to call a function to get random value inside an SQL statement +     * return string to call a function to get random value inside an SQL statement
145     * +     *
146     * @return string to generate float between 0 and 1 +     * @return string to generate float between 0 and 1
147     */ +     */
148    public function random() +    public function random()
149    { +    {
150        return '((RANDOM() + 2147483648) / 4294967296)'; +        return '((RANDOM() + 2147483648) / 4294967296)';
151    } +    }
152 +
153    /** +    /**
154     * return string to call a function to get a substring inside an SQL statement +     * return string to call a function to get a substring inside an SQL statement
155     * +     *
156     * Note: Not SQL92, but common functionality. +     * Note: Not SQL92, but common functionality.
157     * +     *
158     * SQLite only supports the 2 parameter variant of this function +     * SQLite only supports the 2 parameter variant of this function
159     * +     *
160     * @param string $value         an sql string literal or column name/alias +     * @param string $value         an sql string literal or column name/alias
161     * @param integer $position     where to start the substring portion +     * @param integer $position     where to start the substring portion
162     * @param integer $length       the substring portion length +     * @param integer $length       the substring portion length
163     * @return string               SQL substring function with given parameters +     * @return string               SQL substring function with given parameters
164     */ +     */
165    public function substring($value, $position, $length = null) +    public function substring($value, $position, $length = null)
166    { +    {
167        if ($length !== null) { +        if ($length !== null) {
168            return 'SUBSTR(' . $value . ', ' . $position . ', ' . $length . ')'; +            return 'SUBSTR(' . $value . ', ' . $position . ', ' . $length . ')';
169        } +        }
170        return 'SUBSTR(' . $value . ', ' . $position . ', LENGTH(' . $value . '))'; +        return 'SUBSTR(' . $value . ', ' . $position . ', LENGTH(' . $value . '))';
171    } +    }
172 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id$ + *  $Id$
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Connection_Module'); +Doctrine::autoload('Doctrine_Connection_Module');
22/** +/**
23 * Doctrine_Formatter + * Doctrine_Formatter
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Formatter + * @subpackage  Formatter
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision$ + * @version     $Revision$
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Formatter extends Doctrine_Connection_Module +class Doctrine_Formatter extends Doctrine_Connection_Module
34{ +{
35    /** +    /**
36     * Quotes pattern (% and _) characters in a string) +     * Quotes pattern (% and _) characters in a string)
37     * +     *
38     * EXPERIMENTAL +     * EXPERIMENTAL
39     * +     *
40     * WARNING: this function is experimental and may change signature at +     * WARNING: this function is experimental and may change signature at
41     * any time until labelled as non-experimental +     * any time until labelled as non-experimental
42     * +     *
43     * @param   string  the input string to quote +     * @param   string  the input string to quote
44     * +     *
45     * @return  string  quoted string +     * @return  string  quoted string
46     */ +     */
47    public function escapePattern($text) +    public function escapePattern($text)
48    { +    {
49        if ( ! $this->string_quoting['escape_pattern']) { +        if ( ! $this->string_quoting['escape_pattern']) {
50            return $text; +            return $text;
51        } +        }
52        $tmp = $this->conn->string_quoting; +        $tmp = $this->conn->string_quoting;
53 +
54        $text = str_replace($tmp['escape_pattern'],  +        $text = str_replace($tmp['escape_pattern'], 
55            $tmp['escape_pattern'] . +            $tmp['escape_pattern'] .
56            $tmp['escape_pattern'], $text); +            $tmp['escape_pattern'], $text);
57 +
58        foreach ($this->wildcards as $wildcard) { +        foreach ($this->wildcards as $wildcard) {
59            $text = str_replace($wildcard, $tmp['escape_pattern'] . $wildcard, $text); +            $text = str_replace($wildcard, $tmp['escape_pattern'] . $wildcard, $text);
60        } +        }
61        return $text; +        return $text;
62    } +    }
63 +
64    /** +    /**
65     * convertBooleans +     * convertBooleans
66     * some drivers need the boolean values to be converted into integers +     * some drivers need the boolean values to be converted into integers
67     * when using DQL API +     * when using DQL API
68     * +     *
69     * This method takes care of that conversion +     * This method takes care of that conversion
70     * +     *
71     * @param array $item +     * @param array $item
72     * @return void +     * @return void
73     */ +     */
74    public function convertBooleans($item) +    public function convertBooleans($item)
75    { +    {
76        if (is_array($item)) { +        if (is_array($item)) {
77            foreach ($item as $k => $value) { +            foreach ($item as $k => $value) {
78                if (is_bool($value)) { +                if (is_bool($value)) {
79                    $item[$k] = (int) $value; +                    $item[$k] = (int) $value;
80                } +                }
81            } +            }
82        } else { +        } else {
83            if (is_bool($item)) { +            if (is_bool($item)) {
84                $item = (int) $item; +                $item = (int) $item;
85            } +            }
86        } +        }
87        return $item; +        return $item;
88    } +    }
89 +
90    /** +    /**
91     * Quote a string so it can be safely used as a table or column name +     * Quote a string so it can be safely used as a table or column name
92     * +     *
93     * Delimiting style depends on which database driver is being used. +     * Delimiting style depends on which database driver is being used.
94     * +     *
95     * NOTE: just because you CAN use delimited identifiers doesn't mean +     * NOTE: just because you CAN use delimited identifiers doesn't mean
96     * you SHOULD use them.  In general, they end up causing way more +     * you SHOULD use them.  In general, they end up causing way more
97     * problems than they solve. +     * problems than they solve.
98     * +     *
99     * Portability is broken by using the following characters inside +     * Portability is broken by using the following characters inside
100     * delimited identifiers: +     * delimited identifiers:
101     *   + backtick (<kbd>`</kbd>) -- due to MySQL +     *   + backtick (<kbd>`</kbd>) -- due to MySQL
102     *   + double quote (<kbd>"</kbd>) -- due to Oracle +     *   + double quote (<kbd>"</kbd>) -- due to Oracle
103     *   + brackets (<kbd>[</kbd> or <kbd>]</kbd>) -- due to Access +     *   + brackets (<kbd>[</kbd> or <kbd>]</kbd>) -- due to Access
104     * +     *
105     * Delimited identifiers are known to generally work correctly under +     * Delimited identifiers are known to generally work correctly under
106     * the following drivers: +     * the following drivers:
107     *   + mssql +     *   + mssql
108     *   + mysql +     *   + mysql
109     *   + mysqli +     *   + mysqli
110     *   + oci8 +     *   + oci8
111     *   + pgsql +     *   + pgsql
112     *   + sqlite +     *   + sqlite
113     * +     *
114     * InterBase doesn't seem to be able to use delimited identifiers +     * InterBase doesn't seem to be able to use delimited identifiers
115     * via PHP 4.  They work fine under PHP 5. +     * via PHP 4.  They work fine under PHP 5.
116     * +     *
117     * @param string $str           identifier name to be quoted +     * @param string $str           identifier name to be quoted
118     * @param bool $checkOption     check the 'quote_identifier' option +     * @param bool $checkOption     check the 'quote_identifier' option
119     * +     *
120     * @return string               quoted identifier string +     * @return string               quoted identifier string
121     */ +     */
122    public function quoteIdentifier($str, $checkOption = true) +    public function quoteIdentifier($str, $checkOption = true)
123    { +    {
124        if ($checkOption && ! $this->conn->getAttribute(Doctrine::ATTR_QUOTE_IDENTIFIER)) { +        if ($checkOption && ! $this->conn->getAttribute(Doctrine::ATTR_QUOTE_IDENTIFIER)) {
125            return $str; +            return $str;
126        } +        }
127        $tmp = $this->conn->identifier_quoting; +        $tmp = $this->conn->identifier_quoting;
128        $str = str_replace($tmp['end'], +        $str = str_replace($tmp['end'],
129            $tmp['escape'] . +            $tmp['escape'] .
130            $tmp['end'], $str); +            $tmp['end'], $str);
131 +
132        return $tmp['start'] . $str . $tmp['end']; +        return $tmp['start'] . $str . $tmp['end'];
133    } +    }
134 +
135    /** +    /**
136     * quote +     * quote
137     * quotes given input parameter +     * quotes given input parameter
138     * +     *
139     * @param mixed $input      parameter to be quoted +     * @param mixed $input      parameter to be quoted
140     * @param string $type +     * @param string $type
141     * @return mixed +     * @return mixed
142     */ +     */
143    public function quote($input, $type = null) +    public function quote($input, $type = null)
144    { +    {
145        if ($type == null) { +        if ($type == null) {
146            $type = gettype($input); +            $type = gettype($input);
147        } +        }
148        switch ($type) { +        switch ($type) {
149        case 'integer': +        case 'integer':
150        case 'enum': +        case 'enum':
151        case 'boolean': +        case 'boolean':
152        case 'double': +        case 'double':
153        case 'float': +        case 'float':
154        case 'bool': +        case 'bool':
155        case 'decimal': +        case 'decimal':
156        case 'int': +        case 'int':
157            return $input; +            return $input;
158        case 'array': +        case 'array':
159        case 'object': +        case 'object':
160            $input = serialize($input); +            $input = serialize($input);
161        case 'string': +        case 'string':
162        case 'char': +        case 'char':
163        case 'varchar': +        case 'varchar':
164        case 'text': +        case 'text':
165        case 'gzip': +        case 'gzip':
166        case 'blob': +        case 'blob':
167        case 'clob': +        case 'clob':
168            $this->conn->connect(); +            $this->conn->connect();
169 +
170            return $this->conn->getDbh()->quote($input); +            return $this->conn->getDbh()->quote($input);
171        } +        }
172    } +    }
173 +
174    /** +    /**
175     * Removes any formatting in an sequence name using the 'seqname_format' option +     * Removes any formatting in an sequence name using the 'seqname_format' option
176     * +     *
177     * @param string $sqn string that containts name of a potential sequence +     * @param string $sqn string that containts name of a potential sequence
178     * @return string name of the sequence with possible formatting removed +     * @return string name of the sequence with possible formatting removed
179     */ +     */
180    public function fixSequenceName($sqn) +    public function fixSequenceName($sqn)
181    { +    {
182        $seqPattern = '/^'.preg_replace('/%s/', '([a-z0-9_]+)',  $this->conn->getAttribute(Doctrine::ATTR_SEQNAME_FORMAT)).'$/i'; +        $seqPattern = '/^'.preg_replace('/%s/', '([a-z0-9_]+)',  $this->conn->getAttribute(Doctrine::ATTR_SEQNAME_FORMAT)).'$/i';
183        $seqName    = preg_replace($seqPattern, '\\1', $sqn); +        $seqName    = preg_replace($seqPattern, '\\1', $sqn);
184 +
185        if ($seqName && ! strcasecmp($sqn, $this->getSequenceName($seqName))) { +        if ($seqName && ! strcasecmp($sqn, $this->getSequenceName($seqName))) {
186            return $seqName; +            return $seqName;
187        } +        }
188        return $sqn; +        return $sqn;
189    } +    }
190 +
191    /** +    /**
192     * Removes any formatting in an index name using the 'idxname_format' option +     * Removes any formatting in an index name using the 'idxname_format' option
193     * +     *
194     * @param string $idx string that containts name of anl index +     * @param string $idx string that containts name of anl index
195     * @return string name of the index with possible formatting removed +     * @return string name of the index with possible formatting removed
196     */ +     */
197    public function fixIndexName($idx) +    public function fixIndexName($idx)
198    { +    {
199        $indexPattern   = '/^'.preg_replace('/%s/', '([a-z0-9_]+)', $this->conn->getAttribute(Doctrine::ATTR_IDXNAME_FORMAT)).'$/i'; +        $indexPattern   = '/^'.preg_replace('/%s/', '([a-z0-9_]+)', $this->conn->getAttribute(Doctrine::ATTR_IDXNAME_FORMAT)).'$/i';
200        $indexName      = preg_replace($indexPattern, '\\1', $idx); +        $indexName      = preg_replace($indexPattern, '\\1', $idx);
201        if ($indexName && ! strcasecmp($idx, $this->getIndexName($indexName))) { +        if ($indexName && ! strcasecmp($idx, $this->getIndexName($indexName))) {
202            return $indexName; +            return $indexName;
203        } +        }
204        return $idx; +        return $idx;
205    } +    }
206 +
207    /** +    /**
208     * adds sequence name formatting to a sequence name +     * adds sequence name formatting to a sequence name
209     * +     *
210     * @param string    name of the sequence +     * @param string    name of the sequence
211     * @return string   formatted sequence name +     * @return string   formatted sequence name
212     */ +     */
213    public function getSequenceName($sqn) +    public function getSequenceName($sqn)
214    { +    {
215        return sprintf($this->conn->getAttribute(Doctrine::ATTR_SEQNAME_FORMAT), +        return sprintf($this->conn->getAttribute(Doctrine::ATTR_SEQNAME_FORMAT),
216            preg_replace('/[^a-z0-9_\$.]/i', '_', $sqn)); +            preg_replace('/[^a-z0-9_\$.]/i', '_', $sqn));
217    } +    }
218 +
219    /** +    /**
220     * adds index name formatting to a index name +     * adds index name formatting to a index name
221     * +     *
222     * @param string    name of the index +     * @param string    name of the index
223     * @return string   formatted index name +     * @return string   formatted index name
224     */ +     */
225    public function getIndexName($idx) +    public function getIndexName($idx)
226    { +    {
227        return sprintf($this->conn->getAttribute(Doctrine::ATTR_IDXNAME_FORMAT), +        return sprintf($this->conn->getAttribute(Doctrine::ATTR_IDXNAME_FORMAT),
228            preg_replace('/[^a-z0-9_\$]/i', '_', $idx)); +            preg_replace('/[^a-z0-9_\$]/i', '_', $idx));
229    } +    }
230 +
231    /** +    /**
232     * adds table name formatting to a table name +     * adds table name formatting to a table name
233     * +     *
234     * @param string    name of the table +     * @param string    name of the table
235     * @return string   formatted table name +     * @return string   formatted table name
236     */ +     */
237    public function getTableName($table) +    public function getTableName($table)
238    { +    {
239        return sprintf($this->conn->getAttribute(Doctrine::ATTR_TBLNAME_FORMAT), +        return sprintf($this->conn->getAttribute(Doctrine::ATTR_TBLNAME_FORMAT),
240            preg_replace('/[^a-z0-9_\$]/i', '_', $table)); +            preg_replace('/[^a-z0-9_\$]/i', '_', $table));
241    } +    }
242} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Hook.html b/tests_old/coverage/Doctrine_Hook.html index 1fe6e1957..884fa9702 100644 --- a/tests_old/coverage/Doctrine_Hook.html +++ b/tests_old/coverage/Doctrine_Hook.html @@ -10,693 +10,693 @@

Coverage for Doctrine_Hook

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: Hook.php 3189 2007-11-18 20:37:44Z meus $ + *  $Id: Hook.php 3189 2007-11-18 20:37:44Z meus $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Hook + * Doctrine_Hook
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Hook + * @subpackage  Hook
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 3189 $ + * @version     $Revision: 3189 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Hook +class Doctrine_Hook
34{ +{
35    /** +    /**
36     * @var Doctrine_Query $query           the base query +     * @var Doctrine_Query $query           the base query
37     */ +     */
38    protected $query; +    protected $query;
39 +
40    /** +    /**
41     * @var array $joins                    the optional joins of the base query +     * @var array $joins                    the optional joins of the base query
42     */ +     */
43    protected $joins; +    protected $joins;
44 +
45    /** +    /**
46     * @var array $hooks                    hooks array +     * @var array $hooks                    hooks array
47     */ +     */
48    protected $hooks        = array( +    protected $hooks        = array(
49                             'where', +                             'where',
50                             'orderby', +                             'orderby',
51                             'limit', +                             'limit',
52                             'offset' +                             'offset'
53                              ); +                              );
54 +
55    /** +    /**
56     * @var array $fieldParsers             custom field parsers array +     * @var array $fieldParsers             custom field parsers array
57     *                                      keys as field names in the format componentAlias.FieldName +     *                                      keys as field names in the format componentAlias.FieldName
58     *                                      values as parser names / objects +     *                                      values as parser names / objects
59     */ +     */
60    protected $fieldParsers = array(); +    protected $fieldParsers = array();
61 +
62    /** +    /**
63     * @var array $typeParsers              type parsers array +     * @var array $typeParsers              type parsers array
64     *                                      keys as type names and values as parser names / objects +     *                                      keys as type names and values as parser names / objects
65     */ +     */
66    protected $typeParsers  = array( +    protected $typeParsers  = array(
67                              'char'      => 'Doctrine_Hook_WordLike', +                              'char'      => 'Doctrine_Hook_WordLike',
68                              'string'    => 'Doctrine_Hook_WordLike', +                              'string'    => 'Doctrine_Hook_WordLike',
69                              'varchar'   => 'Doctrine_Hook_WordLike', +                              'varchar'   => 'Doctrine_Hook_WordLike',
70                              'integer'   => 'Doctrine_Hook_Integer', +                              'integer'   => 'Doctrine_Hook_Integer',
71                              'enum'      => 'Doctrine_Hook_Integer', +                              'enum'      => 'Doctrine_Hook_Integer',
72                              'time'      => 'Doctrine_Hook_Time', +                              'time'      => 'Doctrine_Hook_Time',
73                              'date'      => 'Doctrine_Hook_Date', +                              'date'      => 'Doctrine_Hook_Date',
74                              ); +                              );
75 +
76    /** +    /**
77     * @param Doctrine_Query $query         the base query +     * @param Doctrine_Query $query         the base query
78     */ +     */
79    public function __construct($query) +    public function __construct($query)
80    { +    {
81        if (is_string($query)) { +        if (is_string($query)) {
82            $this->query = new Doctrine_Query(); +            $this->query = new Doctrine_Query();
83            $this->query->parseQuery($query); +            $this->query->parseQuery($query);
84        } elseif ($query instanceof Doctrine_Query) { +        } elseif ($query instanceof Doctrine_Query) {
85            $this->query = $query; +            $this->query = $query;
86        } else { +        } else {
87            throw new Doctrine_Exception('Constructor argument should be either Doctrine_Query object or valid DQL query');           +            throw new Doctrine_Exception('Constructor argument should be either Doctrine_Query object or valid DQL query');          
88        } +        }
89         +        
90        $this->query->getQuery(); +        $this->query->getQuery();
91    } +    }
92 +
93    /** +    /**
94     * getQuery +     * getQuery
95     * +     *
96     * @return Doctrine_Query       returns the query object associated with this hook +     * @return Doctrine_Query       returns the query object associated with this hook
97     */ +     */
98    public function getQuery() +    public function getQuery()
99    { +    {
100        return $this->query; +        return $this->query;
101    } +    }
102 +
103    /** +    /**
104     * setTypeParser +     * setTypeParser
105     * +     *
106     * @param string $type              type name +     * @param string $type              type name
107     * @param string|object $parser     parser name or custom parser object +     * @param string|object $parser     parser name or custom parser object
108     */ +     */
109    public function setTypeParser($type, $parser)  +    public function setTypeParser($type, $parser) 
110    { +    {
111        $this->typeParsers[$type] = $parser; +        $this->typeParsers[$type] = $parser;
112    } +    }
113 +
114    /** +    /**
115     * setFieldParser +     * setFieldParser
116     * +     *
117     * @param string $field             field name +     * @param string $field             field name
118     * @param string|object $parser     parser name or custom parser object +     * @param string|object $parser     parser name or custom parser object
119     */ +     */
120    public function setFieldParser($field, $parser) +    public function setFieldParser($field, $parser)
121    { +    {
122        $this->fieldParsers[$field] = $parser; +        $this->fieldParsers[$field] = $parser;
123    } +    }
124 +
125    /** +    /**
126     * hookWhere +     * hookWhere
127     * builds DQL query where part from given parameter array +     * builds DQL query where part from given parameter array
128     * +     *
129     * @param array $params         an associative array containing field +     * @param array $params         an associative array containing field
130     *                              names and their values +     *                              names and their values
131     * @return boolean              whether or not the hooking was +     * @return boolean              whether or not the hooking was
132     */ +     */
133    public function hookWhere($params) +    public function hookWhere($params)
134    { +    {
135        if ( ! is_array($params)) { +        if ( ! is_array($params)) {
136            return false; +            return false;
137        } +        }
138        foreach ($params as $name => $value) { +        foreach ($params as $name => $value) {
139            if ($value === '' || $value === '-') { +            if ($value === '' || $value === '-') {
140                continue; +                continue;
141            } +            }
142            $e = explode('.', $name); +            $e = explode('.', $name);
143 +
144            if (count($e) == 2) { +            if (count($e) == 2) {
145                list($alias, $column) = $e; +                list($alias, $column) = $e;
146 +
147                $map   = $this->query->getAliasDeclaration($alias); +                $map   = $this->query->getAliasDeclaration($alias);
148                $table = $map['table']; +                $table = $map['table'];
149 +
150                if ( ! $table) { +                if ( ! $table) {
151                    throw new Doctrine_Exception('Unknown alias ' . $alias); +                    throw new Doctrine_Exception('Unknown alias ' . $alias);
152                } +                }
153 +
154                if ($def = $table->getDefinitionOf($column)) { +                if ($def = $table->getDefinitionOf($column)) {
155 +
156                $def[0] = gettype($value); +                $def[0] = gettype($value);
157                    if (isset($this->typeParsers[$def[0]])) { +                    if (isset($this->typeParsers[$def[0]])) {
158                        $name   = $this->typeParsers[$def[0]]; +                        $name   = $this->typeParsers[$def[0]];
159                        $parser = new $name; +                        $parser = new $name;
160                    } +                    }
161 +
162                    $parser->parse($alias, $column, $value); +                    $parser->parse($alias, $column, $value);
163 +
164                    $this->query->addWhere($parser->getCondition(), $parser->getParams()); +                    $this->query->addWhere($parser->getCondition(), $parser->getParams());
165                } +                }
166            } +            }
167        } +        }
168 +
169        return true; +        return true;
170    } +    }
171 +
172    /** +    /**
173     * hookOrderBy +     * hookOrderBy
174     * builds DQL query orderby part from given parameter array +     * builds DQL query orderby part from given parameter array
175     * +     *
176     * @param array $params         an array containing all fields which the built query +     * @param array $params         an array containing all fields which the built query
177     *                              should be ordered by +     *                              should be ordered by
178     * @return boolean              whether or not the hooking was successful +     * @return boolean              whether or not the hooking was successful
179     */ +     */
180    public function hookOrderby($params) +    public function hookOrderby($params)
181    { +    {
182        if ( ! is_array($params)) { +        if ( ! is_array($params)) {
183            return false; +            return false;
184        } +        }
185        foreach ($params as $name) { +        foreach ($params as $name) {
186            $e = explode(' ', $name); +            $e = explode(' ', $name);
187 +
188            $order = 'ASC'; +            $order = 'ASC';
189 +
190            if (count($e) > 1) { +            if (count($e) > 1) {
191                $order = ($e[1] == 'DESC') ? 'DESC' : 'ASC'; +                $order = ($e[1] == 'DESC') ? 'DESC' : 'ASC';
192            } +            }
193 +
194            $e = explode('.', $e[0]); +            $e = explode('.', $e[0]);
195 +
196            if (count($e) == 2) { +            if (count($e) == 2) {
197                list($alias, $column) = $e; +                list($alias, $column) = $e;
198 +
199                $map   = $this->query->getAliasDeclaration($alias); +                $map   = $this->query->getAliasDeclaration($alias);
200                $table = $map['table']; +                $table = $map['table'];
201 +
202                if ($def = $table->getDefinitionOf($column)) {    +                if ($def = $table->getDefinitionOf($column)) {   
203                    $this->query->addOrderBy($alias . '.' . $column . ' ' . $order); +                    $this->query->addOrderBy($alias . '.' . $column . ' ' . $order);
204                } +                }
205            } +            }
206        } +        }
207        return true; +        return true;
208    } +    }
209 +
210    /** +    /**
211     * set the hook limit  +     * set the hook limit 
212     *  +     * 
213     * @param integer $limit  +     * @param integer $limit 
214     * @return void +     * @return void
215     */ +     */
216    public function hookLimit($limit) +    public function hookLimit($limit)
217    { +    {
218        $this->query->limit((int) $limit); +        $this->query->limit((int) $limit);
219    } +    }
220 +
221    /** +    /**
222     * set the hook offset +     * set the hook offset
223     * +     *
224     * @param integer $offset +     * @param integer $offset
225     */ +     */
226    public function hookOffset($offset) +    public function hookOffset($offset)
227    { +    {
228        $this->query->offset((int) $offset); +        $this->query->offset((int) $offset);
229    } +    }
230} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Hook_Equal.html b/tests_old/coverage/Doctrine_Hook_Equal.html index 1acc9b352..447e3a2d0 100644 --- a/tests_old/coverage/Doctrine_Hook_Equal.html +++ b/tests_old/coverage/Doctrine_Hook_Equal.html @@ -10,157 +10,157 @@

Coverage for Doctrine_Hook_Equal

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Hook_Integer.html b/tests_old/coverage/Doctrine_Hook_Integer.html index a16f73a2c..f55a331bb 100644 --- a/tests_old/coverage/Doctrine_Hook_Integer.html +++ b/tests_old/coverage/Doctrine_Hook_Integer.html @@ -10,226 +10,226 @@

Coverage for Doctrine_Hook_Integer

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Equal.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $ + *  $Id: Equal.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Hook_Parser'); +Doctrine::autoload('Doctrine_Hook_Parser');
22/** +/**
23 * Doctrine_Hook_Equal + * Doctrine_Hook_Equal
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Hook + * @subpackage  Hook
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 2702 $ + * @version     $Revision: 2702 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Hook_Equal extends Doctrine_Hook_Parser +class Doctrine_Hook_Equal extends Doctrine_Hook_Parser
34{ +{
35    /** +    /**
36     * parse +     * parse
37     * Parses given field and field value to DQL condition +     * Parses given field and field value to DQL condition
38     * and parameters. This method should always return +     * and parameters. This method should always return
39     * prepared statement conditions (conditions that use +     * prepared statement conditions (conditions that use
40     * placeholders instead of literal values). +     * placeholders instead of literal values).
41     * +     *
42     * @param string $alias     component alias +     * @param string $alias     component alias
43     * @param string $field     the field name +     * @param string $field     the field name
44     * @param mixed $value      the value of the field +     * @param mixed $value      the value of the field
45     * @return void +     * @return void
46     */ +     */
47    public function parse($alias, $field, $value) +    public function parse($alias, $field, $value)
48    { +    {
49        $this->params    = (array) $value; +        $this->params    = (array) $value;
50        $this->condition = $alias . '.' . $field . ' = ?'; +        $this->condition = $alias . '.' . $field . ' = ?';
51    } +    }
52 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Hook_Parser.html b/tests_old/coverage/Doctrine_Hook_Parser.html index 529eb7899..38db98424 100644 --- a/tests_old/coverage/Doctrine_Hook_Parser.html +++ b/tests_old/coverage/Doctrine_Hook_Parser.html @@ -10,202 +10,202 @@

Coverage for Doctrine_Hook_Parser

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Integer.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $ + *  $Id: Integer.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Hook_Parser_Complex'); +Doctrine::autoload('Doctrine_Hook_Parser_Complex');
22/** +/**
23 * Doctrine_Hook_Integer + * Doctrine_Hook_Integer
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Hook + * @subpackage  Hook
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 2702 $ + * @version     $Revision: 2702 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Hook_Integer extends Doctrine_Hook_Parser_Complex +class Doctrine_Hook_Integer extends Doctrine_Hook_Parser_Complex
34{ +{
35    /** +    /**
36     * parse +     * parse
37     * Parses given field and field value to DQL condition +     * Parses given field and field value to DQL condition
38     * and parameters. This method should always return +     * and parameters. This method should always return
39     * prepared statement conditions (conditions that use +     * prepared statement conditions (conditions that use
40     * placeholders instead of literal values). +     * placeholders instead of literal values).
41     * +     *
42     * @param string $alias     component alias +     * @param string $alias     component alias
43     * @param string $field     the field name +     * @param string $field     the field name
44     * @param mixed $value      the value of the field +     * @param mixed $value      the value of the field
45     * @return void +     * @return void
46     */ +     */
47    public function parseSingle($alias, $field, $value) +    public function parseSingle($alias, $field, $value)
48    { +    {
49        $e = explode(' ', $value); +        $e = explode(' ', $value);
50 +
51        foreach ($e as $v) { +        foreach ($e as $v) {
52             $v = trim($v); +             $v = trim($v);
53 +
54             $e2   = explode('-', $v); +             $e2   = explode('-', $v);
55 +
56            $name = $alias. '.' . $field; +            $name = $alias. '.' . $field;
57 +
58             if (count($e2) == 1) { +             if (count($e2) == 1) {
59                 // one '-' found +                 // one '-' found
60 +
61                $a[] = $name . ' = ?'; +                $a[] = $name . ' = ?';
62 +
63                $this->params[] = $v; +                $this->params[] = $v;
64            } else { +            } else {
65                // more than one '-' found +                // more than one '-' found
66 +
67                $a[] = '(' . $name . ' > ? AND ' . $name . ' < ?)'; +                $a[] = '(' . $name . ' > ? AND ' . $name . ' < ?)';
68 +
69                $this->params += array($e2[0], $e2[1]); +                $this->params += array($e2[0], $e2[1]);
70            } +            }
71 +
72        } +        }
73        return implode(' OR ', $a); +        return implode(' OR ', $a);
74    } +    }
75 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Hook_Parser_Complex.html b/tests_old/coverage/Doctrine_Hook_Parser_Complex.html index 2b44f4678..2e3eb8489 100644 --- a/tests_old/coverage/Doctrine_Hook_Parser_Complex.html +++ b/tests_old/coverage/Doctrine_Hook_Parser_Complex.html @@ -10,322 +10,322 @@

Coverage for Doctrine_Hook_Parser_Complex

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Parser.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Parser.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Hook_Parser + * Doctrine_Hook_Parser
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Hook + * @subpackage  Hook
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33abstract class Doctrine_Hook_Parser +abstract class Doctrine_Hook_Parser
34{ +{
35    protected $condition; +    protected $condition;
36    protected $params = array(); +    protected $params = array();
37 +
38    public function getCondition() +    public function getCondition()
39    { +    {
40        return $this->condition; +        return $this->condition;
41    } +    }
42 +
43    /** +    /**
44     * getParams +     * getParams
45     * returns the parameters associated with this parser +     * returns the parameters associated with this parser
46     * +     *
47     * @return array +     * @return array
48     */ +     */
49    public function getParams() +    public function getParams()
50    { +    {
51        return $this->params; +        return $this->params;
52    } +    }
53 +
54    /** +    /**
55     * parse +     * parse
56     * Parses given field and field value to DQL condition +     * Parses given field and field value to DQL condition
57     * and parameters. This method should always return +     * and parameters. This method should always return
58     * prepared statement conditions (conditions that use +     * prepared statement conditions (conditions that use
59     * placeholders instead of literal values). +     * placeholders instead of literal values).
60     * +     *
61     * @param string $alias     component alias +     * @param string $alias     component alias
62     * @param string $field     the field name +     * @param string $field     the field name
63     * @param mixed $value      the value of the field +     * @param mixed $value      the value of the field
64     * @return void +     * @return void
65     */ +     */
66    abstract public function parse($alias, $field, $value); +    abstract public function parse($alias, $field, $value);
67 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Hook_WordLike.html b/tests_old/coverage/Doctrine_Hook_WordLike.html index b176c0936..41a25ec31 100644 --- a/tests_old/coverage/Doctrine_Hook_WordLike.html +++ b/tests_old/coverage/Doctrine_Hook_WordLike.html @@ -10,201 +10,201 @@

Coverage for Doctrine_Hook_WordLike

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Complex.php 3212 2007-11-24 18:58:33Z romanb $ + *  $Id: Complex.php 3212 2007-11-24 18:58:33Z romanb $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Hook_Parser'); +Doctrine::autoload('Doctrine_Hook_Parser');
22/** +/**
23 * Doctrine_Hook_Parser_Complex + * Doctrine_Hook_Parser_Complex
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Hook + * @subpackage  Hook
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 3212 $ + * @version     $Revision: 3212 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33abstract class Doctrine_Hook_Parser_Complex extends Doctrine_Hook_Parser +abstract class Doctrine_Hook_Parser_Complex extends Doctrine_Hook_Parser
34{ +{
35    protected $_tokenizer; +    protected $_tokenizer;
36     +    
37    /** +    /**
38     * Constructor. +     * Constructor.
39     */ +     */
40    public function __construct() +    public function __construct()
41    { +    {
42        $this->_tokenizer = new Doctrine_Query_Tokenizer(); +        $this->_tokenizer = new Doctrine_Query_Tokenizer();
43    } +    }
44     +    
45    /** +    /**
46     * parse +     * parse
47     * Parses given field and field value to DQL condition +     * Parses given field and field value to DQL condition
48     * and parameters. This method should always return +     * and parameters. This method should always return
49     * prepared statement conditions (conditions that use +     * prepared statement conditions (conditions that use
50     * placeholders instead of literal values). +     * placeholders instead of literal values).
51     * +     *
52     * @param string $alias     component alias +     * @param string $alias     component alias
53     * @param string $field     the field name +     * @param string $field     the field name
54     * @param mixed $value      the value of the field +     * @param mixed $value      the value of the field
55     * @return void +     * @return void
56     */ +     */
57    public function parse($alias, $field, $value) +    public function parse($alias, $field, $value)
58    { +    {
59        $this->condition = $this->parseClause($alias, $field, $value); +        $this->condition = $this->parseClause($alias, $field, $value);
60    } +    }
61 +
62    /** +    /**
63     * parseClause +     * parseClause
64     * +     *
65     * @param string $alias     component alias +     * @param string $alias     component alias
66     * @param string $field     the field name +     * @param string $field     the field name
67     * @param mixed $value      the value of the field +     * @param mixed $value      the value of the field
68     * @return void +     * @return void
69     */ +     */
70    public function parseClause($alias, $field, $value) +    public function parseClause($alias, $field, $value)
71    { +    {
72        $parts = $this->_tokenizer->quoteExplode($value, ' AND '); +        $parts = $this->_tokenizer->quoteExplode($value, ' AND ');
73 +
74        if (count($parts) > 1) { +        if (count($parts) > 1) {
75            $ret = array(); +            $ret = array();
76            foreach ($parts as $part) { +            foreach ($parts as $part) {
77                $ret[] = $this->parseSingle($alias, $field, $part); +                $ret[] = $this->parseSingle($alias, $field, $part);
78            } +            }
79 +
80            $r = implode(' AND ', $ret); +            $r = implode(' AND ', $ret);
81        } else { +        } else {
82            $parts = $this->_tokenizer->quoteExplode($value, ' OR '); +            $parts = $this->_tokenizer->quoteExplode($value, ' OR ');
83            if (count($parts) > 1) { +            if (count($parts) > 1) {
84                $ret = array(); +                $ret = array();
85                foreach ($parts as $part) { +                foreach ($parts as $part) {
86                    $ret[] = $this->parseClause($alias, $field, $part); +                    $ret[] = $this->parseClause($alias, $field, $part);
87                } +                }
88 +
89                $r = implode(' OR ', $ret); +                $r = implode(' OR ', $ret);
90            } else { +            } else {
91                $ret = $this->parseSingle($alias, $field, $parts[0]); +                $ret = $this->parseSingle($alias, $field, $parts[0]);
92                return $ret; +                return $ret;
93            } +            }
94        } +        }
95        return '(' . $r . ')'; +        return '(' . $r . ')';
96    } +    }
97 +
98    /** +    /**
99     * parseSingle +     * parseSingle
100     * +     *
101     * @param string $alias     component alias +     * @param string $alias     component alias
102     * @param string $field     the field name +     * @param string $field     the field name
103     * @param mixed $value      the value of the field +     * @param mixed $value      the value of the field
104     * @return void +     * @return void
105     */ +     */
106    abstract public function parseSingle($alias, $field, $value); +    abstract public function parseSingle($alias, $field, $value);
107 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: WordLike.php 3212 2007-11-24 18:58:33Z romanb $ + *  $Id: WordLike.php 3212 2007-11-24 18:58:33Z romanb $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Hook_Parser'); +Doctrine::autoload('Doctrine_Hook_Parser');
22/** +/**
23 * Doctrine_Hook_WordLike + * Doctrine_Hook_WordLike
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Hook + * @subpackage  Hook
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 3212 $ + * @version     $Revision: 3212 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Hook_WordLike extends Doctrine_Hook_Parser_Complex +class Doctrine_Hook_WordLike extends Doctrine_Hook_Parser_Complex
34{ +{
35    /** +    /**
36     * parse +     * parse
37     * Parses given field and field value to DQL condition +     * Parses given field and field value to DQL condition
38     * and parameters. This method should always return +     * and parameters. This method should always return
39     * prepared statement conditions (conditions that use +     * prepared statement conditions (conditions that use
40     * placeholders instead of literal values). +     * placeholders instead of literal values).
41     * +     *
42     * @param string $alias     component alias +     * @param string $alias     component alias
43     * @param string $field     the field name +     * @param string $field     the field name
44     * @param mixed $value      the value of the field +     * @param mixed $value      the value of the field
45     * @return void +     * @return void
46     */ +     */
47    public function parseSingle($alias, $field, $value) +    public function parseSingle($alias, $field, $value)
48    { +    {
49        if (strpos($value, "'") !== false) { +        if (strpos($value, "'") !== false) {
50            $value = $this->_tokenizer->bracketTrim($value, "'", "'"); +            $value = $this->_tokenizer->bracketTrim($value, "'", "'");
51         +        
52            $a[]   = $alias . '.' . $field . ' LIKE ?'; +            $a[]   = $alias . '.' . $field . ' LIKE ?';
53            $this->params[] = '%' . $value . '%'; +            $this->params[] = '%' . $value . '%';
54 +
55        } else { +        } else {
56            $e2 = explode(' ',$value); +            $e2 = explode(' ',$value);
57     +    
58            foreach ($e2 as $v) { +            foreach ($e2 as $v) {
59                $v = trim($v); +                $v = trim($v);
60                $a[] = $alias . '.' . $field . ' LIKE ?'; +                $a[] = $alias . '.' . $field . ' LIKE ?';
61                $this->params[] = '%' . $v . '%'; +                $this->params[] = '%' . $v . '%';
62            } +            }
63        } +        }
64        return implode(' OR ', $a); +        return implode(' OR ', $a);
65    } +    }
66} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Hydrate.html b/tests_old/coverage/Doctrine_Hydrate.html index 6471a4418..4890ea983 100644 --- a/tests_old/coverage/Doctrine_Hydrate.html +++ b/tests_old/coverage/Doctrine_Hydrate.html @@ -64,7 +64,7 @@
 * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -97,7 +97,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Hydrate_Array.html b/tests_old/coverage/Doctrine_Hydrate_Array.html index 4979a7492..61bd3198d 100644 --- a/tests_old/coverage/Doctrine_Hydrate_Array.html +++ b/tests_old/coverage/Doctrine_Hydrate_Array.html @@ -10,222 +10,222 @@

Coverage for Doctrine_Hydrate_Array

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id$ + *  $Id$
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Hydrate_Array + * Doctrine_Hydrate_Array
24 * defines an array fetching strategy for Doctrine_Hydrate + * defines an array fetching strategy for Doctrine_Hydrate
25 * + *
26 * @package     Doctrine + * @package     Doctrine
27 * @subpackage  Hydrate + * @subpackage  Hydrate
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30 * @since       1.0 + * @since       1.0
31 * @version     $Revision$ + * @version     $Revision$
32 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
33 */ + */
34class Doctrine_Hydrate_Array +class Doctrine_Hydrate_Array
35{ +{
36    public function getElementCollection($component) +    public function getElementCollection($component)
37    { +    {
38        return array(); +        return array();
39    } +    }
40    public function getElement(array $data, $component) +    public function getElement(array $data, $component)
41    { +    {
42        return $data; +        return $data;
43    } +    }
44    public function isIdentifiable(array $data, Doctrine_Table $table) +    public function isIdentifiable(array $data, Doctrine_Table $table)
45    { +    {
46        return ( ! empty($data)); +        return ( ! empty($data));
47    } +    }
48    public function registerCollection($coll) +    public function registerCollection($coll)
49    { +    {
50 +
51    } +    }
52    public function initRelated(array &$data, $name) +    public function initRelated(array &$data, $name)
53    { +    {
54        if ( ! isset($data[$name])) { +        if ( ! isset($data[$name])) {
55            $data[$name] = array(); +            $data[$name] = array();
56        } +        }
57        return true; +        return true;
58    } +    }
59    public function getNullPointer()  +    public function getNullPointer() 
60    { +    {
61        return null;     +        return null;    
62    } +    }
63    public function getLastKey(&$data) +    public function getLastKey(&$data)
64    { +    {
65        end($data); +        end($data);
66        return key($data); +        return key($data);
67    } +    }
68 +
69    public function flush() +    public function flush()
70    { +    {
71         +        
72    } +    }
73} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Hydrate_Record.html b/tests_old/coverage/Doctrine_Hydrate_Record.html index 0579670eb..6fd342038 100644 --- a/tests_old/coverage/Doctrine_Hydrate_Record.html +++ b/tests_old/coverage/Doctrine_Hydrate_Record.html @@ -10,381 +10,381 @@

Coverage for Doctrine_Hydrate_Record

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id$ + *  $Id$
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Hydrate_Record  + * Doctrine_Hydrate_Record 
24 * defines a record fetching strategy for Doctrine_Hydrate + * defines a record fetching strategy for Doctrine_Hydrate
25 * + *
26 * @package     Doctrine + * @package     Doctrine
27 * @subpackage  Hydrate + * @subpackage  Hydrate
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30 * @since       1.0 + * @since       1.0
31 * @version     $Revision$ + * @version     $Revision$
32 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
33 */ + */
34class Doctrine_Hydrate_Record extends Doctrine_Locator_Injectable +class Doctrine_Hydrate_Record extends Doctrine_Locator_Injectable
35{ +{
36    protected $_collections = array(); +    protected $_collections = array();
37     +    
38    protected $_records = array(); +    protected $_records = array();
39     +    
40    protected $_tables = array(); +    protected $_tables = array();
41 +
42    public function getElementCollection($component) +    public function getElementCollection($component)
43    { +    {
44        $coll = new Doctrine_Collection($component); +        $coll = new Doctrine_Collection($component);
45        $this->_collections[] = $coll; +        $this->_collections[] = $coll;
46 +
47        return $coll; +        return $coll;
48    } +    }
49 +
50    public function getLastKey($coll)  +    public function getLastKey($coll) 
51    { +    {
52        $coll->end(); +        $coll->end();
53         +        
54        return $coll->key(); +        return $coll->key();
55    } +    }
56    public function initRelated($record, $name) +    public function initRelated($record, $name)
57    { +    {
58        if ( ! is_array($record)) { +        if ( ! is_array($record)) {
59            $record[$name]; +            $record[$name];
60 +
61            return true; +            return true;
62        } +        }
63        return false; +        return false;
64    } +    }
65    public function registerCollection(Doctrine_Collection $coll) +    public function registerCollection(Doctrine_Collection $coll)
66    { +    {
67        $this->_collections[] = $coll; +        $this->_collections[] = $coll;
68    } +    }
69 +
70    /** +    /**
71     * isIdentifiable +     * isIdentifiable
72     * returns whether or not a given data row is identifiable (it contains +     * returns whether or not a given data row is identifiable (it contains
73     * all primary key fields specified in the second argument) +     * all primary key fields specified in the second argument)
74     * +     *
75     * @param array $row +     * @param array $row
76     * @param Doctrine_Table $table +     * @param Doctrine_Table $table
77     * @return boolean +     * @return boolean
78     */ +     */
79    public function isIdentifiable(array $row, Doctrine_Table $table) +    public function isIdentifiable(array $row, Doctrine_Table $table)
80    { +    {
81        $primaryKeys = $table->getIdentifier(); +        $primaryKeys = $table->getIdentifier();
82 +
83        if (is_array($primaryKeys)) { +        if (is_array($primaryKeys)) {
84            foreach ($primaryKeys as $id) { +            foreach ($primaryKeys as $id) {
85                if ( ! isset($row[$id])) { +                if ( ! isset($row[$id])) {
86                    return false; +                    return false;
87                } +                }
88            } +            }
89        } else { +        } else {
90            if ( ! isset($row[$primaryKeys])) { +            if ( ! isset($row[$primaryKeys])) {
91                return false; +                return false;
92            } +            }
93        } +        }
94        return true; +        return true;
95    } +    }
96    public function getNullPointer()  +    public function getNullPointer() 
97    { +    {
98        return self::$_null; +        return self::$_null;
99    } +    }
100    public function getElement(array $data, $component) +    public function getElement(array $data, $component)
101    { +    {
102        if ( ! isset($this->_tables[$component])) { +        if ( ! isset($this->_tables[$component])) {
103            $this->_tables[$component] = Doctrine_Manager::getInstance()->getTable($component); +            $this->_tables[$component] = Doctrine_Manager::getInstance()->getTable($component);
104            $this->_tables[$component]->setAttribute(Doctrine::ATTR_LOAD_REFERENCES, false); +            $this->_tables[$component]->setAttribute(Doctrine::ATTR_LOAD_REFERENCES, false);
105        } +        }
106        $this->_tables[$component]->setData($data); +        $this->_tables[$component]->setData($data);
107        $record = $this->_tables[$component]->getRecord(); +        $record = $this->_tables[$component]->getRecord();
108 +
109        if ( ! isset($this->_records[$record->getOid()]) ) { +        if ( ! isset($this->_records[$record->getOid()]) ) {
110            $record->clearRelated(); +            $record->clearRelated();
111            $this->_records[$record->getOid()] = $record; +            $this->_records[$record->getOid()] = $record;
112        } +        }
113 +
114        return $record; +        return $record;
115    } +    }
116    public function flush() +    public function flush()
117    { +    {
118        // take snapshots from all initialized collections +        // take snapshots from all initialized collections
119        foreach ($this->_collections as $key => $coll) { +        foreach ($this->_collections as $key => $coll) {
120            $coll->takeSnapshot(); +            $coll->takeSnapshot();
121        } +        }
122        foreach ($this->_tables as $table) { +        foreach ($this->_tables as $table) {
123            $table->setAttribute(Doctrine::ATTR_LOAD_REFERENCES, true); +            $table->setAttribute(Doctrine::ATTR_LOAD_REFERENCES, true);
124        } +        }
125    } +    }
126} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Hydrator.html b/tests_old/coverage/Doctrine_Hydrator.html index 9795172ac..497431085 100644 --- a/tests_old/coverage/Doctrine_Hydrator.html +++ b/tests_old/coverage/Doctrine_Hydrator.html @@ -64,7 +64,7 @@
 * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -97,7 +97,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Hydrator_Abstract.html b/tests_old/coverage/Doctrine_Hydrator_Abstract.html index a117c75b3..49abe1425 100644 --- a/tests_old/coverage/Doctrine_Hydrator_Abstract.html +++ b/tests_old/coverage/Doctrine_Hydrator_Abstract.html @@ -64,7 +64,7 @@  * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -91,7 +91,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Hydrator_ArrayDriver.html b/tests_old/coverage/Doctrine_Hydrator_ArrayDriver.html index 904e282cf..432a6b6ed 100644 --- a/tests_old/coverage/Doctrine_Hydrator_ArrayDriver.html +++ b/tests_old/coverage/Doctrine_Hydrator_ArrayDriver.html @@ -64,7 +64,7 @@  * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -94,7 +94,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Hydrator_RecordDriver.html b/tests_old/coverage/Doctrine_Hydrator_RecordDriver.html index 9c85650c7..569c80a65 100644 --- a/tests_old/coverage/Doctrine_Hydrator_RecordDriver.html +++ b/tests_old/coverage/Doctrine_Hydrator_RecordDriver.html @@ -64,7 +64,7 @@  * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -94,7 +94,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_I18n.html b/tests_old/coverage/Doctrine_I18n.html index 2639a9dbc..46d50eba2 100644 --- a/tests_old/coverage/Doctrine_I18n.html +++ b/tests_old/coverage/Doctrine_I18n.html @@ -10,339 +10,339 @@

Coverage for Doctrine_I18n

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id$ + *  $Id$
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_I18n + * Doctrine_I18n
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  I18n + * @subpackage  I18n
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision$ + * @version     $Revision$
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_I18n extends Doctrine_Plugin +class Doctrine_I18n extends Doctrine_Plugin
34{ +{
35    protected $_options = array( +    protected $_options = array(
36                            'className'     => '%CLASS%Translation', +                            'className'     => '%CLASS%Translation',
37                            'fields'        => array(), +                            'fields'        => array(),
38                            'generateFiles' => false, +                            'generateFiles' => false,
39                            'table'         => false, +                            'table'         => false,
40                            'pluginTable'   => false, +                            'pluginTable'   => false,
41                            'children'      => array(), +                            'children'      => array(),
42                            ); +                            );
43 +
44    /** +    /**
45     * __construct +     * __construct
46     * +     *
47     * @param string $options  +     * @param string $options 
48     * @return void +     * @return void
49     */ +     */
50    public function __construct($options) +    public function __construct($options)
51    { +    {
52        $this->_options = array_merge($this->_options, $options); +        $this->_options = array_merge($this->_options, $options);
53    } +    }
54 +
55    /** +    /**
56     * buildDefinition +     * buildDefinition
57     * +     *
58     * @param object $Doctrine_Table  +     * @param object $Doctrine_Table 
59     * @return void +     * @return void
60     */ +     */
61    public function buildDefinition() +    public function buildDefinition()
62    { +    {
63       if (empty($this->_options['fields'])) { +       if (empty($this->_options['fields'])) {
64           throw new Doctrine_I18n_Exception('Fields not set.'); +           throw new Doctrine_I18n_Exception('Fields not set.');
65       } +       }
66 +
67        $name = $this->_options['table']->getComponentName(); +        $name = $this->_options['table']->getComponentName();
68 +
69        $columns = array(); +        $columns = array();
70 +
71        $options = array('className' => $this->_options['className']); +        $options = array('className' => $this->_options['className']);
72 +
73        $fk = $this->buildForeignKeys($this->_options['table']); +        $fk = $this->buildForeignKeys($this->_options['table']);
74 +
75        $cols = $this->_options['table']->getColumns(); +        $cols = $this->_options['table']->getColumns();
76 +
77        foreach ($cols as $column => $definition) { +        foreach ($cols as $column => $definition) {
78            if (in_array($column, $this->_options['fields'])) { +            if (in_array($column, $this->_options['fields'])) {
79                $columns[$column] = $definition; +                $columns[$column] = $definition;
80                $this->_options['table']->removeColumn($column); +                $this->_options['table']->removeColumn($column);
81            } +            }
82        } +        }
83 +
84        $columns['lang'] = array('type'    => 'string', +        $columns['lang'] = array('type'    => 'string',
85                                 'length'  => 2, +                                 'length'  => 2,
86                                 'fixed'   => true, +                                 'fixed'   => true,
87                                 'primary' => true); +                                 'primary' => true);
88 +
89        $local = (count($fk) > 1) ? array_keys($fk) : key($fk); +        $local = (count($fk) > 1) ? array_keys($fk) : key($fk);
90 +
91        $relations = array($name => array('local' => $local, +        $relations = array($name => array('local' => $local,
92                                          'foreign' => $this->_options['table']->getIdentifier(), +                                          'foreign' => $this->_options['table']->getIdentifier(),
93                                          'onDelete' => 'CASCADE', +                                          'onDelete' => 'CASCADE',
94                                          'onUpdate' => 'CASCADE')); +                                          'onUpdate' => 'CASCADE'));
95 +
96 +
97        $columns += $fk; +        $columns += $fk;
98 +
99        $options = array('className' => $this->_options['className'], +        $options = array('className' => $this->_options['className'],
100                         'queryParts' => array('indexBy' => 'lang')); +                         'queryParts' => array('indexBy' => 'lang'));
101 +
102        $this->generateClass($options, $columns, $relations); +        $this->generateClass($options, $columns, $relations);
103 +
104        $this->_options['pluginTable'] = $this->_options['table']->getConnection()->getTable($this->_options['className']); +        $this->_options['pluginTable'] = $this->_options['table']->getConnection()->getTable($this->_options['className']);
105         +        
106        $this->_options['pluginTable']->bindQueryPart('indexBy', 'lang'); +        $this->_options['pluginTable']->bindQueryPart('indexBy', 'lang');
107 +
108        $this->generateChildDefinitions(); +        $this->generateChildDefinitions();
109 +
110        return true; +        return true;
111    } +    }
112} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Import.html b/tests_old/coverage/Doctrine_Import.html index baf1a7bf9..b3e89049c 100644 --- a/tests_old/coverage/Doctrine_Import.html +++ b/tests_old/coverage/Doctrine_Import.html @@ -10,682 +10,682 @@

Coverage for Doctrine_Import

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Import_Builder.html b/tests_old/coverage/Doctrine_Import_Builder.html index d95d4b68e..e59cf4461 100644 --- a/tests_old/coverage/Doctrine_Import_Builder.html +++ b/tests_old/coverage/Doctrine_Import_Builder.html @@ -64,7 +64,7 @@ - -
1<?php +<?php
2/* +/*
3 *  $Id: Import.php 3062 2007-11-01 23:54:27Z Jonathan.Wage $ + *  $Id: Import.php 3062 2007-11-01 23:54:27Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Connection_Module'); +Doctrine::autoload('Doctrine_Connection_Module');
22/** +/**
23 * class Doctrine_Import + * class Doctrine_Import
24 * Main responsible of performing import operation. Delegates database schema + * Main responsible of performing import operation. Delegates database schema
25 * reading to a reader object and passes the result to a builder object which + * reading to a reader object and passes the result to a builder object which
26 * builds a Doctrine data model. + * builds a Doctrine data model.
27 * + *
28 * @package     Doctrine + * @package     Doctrine
29 * @subpackage  Import + * @subpackage  Import
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
32 * @since       1.0 + * @since       1.0
33 * @version     $Revision: 3062 $ + * @version     $Revision: 3062 $
34 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
35 * @author      Jukka Hassinen <Jukka.Hassinen@BrainAlliance.com> + * @author      Jukka Hassinen <Jukka.Hassinen@BrainAlliance.com>
36 */ + */
37class Doctrine_Import extends Doctrine_Connection_Module +class Doctrine_Import extends Doctrine_Connection_Module
38{ +{
39    protected $sql = array(); +    protected $sql = array();
40 +
41    /** +    /**
42     * lists all databases +     * lists all databases
43     * +     *
44     * @return array +     * @return array
45     */ +     */
46    public function listDatabases() +    public function listDatabases()
47    { +    {
48        if ( ! isset($this->sql['listDatabases'])) { +        if ( ! isset($this->sql['listDatabases'])) {
49            throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.'); +            throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.');
50        } +        }
51 +
52        return $this->conn->fetchColumn($this->sql['listDatabases']); +        return $this->conn->fetchColumn($this->sql['listDatabases']);
53    } +    }
54 +
55    /** +    /**
56     * lists all availible database functions +     * lists all availible database functions
57     * +     *
58     * @return array +     * @return array
59     */ +     */
60    public function listFunctions() +    public function listFunctions()
61    { +    {
62        if ( ! isset($this->sql['listFunctions'])) { +        if ( ! isset($this->sql['listFunctions'])) {
63            throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.'); +            throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.');
64        } +        }
65 +
66        return $this->conn->fetchColumn($this->sql['listFunctions']); +        return $this->conn->fetchColumn($this->sql['listFunctions']);
67    } +    }
68 +
69    /** +    /**
70     * lists all database triggers +     * lists all database triggers
71     * +     *
72     * @param string|null $database +     * @param string|null $database
73     * @return array +     * @return array
74     */ +     */
75    public function listTriggers($database = null) +    public function listTriggers($database = null)
76    { +    {
77        throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.'); +        throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.');
78    } +    }
79 +
80    /** +    /**
81     * lists all database sequences +     * lists all database sequences
82     * +     *
83     * @param string|null $database +     * @param string|null $database
84     * @return array +     * @return array
85     */ +     */
86    public function listSequences($database = null) +    public function listSequences($database = null)
87    { +    {
88        if ( ! isset($this->sql['listSequences'])) { +        if ( ! isset($this->sql['listSequences'])) {
89            throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.'); +            throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.');
90        } +        }
91 +
92        return $this->conn->fetchColumn($this->sql['listSequences']); +        return $this->conn->fetchColumn($this->sql['listSequences']);
93    } +    }
94 +
95    /** +    /**
96     * lists table constraints +     * lists table constraints
97     * +     *
98     * @param string $table     database table name +     * @param string $table     database table name
99     * @return array +     * @return array
100     */ +     */
101    public function listTableConstraints($table) +    public function listTableConstraints($table)
102    { +    {
103        throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.'); +        throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.');
104    } +    }
105 +
106    /** +    /**
107     * lists table constraints +     * lists table constraints
108     * +     *
109     * @param string $table     database table name +     * @param string $table     database table name
110     * @return array +     * @return array
111     */ +     */
112    public function listTableColumns($table) +    public function listTableColumns($table)
113    { +    {
114        throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.'); +        throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.');
115    } +    }
116 +
117    /** +    /**
118     * lists table constraints +     * lists table constraints
119     * +     *
120     * @param string $table     database table name +     * @param string $table     database table name
121     * @return array +     * @return array
122     */ +     */
123    public function listTableIndexes($table) +    public function listTableIndexes($table)
124    { +    {
125        throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.'); +        throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.');
126    } +    }
127 +
128    /** +    /**
129     * lists tables +     * lists tables
130     * +     *
131     * @param string|null $database +     * @param string|null $database
132     * @return array +     * @return array
133     */ +     */
134    public function listTables($database = null) +    public function listTables($database = null)
135    { +    {
136        throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.'); +        throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.');
137    } +    }
138 +
139    /** +    /**
140     * lists table triggers +     * lists table triggers
141     * +     *
142     * @param string $table     database table name +     * @param string $table     database table name
143     * @return array +     * @return array
144     */ +     */
145    public function listTableTriggers($table) +    public function listTableTriggers($table)
146    { +    {
147        throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.'); +        throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.');
148    } +    }
149 +
150    /** +    /**
151     * lists table views +     * lists table views
152     * +     *
153     * @param string $table     database table name +     * @param string $table     database table name
154     * @return array +     * @return array
155     */ +     */
156    public function listTableViews($table) +    public function listTableViews($table)
157    { +    {
158        throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.'); +        throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.');
159    } +    }
160 +
161    /** +    /**
162     * lists database users +     * lists database users
163     * +     *
164     * @return array +     * @return array
165     */ +     */
166    public function listUsers() +    public function listUsers()
167    { +    {
168        if ( ! isset($this->sql['listUsers'])) { +        if ( ! isset($this->sql['listUsers'])) {
169            throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.'); +            throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.');
170        } +        }
171 +
172        return $this->conn->fetchColumn($this->sql['listUsers']); +        return $this->conn->fetchColumn($this->sql['listUsers']);
173    } +    }
174 +
175    /** +    /**
176     * lists database views +     * lists database views
177     * +     *
178     * @param string|null $database +     * @param string|null $database
179     * @return array +     * @return array
180     */ +     */
181    public function listViews($database = null) +    public function listViews($database = null)
182    { +    {
183        if ( ! isset($this->sql['listViews'])) { +        if ( ! isset($this->sql['listViews'])) {
184            throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.'); +            throw new Doctrine_Import_Exception(__FUNCTION__ . ' not supported by this driver.');
185        } +        }
186 +
187        return $this->conn->fetchColumn($this->sql['listViews']); +        return $this->conn->fetchColumn($this->sql['listViews']);
188    } +    }
189 +
190    /** +    /**
191     * importSchema +     * importSchema
192     * +     *
193     * method for importing existing schema to Doctrine_Record classes +     * method for importing existing schema to Doctrine_Record classes
194     * +     *
195     * @param string $directory +     * @param string $directory
196     * @param array $databases +     * @param array $databases
197     * @return array                the names of the imported classes +     * @return array                the names of the imported classes
198     */ +     */
199    public function importSchema($directory, array $databases = array(), array $options = array()) +    public function importSchema($directory, array $databases = array(), array $options = array())
200    { +    {
201        $connections = Doctrine_Manager::getInstance()->getConnections(); +        $connections = Doctrine_Manager::getInstance()->getConnections();
202         +        
203        foreach ($connections as $name => $connection) { +        foreach ($connections as $name => $connection) {
204          // Limit the databases to the ones specified by $databases. +          // Limit the databases to the ones specified by $databases.
205          // Check only happens if array is not empty +          // Check only happens if array is not empty
206          if ( ! empty($databases) && !in_array($name, $databases)) { +          if ( ! empty($databases) && !in_array($name, $databases)) {
207            continue; +            continue;
208          } +          }
209           +          
210          $builder = new Doctrine_Import_Builder(); +          $builder = new Doctrine_Import_Builder();
211          $builder->setTargetPath($directory); +          $builder->setTargetPath($directory);
212          $builder->setOptions($options); +          $builder->setOptions($options);
213 +
214          $classes = array(); +          $classes = array();
215          foreach ($connection->import->listTables() as $table) { +          foreach ($connection->import->listTables() as $table) {
216              $builder->buildRecord(array('tableName' => $table, +              $builder->buildRecord(array('tableName' => $table,
217                                          'className' => Doctrine::classify($table)), +                                          'className' => Doctrine::classify($table)),
218                                          $connection->import->listTableColumns($table), +                                          $connection->import->listTableColumns($table),
219                                          array()); +                                          array());
220         +        
221              $classes[] = Doctrine::classify($table); +              $classes[] = Doctrine::classify($table);
222          } +          }
223        } +        }
224         +        
225        return $classes; +        return $classes;
226    } +    }
227 }
 * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -97,7 +97,7 @@  * @subpackage  Import
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL diff --git a/tests_old/coverage/Doctrine_Import_Firebird.html b/tests_old/coverage/Doctrine_Import_Firebird.html index 1c204ed56..785a0d902 100644 --- a/tests_old/coverage/Doctrine_Import_Firebird.html +++ b/tests_old/coverage/Doctrine_Import_Firebird.html @@ -10,385 +10,385 @@

Coverage for Doctrine_Import_Firebird

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Import_Mssql.html b/tests_old/coverage/Doctrine_Import_Mssql.html index 2d3933120..32ffc3dad 100644 --- a/tests_old/coverage/Doctrine_Import_Mssql.html +++ b/tests_old/coverage/Doctrine_Import_Mssql.html @@ -64,7 +64,7 @@ - -
1<?php +<?php
2/* +/*
3 *  $Id: Firebird.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Firebird.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Import'); +Doctrine::autoload('Doctrine_Import');
22/** +/**
23  * @package     Doctrine +  * @package     Doctrine
24  * @subpackage  Import +  * @subpackage  Import
25 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
26 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
27 * @author      Lorenzo Alberton <l.alberton@quipo.it> (PEAR MDB2 Interbase driver) + * @author      Lorenzo Alberton <l.alberton@quipo.it> (PEAR MDB2 Interbase driver)
28 * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library) + * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
29 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31 * @since       1.0 + * @since       1.0
32 */ + */
33class Doctrine_Import_Firebird extends Doctrine_Import +class Doctrine_Import_Firebird extends Doctrine_Import
34{ +{
35    /** +    /**
36     * list all tables in the current database +     * list all tables in the current database
37     * +     *
38     * @return array        data array +     * @return array        data array
39     */ +     */
40    public function listTables($database = null) +    public function listTables($database = null)
41    { +    {
42        $query = 'SELECT RDB$RELATION_NAME FROM RDB$RELATIONS WHERE RDB$SYSTEM_FLAG=0 AND RDB$VIEW_BLR IS NULL'; +        $query = 'SELECT RDB$RELATION_NAME FROM RDB$RELATIONS WHERE RDB$SYSTEM_FLAG=0 AND RDB$VIEW_BLR IS NULL';
43 +
44        return $this->conn->fetchColumn($query); +        return $this->conn->fetchColumn($query);
45    } +    }
46 +
47    /** +    /**
48     * list all fields in a tables in the current database +     * list all fields in a tables in the current database
49     * +     *
50     * @param string $table name of table that should be used in method +     * @param string $table name of table that should be used in method
51     * @return mixed data array on success, a MDB2 error on failure +     * @return mixed data array on success, a MDB2 error on failure
52     * @access public +     * @access public
53     */ +     */
54    public function listTableFields($table) +    public function listTableFields($table)
55    { +    {
56        $table = $this->conn->quote(strtoupper($table), 'text'); +        $table = $this->conn->quote(strtoupper($table), 'text');
57        $query = 'SELECT RDB$FIELD_NAME FROM RDB$RELATION_FIELDS WHERE UPPER(RDB$RELATION_NAME) = ' . $table; +        $query = 'SELECT RDB$FIELD_NAME FROM RDB$RELATION_FIELDS WHERE UPPER(RDB$RELATION_NAME) = ' . $table;
58 +
59        return $this->conn->fetchColumn($query); +        return $this->conn->fetchColumn($query);
60    } +    }
61 +
62    /** +    /**
63     * list all users +     * list all users
64     * +     *
65     * @return array            data array containing all database users +     * @return array            data array containing all database users
66     */ +     */
67    public function listUsers() +    public function listUsers()
68    { +    {
69        return $this->conn->fetchColumn('SELECT DISTINCT RDB$USER FROM RDB$USER_PRIVILEGES'); +        return $this->conn->fetchColumn('SELECT DISTINCT RDB$USER FROM RDB$USER_PRIVILEGES');
70    } +    }
71 +
72    /** +    /**
73     * list the views in the database +     * list the views in the database
74     * +     *
75     * @return array            data array containing all database views +     * @return array            data array containing all database views
76     */ +     */
77    public function listViews($database = null) +    public function listViews($database = null)
78    { +    {
79        return $this->conn->fetchColumn('SELECT DISTINCT RDB$VIEW_NAME FROM RDB$VIEW_RELATIONS'); +        return $this->conn->fetchColumn('SELECT DISTINCT RDB$VIEW_NAME FROM RDB$VIEW_RELATIONS');
80    } +    }
81 +
82    /** +    /**
83     * list the views in the database that reference a given table +     * list the views in the database that reference a given table
84     * +     *
85     * @param string $table     table for which all references views should be found +     * @param string $table     table for which all references views should be found
86     * @return array            data array containing all views for given table +     * @return array            data array containing all views for given table
87     */ +     */
88    public function listTableViews($table) +    public function listTableViews($table)
89    { +    {
90        $query  = 'SELECT DISTINCT RDB$VIEW_NAME FROM RDB$VIEW_RELATIONS'; +        $query  = 'SELECT DISTINCT RDB$VIEW_NAME FROM RDB$VIEW_RELATIONS';
91        $table  = $this->conn->quote(strtoupper($table), 'text'); +        $table  = $this->conn->quote(strtoupper($table), 'text');
92        $query .= ' WHERE UPPER(RDB$RELATION_NAME) = ' . $table; +        $query .= ' WHERE UPPER(RDB$RELATION_NAME) = ' . $table;
93 +
94        return $this->conn->fetchColumn($query); +        return $this->conn->fetchColumn($query);
95    } +    }
96 +
97    /** +    /**
98     * list all functions in the current database +     * list all functions in the current database
99     * +     *
100     * @return array              data array containing all availible functions +     * @return array              data array containing all availible functions
101     */ +     */
102    public function listFunctions() +    public function listFunctions()
103    { +    {
104        $query = 'SELECT RDB$FUNCTION_NAME FROM RDB$FUNCTIONS WHERE RDB$SYSTEM_FLAG IS NULL'; +        $query = 'SELECT RDB$FUNCTION_NAME FROM RDB$FUNCTIONS WHERE RDB$SYSTEM_FLAG IS NULL';
105 +
106        return $this->conn->fetchColumn($query); +        return $this->conn->fetchColumn($query);
107    } +    }
108 +
109    /** +    /**
110     * This function will be called to get all triggers of the +     * This function will be called to get all triggers of the
111     * current database ($this->conn->getDatabase()) +     * current database ($this->conn->getDatabase())
112     * +     *
113     * @param  string $table      The name of the table from the +     * @param  string $table      The name of the table from the
114     *                            previous database to query against. +     *                            previous database to query against.
115     * @return array              data array containing all triggers for given table +     * @return array              data array containing all triggers for given table
116     */ +     */
117    public function listTableTriggers($table) +    public function listTableTriggers($table)
118    { +    {
119        $query = 'SELECT RDB$TRIGGER_NAME FROM RDB$TRIGGERS WHERE RDB$SYSTEM_FLAG IS NULL OR RDB$SYSTEM_FLAG = 0'; +        $query = 'SELECT RDB$TRIGGER_NAME FROM RDB$TRIGGERS WHERE RDB$SYSTEM_FLAG IS NULL OR RDB$SYSTEM_FLAG = 0';
120 +
121        if ( ! is_null($table)) { +        if ( ! is_null($table)) {
122            $table = $this->conn->quote(strtoupper($table), 'text'); +            $table = $this->conn->quote(strtoupper($table), 'text');
123            $query .= ' WHERE UPPER(RDB$RELATION_NAME) = ' . $table; +            $query .= ' WHERE UPPER(RDB$RELATION_NAME) = ' . $table;
124        } +        }
125 +
126        return $this->conn->fetchColumn($query); +        return $this->conn->fetchColumn($query);
127    } +    }
128 }
 * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -100,7 +100,7 @@  * @version     $Revision: 3018 $
31 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
32  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Import_Oracle.html b/tests_old/coverage/Doctrine_Import_Oracle.html index 2940c4d75..eb5c9fa81 100644 --- a/tests_old/coverage/Doctrine_Import_Oracle.html +++ b/tests_old/coverage/Doctrine_Import_Oracle.html @@ -10,720 +10,720 @@

Coverage for Doctrine_Import_Oracle

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: Oracle.php 3159 2007-11-15 05:16:31Z Jonathan.Wage $ + *  $Id: Oracle.php 3159 2007-11-15 05:16:31Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Import'); +Doctrine::autoload('Doctrine_Import');
22/** +/**
23 * @package     Doctrine + * @package     Doctrine
24 * @subpackage  Import + * @subpackage  Import
25 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
26 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
27 * @version     $Revision: 3159 $ + * @version     $Revision: 3159 $
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 */ + */
31class Doctrine_Import_Oracle extends Doctrine_Import +class Doctrine_Import_Oracle extends Doctrine_Import
32{ +{
33    /** +    /**
34     * lists all databases +     * lists all databases
35     * +     *
36     * @return array +     * @return array
37     */ +     */
38    public function listDatabases() +    public function listDatabases()
39    { +    {
40        if ( ! $this->conn->getAttribute(Doctrine::ATTR_EMULATE_DATABASE)) { +        if ( ! $this->conn->getAttribute(Doctrine::ATTR_EMULATE_DATABASE)) {
41            throw new Doctrine_Import_Exception('database listing is only supported if the "emulate_database" option is enabled'); +            throw new Doctrine_Import_Exception('database listing is only supported if the "emulate_database" option is enabled');
42        } +        }
43        /** +        /**
44        if ($this->conn->options['database_name_prefix']) { +        if ($this->conn->options['database_name_prefix']) {
45            $query = 'SELECT SUBSTR(username, '; +            $query = 'SELECT SUBSTR(username, ';
46            $query.= (strlen($this->conn->getAttribute(['database_name_prefix'])+1); +            $query.= (strlen($this->conn->getAttribute(['database_name_prefix'])+1);
47            $query.= ") FROM sys.dba_users WHERE username LIKE '"; +            $query.= ") FROM sys.dba_users WHERE username LIKE '";
48            $query.= $this->conn->options['database_name_prefix']."%'"; +            $query.= $this->conn->options['database_name_prefix']."%'";
49        } else { +        } else {
50        */ +        */
51        $query   = 'SELECT username FROM sys.dba_users'; +        $query   = 'SELECT username FROM sys.dba_users';
52 +
53        $result2 = $this->conn->standaloneQuery($query); +        $result2 = $this->conn->standaloneQuery($query);
54        $result  = $result2->fetchColumn(); +        $result  = $result2->fetchColumn();
55 +
56        return $result; +        return $result;
57    } +    }
58 +
59    /** +    /**
60     * lists all availible database functions +     * lists all availible database functions
61     * +     *
62     * @return array +     * @return array
63     */ +     */
64    public function listFunctions() +    public function listFunctions()
65    { +    {
66        $query = "SELECT name FROM sys.user_source WHERE line = 1 AND type = 'FUNCTION'"; +        $query = "SELECT name FROM sys.user_source WHERE line = 1 AND type = 'FUNCTION'";
67 +
68        return $this->conn->fetchColumn($query); +        return $this->conn->fetchColumn($query);
69    } +    }
70 +
71    /** +    /**
72     * lists all database triggers +     * lists all database triggers
73     * +     *
74     * @param string|null $database +     * @param string|null $database
75     * @return array +     * @return array
76     */ +     */
77    public function listTriggers($database = null) +    public function listTriggers($database = null)
78    { +    {
79 +
80    } +    }
81 +
82    /** +    /**
83     * lists all database sequences +     * lists all database sequences
84     * +     *
85     * @param string|null $database +     * @param string|null $database
86     * @return array +     * @return array
87     */ +     */
88    public function listSequences($database = null) +    public function listSequences($database = null)
89    { +    {
90        $query = "SELECT sequence_name FROM sys.user_sequences"; +        $query = "SELECT sequence_name FROM sys.user_sequences";
91 +
92        $tableNames = $this->conn->fetchColumn($query); +        $tableNames = $this->conn->fetchColumn($query);
93 +
94        return array_map(array($this->conn->formatter, 'fixSequenceName'), $tableNames); +        return array_map(array($this->conn->formatter, 'fixSequenceName'), $tableNames);
95    } +    }
96 +
97    /** +    /**
98     * lists table constraints +     * lists table constraints
99     * +     *
100     * @param string $table     database table name +     * @param string $table     database table name
101     * @return array +     * @return array
102     */ +     */
103    public function listTableConstraints($table) +    public function listTableConstraints($table)
104    { +    {
105        $table = $this->conn->quote($table, 'text'); +        $table = $this->conn->quote($table, 'text');
106 +
107        $query = 'SELECT index_name name FROM user_constraints' +        $query = 'SELECT index_name name FROM user_constraints'
108               . ' WHERE table_name = ' . $table . ' OR table_name = ' . strtoupper($table); +               . ' WHERE table_name = ' . $table . ' OR table_name = ' . strtoupper($table);
109 +
110        $constraints = $this->conn->fetchColumn($query); +        $constraints = $this->conn->fetchColumn($query);
111 +
112        return array_map(array($this->conn->formatter, 'fixIndexName'), $constraints); +        return array_map(array($this->conn->formatter, 'fixIndexName'), $constraints);
113    } +    }
114 +
115    /** +    /**
116     * lists table constraints +     * lists table constraints
117     * +     *
118     * @param string $table     database table name +     * @param string $table     database table name
119     * @return array +     * @return array
120     */ +     */
121    public function listTableColumns($table) +    public function listTableColumns($table)
122    { +    {
123        $table  = strtoupper($table); +        $table  = strtoupper($table);
124        $sql    = "SELECT column_name, data_type, data_length, nullable, data_default, data_scale, data_precision FROM all_tab_columns" +        $sql    = "SELECT column_name, data_type, data_length, nullable, data_default, data_scale, data_precision FROM all_tab_columns"
125                . " WHERE table_name = '" . $table . "' ORDER BY column_name"; +                . " WHERE table_name = '" . $table . "' ORDER BY column_name";
126 +
127        $result = $this->conn->fetchAssoc($sql); +        $result = $this->conn->fetchAssoc($sql);
128 +
129        $descr = array(); +        $descr = array();
130 +
131        foreach($result as $val) { +        foreach($result as $val) {
132            $val = array_change_key_case($val, CASE_LOWER); +            $val = array_change_key_case($val, CASE_LOWER);
133            $decl = $this->conn->dataDict->getPortableDeclaration($val); +            $decl = $this->conn->dataDict->getPortableDeclaration($val);
134 +
135 +
136            $descr[$val['column_name']] = array( +            $descr[$val['column_name']] = array(
137               'name'       => $val['column_name'], +               'name'       => $val['column_name'],
138               'notnull'    => (bool) ($val['nullable'] === 'N'), +               'notnull'    => (bool) ($val['nullable'] === 'N'),
139               'ntype'      => $val['data_type'], +               'ntype'      => $val['data_type'],
140               'type'       => $decl['type'][0], +               'type'       => $decl['type'][0],
141               'alltypes'   => $decl['type'], +               'alltypes'   => $decl['type'],
142               'fixed'      => $decl['fixed'], +               'fixed'      => $decl['fixed'],
143               'unsigned'   => $decl['unsigned'], +               'unsigned'   => $decl['unsigned'],
144               'default'    => $val['data_default'], +               'default'    => $val['data_default'],
145               'length'     => $val['data_length'], +               'length'     => $val['data_length'],
146               'precision'  => $val['data_precision'], +               'precision'  => $val['data_precision'],
147               'scale'      => $val['scale'], +               'scale'      => $val['scale'],
148            ); +            );
149        } +        }
150 +
151        return $descr; +        return $descr;
152    } +    }
153 +
154    /** +    /**
155     * lists table constraints +     * lists table constraints
156     * +     *
157     * @param string $table     database table name +     * @param string $table     database table name
158     * @return array +     * @return array
159     */ +     */
160    public function listTableIndexes($table) +    public function listTableIndexes($table)
161    { +    {
162        $table = $this->conn->quote($table, 'text'); +        $table = $this->conn->quote($table, 'text');
163        $query = 'SELECT index_name name FROM user_indexes' +        $query = 'SELECT index_name name FROM user_indexes'
164               . ' WHERE table_name = ' . $table . ' OR table_name = ' . strtoupper($table) +               . ' WHERE table_name = ' . $table . ' OR table_name = ' . strtoupper($table)
165               . ' AND generated = ' . $this->conn->quote('N', 'text'); +               . ' AND generated = ' . $this->conn->quote('N', 'text');
166 +
167        $indexes = $this->conn->fetchColumn($query); +        $indexes = $this->conn->fetchColumn($query);
168 +
169        return array_map(array($this->conn->formatter, 'fixIndexName'), $indexes); +        return array_map(array($this->conn->formatter, 'fixIndexName'), $indexes);
170    } +    }
171 +
172    /** +    /**
173     * lists tables +     * lists tables
174     * +     *
175     * @param string|null $database +     * @param string|null $database
176     * @return array +     * @return array
177     */ +     */
178    public function listTables($database = null) +    public function listTables($database = null)
179    { +    {
180        $query = 'SELECT table_name FROM sys.user_tables'; +        $query = 'SELECT table_name FROM sys.user_tables';
181        return $this->conn->fetchColumn($query); +        return $this->conn->fetchColumn($query);
182    } +    }
183 +
184    /** +    /**
185     * lists table triggers +     * lists table triggers
186     * +     *
187     * @param string $table     database table name +     * @param string $table     database table name
188     * @return array +     * @return array
189     */ +     */
190    public function listTableTriggers($table) +    public function listTableTriggers($table)
191    { +    {
192 +
193    } +    }
194 +
195    /** +    /**
196     * lists table views +     * lists table views
197     * +     *
198     * @param string $table     database table name +     * @param string $table     database table name
199     * @return array +     * @return array
200     */ +     */
201    public function listTableViews($table) +    public function listTableViews($table)
202    { +    {
203 +
204    } +    }
205 +
206    /** +    /**
207     * lists database users +     * lists database users
208     * +     *
209     * @return array +     * @return array
210     */ +     */
211    public function listUsers() +    public function listUsers()
212    { +    {
213        /** +        /**
214        if ($this->conn->options['emulate_database'] && $this->conn->options['database_name_prefix']) { +        if ($this->conn->options['emulate_database'] && $this->conn->options['database_name_prefix']) {
215            $query = 'SELECT SUBSTR(username, '; +            $query = 'SELECT SUBSTR(username, ';
216            $query.= (strlen($this->conn->options['database_name_prefix'])+1); +            $query.= (strlen($this->conn->options['database_name_prefix'])+1);
217            $query.= ") FROM sys.dba_users WHERE username NOT LIKE '"; +            $query.= ") FROM sys.dba_users WHERE username NOT LIKE '";
218            $query.= $this->conn->options['database_name_prefix']."%'"; +            $query.= $this->conn->options['database_name_prefix']."%'";
219        } else { +        } else {
220        */ +        */
221 +
222        $query = 'SELECT username FROM sys.dba_users'; +        $query = 'SELECT username FROM sys.dba_users';
223        //} +        //}
224 +
225        return $this->conn->fetchColumn($query); +        return $this->conn->fetchColumn($query);
226    } +    }
227 +
228    /** +    /**
229     * lists database views +     * lists database views
230     * +     *
231     * @param string|null $database +     * @param string|null $database
232     * @return array +     * @return array
233     */ +     */
234    public function listViews($database = null) +    public function listViews($database = null)
235    { +    {
236        $query = 'SELECT view_name FROM sys.user_views'; +        $query = 'SELECT view_name FROM sys.user_views';
237        return $this->conn->fetchColumn($query); +        return $this->conn->fetchColumn($query);
238    } +    }
239} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Import_Pgsql.html b/tests_old/coverage/Doctrine_Import_Pgsql.html index 8ba6256b7..2f46ab352 100644 --- a/tests_old/coverage/Doctrine_Import_Pgsql.html +++ b/tests_old/coverage/Doctrine_Import_Pgsql.html @@ -10,724 +10,724 @@

Coverage for Doctrine_Import_Pgsql

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Import_Schema.html b/tests_old/coverage/Doctrine_Import_Schema.html index a10e956b3..82333df3b 100644 --- a/tests_old/coverage/Doctrine_Import_Schema.html +++ b/tests_old/coverage/Doctrine_Import_Schema.html @@ -64,7 +64,7 @@ - - - -
1<?php +<?php
2/* +/*
3 *  $Id: Pgsql.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Pgsql.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Import'); +Doctrine::autoload('Doctrine_Import');
22/** +/**
23 * @package     Doctrine + * @package     Doctrine
24 * @subpackage  Import + * @subpackage  Import
25 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
26 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
27 * @author      Paul Cooper <pgc@ucecom.com> + * @author      Paul Cooper <pgc@ucecom.com>
28 * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library) + * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
29 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31 * @since       1.0 + * @since       1.0
32 */ + */
33class Doctrine_Import_Pgsql extends Doctrine_Import +class Doctrine_Import_Pgsql extends Doctrine_Import
34{ +{
35 +
36    protected $sql = array( +    protected $sql = array(
37                        'listDatabases' => 'SELECT datname FROM pg_database', +                        'listDatabases' => 'SELECT datname FROM pg_database',
38                        'listFunctions' => "SELECT +                        'listFunctions' => "SELECT
39                                                proname +                                                proname
40                                            FROM +                                            FROM
41                                                pg_proc pr, +                                                pg_proc pr,
42                                                pg_type tp +                                                pg_type tp
43                                            WHERE +                                            WHERE
44                                                tp.oid = pr.prorettype +                                                tp.oid = pr.prorettype
45                                                AND pr.proisagg = FALSE +                                                AND pr.proisagg = FALSE
46                                                AND tp.typname <> 'trigger' +                                                AND tp.typname <> 'trigger'
47                                                AND pr.pronamespace IN +                                                AND pr.pronamespace IN
48                                                    (SELECT oid FROM pg_namespace +                                                    (SELECT oid FROM pg_namespace
49                                                     WHERE nspname NOT LIKE 'pg_%' AND nspname != 'information_schema'", +                                                     WHERE nspname NOT LIKE 'pg_%' AND nspname != 'information_schema'",
50                        'listSequences' => "SELECT +                        'listSequences' => "SELECT
51                                                relname +                                                relname
52                                            FROM +                                            FROM
53                                                pg_class +                                                pg_class
54                                            WHERE relkind = 'S' AND relnamespace IN +                                            WHERE relkind = 'S' AND relnamespace IN
55                                                (SELECT oid FROM pg_namespace +                                                (SELECT oid FROM pg_namespace
56                                                 WHERE nspname NOT LIKE 'pg_%' AND nspname != 'information_schema')", +                                                 WHERE nspname NOT LIKE 'pg_%' AND nspname != 'information_schema')",
57                        'listTables'    => "SELECT +                        'listTables'    => "SELECT
58                                                c.relname AS table_name +                                                c.relname AS table_name
59                                            FROM pg_class c, pg_user u +                                            FROM pg_class c, pg_user u
60                                            WHERE c.relowner = u.usesysid +                                            WHERE c.relowner = u.usesysid
61                                                AND c.relkind = 'r' +                                                AND c.relkind = 'r'
62                                                AND NOT EXISTS (SELECT 1 FROM pg_views WHERE viewname = c.relname) +                                                AND NOT EXISTS (SELECT 1 FROM pg_views WHERE viewname = c.relname)
63                                                AND c.relname !~ '^(pg_|sql_)' +                                                AND c.relname !~ '^(pg_|sql_)'
64                                            UNION +                                            UNION
65                                            SELECT c.relname AS table_name +                                            SELECT c.relname AS table_name
66                                            FROM pg_class c +                                            FROM pg_class c
67                                            WHERE c.relkind = 'r' +                                            WHERE c.relkind = 'r'
68                                                AND NOT EXISTS (SELECT 1 FROM pg_views WHERE viewname = c.relname) +                                                AND NOT EXISTS (SELECT 1 FROM pg_views WHERE viewname = c.relname)
69                                                AND NOT EXISTS (SELECT 1 FROM pg_user WHERE usesysid = c.relowner) +                                                AND NOT EXISTS (SELECT 1 FROM pg_user WHERE usesysid = c.relowner)
70                                                AND c.relname !~ '^pg_'", +                                                AND c.relname !~ '^pg_'",
71                        'listViews'     => 'SELECT viewname FROM pg_views', +                        'listViews'     => 'SELECT viewname FROM pg_views',
72                        'listUsers'     => 'SELECT usename FROM pg_user', +                        'listUsers'     => 'SELECT usename FROM pg_user',
73                        'listTableConstraints' => "SELECT +                        'listTableConstraints' => "SELECT
74                                                        relname +                                                        relname
75                                                   FROM +                                                   FROM
76                                                        pg_class +                                                        pg_class
77                                                   WHERE oid IN ( +                                                   WHERE oid IN (
78                                                        SELECT indexrelid +                                                        SELECT indexrelid
79                                                        FROM pg_index, pg_class +                                                        FROM pg_index, pg_class
80                                                        WHERE pg_class.relname = %s +                                                        WHERE pg_class.relname = %s
81                                                            AND pg_class.oid = pg_index.indrelid +                                                            AND pg_class.oid = pg_index.indrelid
82                                                            AND (indisunique = 't' OR indisprimary = 't') +                                                            AND (indisunique = 't' OR indisprimary = 't')
83                                                        )", +                                                        )",
84                        'listTableIndexes'     => "SELECT +                        'listTableIndexes'     => "SELECT
85                                                        relname +                                                        relname
86                                                   FROM +                                                   FROM
87                                                        pg_class +                                                        pg_class
88                                                   WHERE oid IN ( +                                                   WHERE oid IN (
89                                                        SELECT indexrelid +                                                        SELECT indexrelid
90                                                        FROM pg_index, pg_class +                                                        FROM pg_index, pg_class
91                                                        WHERE pg_class.relname = %s +                                                        WHERE pg_class.relname = %s
92                                                            AND pg_class.oid=pg_index.indrelid +                                                            AND pg_class.oid=pg_index.indrelid
93                                                            AND indisunique != 't' +                                                            AND indisunique != 't'
94                                                            AND indisprimary != 't' +                                                            AND indisprimary != 't'
95                                                        )", +                                                        )",
96                        'listTableColumns'     => "SELECT +                        'listTableColumns'     => "SELECT
97                                                        a.attnum, +                                                        a.attnum,
98                                                        a.attname AS field, +                                                        a.attname AS field,
99                                                        t.typname AS type, +                                                        t.typname AS type,
100                                                        format_type(a.atttypid, a.atttypmod) AS complete_type, +                                                        format_type(a.atttypid, a.atttypmod) AS complete_type,
101                                                        a.attnotnull AS isnotnull, +                                                        a.attnotnull AS isnotnull,
102                                                        (SELECT 't' +                                                        (SELECT 't'
103                                                          FROM pg_index +                                                          FROM pg_index
104                                                          WHERE c.oid = pg_index.indrelid +                                                          WHERE c.oid = pg_index.indrelid
105                                                          AND pg_index.indkey[0] = a.attnum +                                                          AND pg_index.indkey[0] = a.attnum
106                                                          AND pg_index.indisprimary = 't' +                                                          AND pg_index.indisprimary = 't'
107                                                        ) AS pri, +                                                        ) AS pri,
108                                                        (SELECT pg_attrdef.adsrc +                                                        (SELECT pg_attrdef.adsrc
109                                                          FROM pg_attrdef +                                                          FROM pg_attrdef
110                                                          WHERE c.oid = pg_attrdef.adrelid +                                                          WHERE c.oid = pg_attrdef.adrelid
111                                                          AND pg_attrdef.adnum=a.attnum +                                                          AND pg_attrdef.adnum=a.attnum
112                                                        ) AS default +                                                        ) AS default
113                                                  FROM pg_attribute a, pg_class c, pg_type t +                                                  FROM pg_attribute a, pg_class c, pg_type t
114                                                  WHERE c.relname = %s +                                                  WHERE c.relname = %s
115                                                        AND a.attnum > 0 +                                                        AND a.attnum > 0
116                                                        AND a.attrelid = c.oid +                                                        AND a.attrelid = c.oid
117                                                        AND a.atttypid = t.oid +                                                        AND a.atttypid = t.oid
118                                                  ORDER BY a.attnum", +                                                  ORDER BY a.attnum",
119                        ); +                        );
120 +
121    /** +    /**
122     * lists all database triggers +     * lists all database triggers
123     * +     *
124     * @param string|null $database +     * @param string|null $database
125     * @return array +     * @return array
126     */ +     */
127    public function listTriggers($database = null) +    public function listTriggers($database = null)
128    { +    {
129 +
130    } +    }
131 +
132    /** +    /**
133     * lists table constraints +     * lists table constraints
134     * +     *
135     * @param string $table     database table name +     * @param string $table     database table name
136     * @return array +     * @return array
137     */ +     */
138    public function listTableConstraints($table) +    public function listTableConstraints($table)
139    { +    {
140        $table = $this->conn->quote($table); +        $table = $this->conn->quote($table);
141        $query = sprintf($this->sql['listTableConstraints'], $table); +        $query = sprintf($this->sql['listTableConstraints'], $table);
142 +
143        return $this->conn->fetchColumn($query); +        return $this->conn->fetchColumn($query);
144    } +    }
145 +
146    /** +    /**
147     * lists table constraints +     * lists table constraints
148     * +     *
149     * @param string $table     database table name +     * @param string $table     database table name
150     * @return array +     * @return array
151     */ +     */
152    public function listTableColumns($table) +    public function listTableColumns($table)
153    { +    {
154        $table = $this->conn->quote($table); +        $table = $this->conn->quote($table);
155        $query = sprintf($this->sql['listTableColumns'], $table); +        $query = sprintf($this->sql['listTableColumns'], $table);
156        $result = $this->conn->fetchAssoc($query); +        $result = $this->conn->fetchAssoc($query);
157 +
158        $columns     = array(); +        $columns     = array();
159        foreach ($result as $key => $val) { +        foreach ($result as $key => $val) {
160            $val = array_change_key_case($val, CASE_LOWER); +            $val = array_change_key_case($val, CASE_LOWER);
161 +
162            if (strtolower($val['type']) === 'varchar') { +            if (strtolower($val['type']) === 'varchar') {
163                // get length from varchar definition +                // get length from varchar definition
164                $length = preg_replace('~.*\(([0-9]*)\).*~', '$1', $val['complete_type']); +                $length = preg_replace('~.*\(([0-9]*)\).*~', '$1', $val['complete_type']);
165                $val['length'] = $length; +                $val['length'] = $length;
166            } +            }
167             +            
168            $decl = $this->conn->dataDict->getPortableDeclaration($val); +            $decl = $this->conn->dataDict->getPortableDeclaration($val);
169 +
170            $description = array( +            $description = array(
171                'name'      => $val['field'], +                'name'      => $val['field'],
172                'ntype'     => $val['type'], +                'ntype'     => $val['type'],
173                'type'      => $decl['type'][0], +                'type'      => $decl['type'][0],
174                'alltypes'  => $decl['type'], +                'alltypes'  => $decl['type'],
175                'length'    => $decl['length'], +                'length'    => $decl['length'],
176                'fixed'     => $decl['fixed'], +                'fixed'     => $decl['fixed'],
177                'unsigned'  => $decl['unsigned'], +                'unsigned'  => $decl['unsigned'],
178                'notnull'   => ($val['isnotnull'] == ''), +                'notnull'   => ($val['isnotnull'] == ''),
179                'default'   => $val['default'], +                'default'   => $val['default'],
180                'primary'   => ($val['pri'] == 't'), +                'primary'   => ($val['pri'] == 't'),
181            ); +            );
182            $columns[$val['field']] = $description; +            $columns[$val['field']] = $description;
183        } +        }
184        return $columns; +        return $columns;
185    } +    }
186 +
187    /** +    /**
188     * list all indexes in a table +     * list all indexes in a table
189     * +     *
190     * @param string $table     database table name +     * @param string $table     database table name
191     * @return array +     * @return array
192     */ +     */
193    public function listTableIndexes($table) +    public function listTableIndexes($table)
194    { +    {
195        $table = $this->conn->quote($table); +        $table = $this->conn->quote($table);
196        $query = sprintf($this->sql['listTableIndexes'], $table); +        $query = sprintf($this->sql['listTableIndexes'], $table);
197 +
198        return $this->conn->fetchColumn($query); +        return $this->conn->fetchColumn($query);
199    } +    }
200 +
201    /** +    /**
202     * lists tables +     * lists tables
203     * +     *
204     * @param string|null $database +     * @param string|null $database
205     * @return array +     * @return array
206     */ +     */
207    public function listTables($database = null) +    public function listTables($database = null)
208    { +    {
209        return $this->conn->fetchColumn($this->sql['listTables']); +        return $this->conn->fetchColumn($this->sql['listTables']);
210    } +    }
211 +
212    /** +    /**
213     * lists table triggers +     * lists table triggers
214     * +     *
215     * @param string $table     database table name +     * @param string $table     database table name
216     * @return array +     * @return array
217     */ +     */
218    public function listTableTriggers($table) +    public function listTableTriggers($table)
219    { +    {
220        $query = 'SELECT trg.tgname AS trigger_name +        $query = 'SELECT trg.tgname AS trigger_name
221                    FROM pg_trigger trg, +                    FROM pg_trigger trg,
222                         pg_class tbl +                         pg_class tbl
223                   WHERE trg.tgrelid = tbl.oid'; +                   WHERE trg.tgrelid = tbl.oid';
224        if ($table !== null) { +        if ($table !== null) {
225            $table = $this->conn->quote(strtoupper($table), 'string'); +            $table = $this->conn->quote(strtoupper($table), 'string');
226            $query .= " AND tbl.relname = $table"; +            $query .= " AND tbl.relname = $table";
227        } +        }
228        return $this->conn->fetchColumn($query); +        return $this->conn->fetchColumn($query);
229    } +    }
230 +
231    /** +    /**
232     * list the views in the database that reference a given table +     * list the views in the database that reference a given table
233     * +     *
234     * @param string $table     database table name +     * @param string $table     database table name
235     * @return array +     * @return array
236     */ +     */
237    public function listTableViews($table) +    public function listTableViews($table)
238    { +    {
239        return $this->conn->fetchColumn($query); +        return $this->conn->fetchColumn($query);
240    } +    }
241 }
 * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -109,7 +109,7 @@  * @subpackage  Import
34 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
35  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL diff --git a/tests_old/coverage/Doctrine_Import_Sqlite.html b/tests_old/coverage/Doctrine_Import_Sqlite.html index 289c095a9..c8902a5f0 100644 --- a/tests_old/coverage/Doctrine_Import_Sqlite.html +++ b/tests_old/coverage/Doctrine_Import_Sqlite.html @@ -64,7 +64,7 @@  * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -94,7 +94,7 @@  * @version     $Revision: 3018 $
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Lib.html b/tests_old/coverage/Doctrine_Lib.html index 4105b713c..ab97d2db0 100644 --- a/tests_old/coverage/Doctrine_Lib.html +++ b/tests_old/coverage/Doctrine_Lib.html @@ -10,804 +10,804 @@

Coverage for Doctrine_Lib

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: Lib.php 3189 2007-11-18 20:37:44Z meus $ + *  $Id: Lib.php 3189 2007-11-18 20:37:44Z meus $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Lib has not commonly used static functions, mostly for debugging purposes + * Doctrine_Lib has not commonly used static functions, mostly for debugging purposes
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Lib + * @subpackage  Lib
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 3189 $ + * @version     $Revision: 3189 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Lib +class Doctrine_Lib
34{ +{
35    /** +    /**
36     * @param integer $state                the state of record +     * @param integer $state                the state of record
37     * @see Doctrine_Record::STATE_* constants +     * @see Doctrine_Record::STATE_* constants
38     * @return string                       string representation of given state +     * @return string                       string representation of given state
39     */ +     */
40    public static function getRecordStateAsString($state) +    public static function getRecordStateAsString($state)
41    { +    {
42        switch ($state) { +        switch ($state) {
43        case Doctrine_Record::STATE_PROXY: +        case Doctrine_Record::STATE_PROXY:
44            return "proxy"; +            return "proxy";
45            break; +            break;
46        case Doctrine_Record::STATE_CLEAN: +        case Doctrine_Record::STATE_CLEAN:
47            return "persistent clean"; +            return "persistent clean";
48            break; +            break;
49        case Doctrine_Record::STATE_DIRTY: +        case Doctrine_Record::STATE_DIRTY:
50            return "persistent dirty"; +            return "persistent dirty";
51            break; +            break;
52        case Doctrine_Record::STATE_TDIRTY: +        case Doctrine_Record::STATE_TDIRTY:
53            return "transient dirty"; +            return "transient dirty";
54            break; +            break;
55        case Doctrine_Record::STATE_TCLEAN: +        case Doctrine_Record::STATE_TCLEAN:
56            return "transient clean"; +            return "transient clean";
57            break; +            break;
58        } +        }
59    } +    }
60 +
61    /** +    /**
62     * returns a string representation of Doctrine_Record object +     * returns a string representation of Doctrine_Record object
63     * @param Doctrine_Record $record +     * @param Doctrine_Record $record
64     * @return string +     * @return string
65     */ +     */
66    public static function getRecordAsString(Doctrine_Record $record) +    public static function getRecordAsString(Doctrine_Record $record)
67    { +    {
68        $r[] = '<pre>'; +        $r[] = '<pre>';
69        $r[] = 'Component  : ' . $record->getTable()->getComponentName(); +        $r[] = 'Component  : ' . $record->getTable()->getComponentName();
70        $r[] = 'ID         : ' . $record->obtainIdentifier(); +        $r[] = 'ID         : ' . $record->obtainIdentifier();
71        $r[] = 'References : ' . count($record->getReferences()); +        $r[] = 'References : ' . count($record->getReferences());
72        $r[] = 'State      : ' . Doctrine_Lib::getRecordStateAsString($record->getState()); +        $r[] = 'State      : ' . Doctrine_Lib::getRecordStateAsString($record->getState());
73        $r[] = 'OID        : ' . $record->getOID(); +        $r[] = 'OID        : ' . $record->getOID();
74        $r[] = 'data       : ' . Doctrine::dump($record->getData(), false); +        $r[] = 'data       : ' . Doctrine::dump($record->getData(), false);
75        $r[] = '</pre>'; +        $r[] = '</pre>';
76        return implode("\n",$r)."<br />"; +        return implode("\n",$r)."<br />";
77    } +    }
78 +
79    /** +    /**
80     * Return an collection of records as XML.  +     * Return an collection of records as XML. 
81     *  +     * 
82     * @see getRecordAsXml for options to set in the record class to control this. +     * @see getRecordAsXml for options to set in the record class to control this.
83     * +     *
84     * @param Doctrine_Collection $collection +     * @param Doctrine_Collection $collection
85     * @param SimpleXMLElement $xml +     * @param SimpleXMLElement $xml
86     * @return string Xml as string  +     * @return string Xml as string 
87     */ +     */
88    public static function getCollectionAsXml(Doctrine_Collection $collection, SimpleXMLElement $incomming_xml = null) { +    public static function getCollectionAsXml(Doctrine_Collection $collection, SimpleXMLElement $incomming_xml = null) {
89 +
90        $collectionName = Doctrine_Lib::plurelize($collection->getTable()->tableName); +        $collectionName = Doctrine_Lib::plurelize($collection->getTable()->tableName);
91        if ( $collection->count() != 0) { +        if ( $collection->count() != 0) {
92            $record = $collection[0]; +            $record = $collection[0];
93            $xml_options = $record->option("xml"); +            $xml_options = $record->option("xml");
94            if ( isset($xml_options["collection_name"])) { +            if ( isset($xml_options["collection_name"])) {
95                $collectionName = $xml_options["collection_name"]; +                $collectionName = $xml_options["collection_name"];
96            } +            }
97        } +        }
98 +
99        if ( ! isset($incomming_xml)) { +        if ( ! isset($incomming_xml)) {
100            $new_xml_string = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?><" . $collectionName . "></" . $collectionName . ">"; +            $new_xml_string = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?><" . $collectionName . "></" . $collectionName . ">";
101            $xml = new SimpleXMLElement($new_xml_string); +            $xml = new SimpleXMLElement($new_xml_string);
102        } else { +        } else {
103            $xml = $incomming_xml->addChild($collectionName); +            $xml = $incomming_xml->addChild($collectionName);
104        } +        }
105        foreach ($collection as $key => $record) { +        foreach ($collection as $key => $record) {
106            Doctrine_Lib::getRecordAsXml($record, $xml); +            Doctrine_Lib::getRecordAsXml($record, $xml);
107        } +        }
108        return $xml->asXML(); +        return $xml->asXML();
109    } +    }
110 +
111    public static function plurelize($string) { +    public static function plurelize($string) {
112        return $string . "s"; +        return $string . "s";
113    } +    }
114 +
115    /** +    /**
116     * Return a recrd as XML.  +     * Return a recrd as XML. 
117     * +     *
118     * In order to control how this is done set the "xml" option in a record.  +     * In order to control how this is done set the "xml" option in a record. 
119     * This option is an array that has the keys "ignore_fields" and "include_relations". Both of these are arrays that list the name of fields/relations to include/process.  +     * This option is an array that has the keys "ignore_fields" and "include_relations". Both of these are arrays that list the name of fields/relations to include/process. 
120     * +     *
121     * If you want to insert this xml as a part inside another xml send a  +     * If you want to insert this xml as a part inside another xml send a 
122     * SimpleXMLElement to the function. Because of the nature of SimpleXML the  +     * SimpleXMLElement to the function. Because of the nature of SimpleXML the 
123     * content you add to this element will be avilable after the function is  +     * content you add to this element will be avilable after the function is 
124     * complete. +     * complete.
125     * +     *
126     * @param Doctrine_Record $record +     * @param Doctrine_Record $record
127     * @param SimpleXMLElement $xml +     * @param SimpleXMLElement $xml
128     * @return string Xml as string +     * @return string Xml as string
129     */ +     */
130    public static function getRecordAsXml(Doctrine_Record $record, SimpleXMlElement $incomming_xml = NULL) +    public static function getRecordAsXml(Doctrine_Record $record, SimpleXMlElement $incomming_xml = NULL)
131    { +    {
132        $recordname = $record->getTable()->tableName; +        $recordname = $record->getTable()->tableName;
133        if ( !isset($incomming_xml)) { +        if ( !isset($incomming_xml)) {
134            $new_xml_string = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?><" . $recordname . "></" . $recordname . ">"; +            $new_xml_string = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?><" . $recordname . "></" . $recordname . ">";
135            $xml = new SimpleXMLElement($new_xml_string); +            $xml = new SimpleXMLElement($new_xml_string);
136        } else { +        } else {
137            $xml = $incomming_xml->addChild($recordname); +            $xml = $incomming_xml->addChild($recordname);
138 } + }
139        $xml_options = $record->option("xml"); +        $xml_options = $record->option("xml");
140        if ( isset($xml_options["record_name"])) { +        if ( isset($xml_options["record_name"])) {
141            $recordname = $xml_options["record_name"]; +            $recordname = $xml_options["record_name"];
142        } +        }
143        foreach ($record->getData() as $field => $value) { +        foreach ($record->getData() as $field => $value) {
144            if ((isset($xml_options["ignore_fields"]) && !in_array($field, $xml_options["ignore_fields"])) || !isset($xml_options["ignore_fields"])) { +            if ((isset($xml_options["ignore_fields"]) && !in_array($field, $xml_options["ignore_fields"])) || !isset($xml_options["ignore_fields"])) {
145                if ($value instanceOf Doctrine_Null) { +                if ($value instanceOf Doctrine_Null) {
146                    $xml->addChild($field); +                    $xml->addChild($field);
147                } else {     +                } else {    
148                    $xml->addChild($field, $value); +                    $xml->addChild($field, $value);
149                } +                }
150            } +            }
151        } +        }
152        if ( ! isset($xml_options["include_relations"])) { +        if ( ! isset($xml_options["include_relations"])) {
153            return $xml->asXML(); +            return $xml->asXML();
154        } +        }
155        $relations = $record->getTable()->getRelations(); +        $relations = $record->getTable()->getRelations();
156        foreach ($relations as $name => $relation) { +        foreach ($relations as $name => $relation) {
157            if (in_array($name, $xml_options["include_relations"])) { +            if (in_array($name, $xml_options["include_relations"])) {
158                $relation_type = $relation->getType(); +                $relation_type = $relation->getType();
159                $related_records = $record->get($name); +                $related_records = $record->get($name);
160                if ($relation_type == Doctrine_Relation::ONE && $related_records instanceOf Doctrine_Record) { +                if ($relation_type == Doctrine_Relation::ONE && $related_records instanceOf Doctrine_Record) {
161                    Doctrine_Lib::getRecordAsXml($related_records, $xml); +                    Doctrine_Lib::getRecordAsXml($related_records, $xml);
162                } else { +                } else {
163                    Doctrine_Lib::getCollectionAsXml($related_records, $xml); +                    Doctrine_Lib::getCollectionAsXml($related_records, $xml);
164                } +                }
165            } +            }
166        } +        }
167        return $xml->asXML(); +        return $xml->asXML();
168    } +    }
169 +
170 +
171    /** +    /**
172     * getStateAsString +     * getStateAsString
173     * returns a given connection state as string +     * returns a given connection state as string
174     * @param integer $state        connection state +     * @param integer $state        connection state
175     */ +     */
176    public static function getConnectionStateAsString($state) +    public static function getConnectionStateAsString($state)
177    { +    {
178        switch ($state) { +        switch ($state) {
179        case Doctrine_Transaction::STATE_SLEEP: +        case Doctrine_Transaction::STATE_SLEEP:
180            return "open"; +            return "open";
181            break; +            break;
182        case Doctrine_Transaction::STATE_BUSY: +        case Doctrine_Transaction::STATE_BUSY:
183            return "busy"; +            return "busy";
184            break; +            break;
185        case Doctrine_Transaction::STATE_ACTIVE: +        case Doctrine_Transaction::STATE_ACTIVE:
186            return "active"; +            return "active";
187            break; +            break;
188        } +        }
189    } +    }
190 +
191    /** +    /**
192     * returns a string representation of Doctrine_Connection object +     * returns a string representation of Doctrine_Connection object
193     * @param Doctrine_Connection $connection +     * @param Doctrine_Connection $connection
194     * @return string +     * @return string
195     */ +     */
196    public static function getConnectionAsString(Doctrine_Connection $connection) +    public static function getConnectionAsString(Doctrine_Connection $connection)
197    { +    {
198        $r[] = '<pre>'; +        $r[] = '<pre>';
199        $r[] = 'Doctrine_Connection object'; +        $r[] = 'Doctrine_Connection object';
200        $r[] = 'State               : ' . Doctrine_Lib::getConnectionStateAsString($connection->transaction->getState()); +        $r[] = 'State               : ' . Doctrine_Lib::getConnectionStateAsString($connection->transaction->getState());
201        $r[] = 'Open Transactions   : ' . $connection->transaction->getTransactionLevel(); +        $r[] = 'Open Transactions   : ' . $connection->transaction->getTransactionLevel();
202        $r[] = 'Table in memory     : ' . $connection->count(); +        $r[] = 'Table in memory     : ' . $connection->count();
203        $r[] = 'Driver name         : ' . $connection->getAttribute(Doctrine::ATTR_DRIVER_NAME); +        $r[] = 'Driver name         : ' . $connection->getAttribute(Doctrine::ATTR_DRIVER_NAME);
204 +
205        $r[] = "</pre>"; +        $r[] = "</pre>";
206        return implode("\n",$r)."<br>"; +        return implode("\n",$r)."<br>";
207    } +    }
208 +
209    /** +    /**
210     * returns a string representation of Doctrine_Table object +     * returns a string representation of Doctrine_Table object
211     * @param Doctrine_Table $table +     * @param Doctrine_Table $table
212     * @return string +     * @return string
213     */ +     */
214    public static function getTableAsString(Doctrine_Table $table) +    public static function getTableAsString(Doctrine_Table $table)
215    { +    {
216        $r[] = "<pre>"; +        $r[] = "<pre>";
217        $r[] = "Component   : ".$table->getComponentName(); +        $r[] = "Component   : ".$table->getComponentName();
218        $r[] = "Table       : ".$table->getTableName(); +        $r[] = "Table       : ".$table->getTableName();
219        $r[] = "</pre>"; +        $r[] = "</pre>";
220        return implode("\n",$r)."<br>"; +        return implode("\n",$r)."<br>";
221    } +    }
222 +
223    /** +    /**
224     * formatSql  +     * formatSql 
225     *  +     * 
226     * @todo: What about creating a config varialbe for the color? +     * @todo: What about creating a config varialbe for the color?
227     * @param mixed $sql  +     * @param mixed $sql 
228     * @return string the formated sql +     * @return string the formated sql
229     */ +     */
230    public static function formatSql($sql) +    public static function formatSql($sql)
231    { +    {
232        $e = explode("\n",$sql); +        $e = explode("\n",$sql);
233        $color = "367FAC"; +        $color = "367FAC";
234        $l = $sql; +        $l = $sql;
235        $l = str_replace("SELECT ", "<font color='$color'><b>SELECT </b></font><br \>  ",$l); +        $l = str_replace("SELECT ", "<font color='$color'><b>SELECT </b></font><br \>  ",$l);
236        $l = str_replace("FROM ", "<font color='$color'><b>FROM </b></font><br \>",$l); +        $l = str_replace("FROM ", "<font color='$color'><b>FROM </b></font><br \>",$l);
237        $l = str_replace(" LEFT JOIN ", "<br \><font color='$color'><b> LEFT JOIN </b></font>",$l); +        $l = str_replace(" LEFT JOIN ", "<br \><font color='$color'><b> LEFT JOIN </b></font>",$l);
238        $l = str_replace(" INNER JOIN ", "<br \><font color='$color'><b> INNER JOIN </b></font>",$l); +        $l = str_replace(" INNER JOIN ", "<br \><font color='$color'><b> INNER JOIN </b></font>",$l);
239        $l = str_replace(" WHERE ", "<br \><font color='$color'><b> WHERE </b></font>",$l); +        $l = str_replace(" WHERE ", "<br \><font color='$color'><b> WHERE </b></font>",$l);
240        $l = str_replace(" GROUP BY ", "<br \><font color='$color'><b> GROUP BY </b></font>",$l); +        $l = str_replace(" GROUP BY ", "<br \><font color='$color'><b> GROUP BY </b></font>",$l);
241        $l = str_replace(" HAVING ", "<br \><font color='$color'><b> HAVING </b></font>",$l); +        $l = str_replace(" HAVING ", "<br \><font color='$color'><b> HAVING </b></font>",$l);
242        $l = str_replace(" AS ", "<font color='$color'><b> AS </b></font><br \>  ",$l); +        $l = str_replace(" AS ", "<font color='$color'><b> AS </b></font><br \>  ",$l);
243        $l = str_replace(" ON ", "<font color='$color'><b> ON </b></font>",$l); +        $l = str_replace(" ON ", "<font color='$color'><b> ON </b></font>",$l);
244        $l = str_replace(" ORDER BY ", "<font color='$color'><b> ORDER BY </b></font><br \>",$l); +        $l = str_replace(" ORDER BY ", "<font color='$color'><b> ORDER BY </b></font><br \>",$l);
245        $l = str_replace(" LIMIT ", "<font color='$color'><b> LIMIT </b></font><br \>",$l); +        $l = str_replace(" LIMIT ", "<font color='$color'><b> LIMIT </b></font><br \>",$l);
246        $l = str_replace(" OFFSET ", "<font color='$color'><b> OFFSET </b></font><br \>",$l); +        $l = str_replace(" OFFSET ", "<font color='$color'><b> OFFSET </b></font><br \>",$l);
247        $l = str_replace("  ", "<dd>",$l); +        $l = str_replace("  ", "<dd>",$l);
248 +
249        return $l; +        return $l;
250    } +    }
251 +
252    /** +    /**
253     * returns a string representation of Doctrine_Collection object +     * returns a string representation of Doctrine_Collection object
254     * @param Doctrine_Collection $collection +     * @param Doctrine_Collection $collection
255     * @return string +     * @return string
256     */ +     */
257    public static function getCollectionAsString(Doctrine_Collection $collection) +    public static function getCollectionAsString(Doctrine_Collection $collection)
258    { +    {
259        $r[] = "<pre>"; +        $r[] = "<pre>";
260        $r[] = get_class($collection); +        $r[] = get_class($collection);
261        $r[] = 'data : ' . Doctrine::dump($collection->getData(), false); +        $r[] = 'data : ' . Doctrine::dump($collection->getData(), false);
262        //$r[] = 'snapshot : ' . Doctrine::dump($collection->getSnapshot()); +        //$r[] = 'snapshot : ' . Doctrine::dump($collection->getSnapshot());
263 +
264        $r[] = "</pre>"; +        $r[] = "</pre>";
265        return implode("\n",$r); +        return implode("\n",$r);
266    } +    }
267} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Manager.html b/tests_old/coverage/Doctrine_Manager.html index a3a5e6eb0..ff50feefb 100644 --- a/tests_old/coverage/Doctrine_Manager.html +++ b/tests_old/coverage/Doctrine_Manager.html @@ -10,2073 +10,2073 @@

Coverage for Doctrine_Manager

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: Manager.php 3223 2007-11-25 19:07:30Z romanb $ + *  $Id: Manager.php 3223 2007-11-25 19:07:30Z romanb $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * + *
24 * Doctrine_Manager is the base component of all doctrine based projects. + * Doctrine_Manager is the base component of all doctrine based projects.
25 * It opens and keeps track of all connections (database connections). + * It opens and keeps track of all connections (database connections).
26 * + *
27 * @package     Doctrine + * @package     Doctrine
28 * @subpackage  Manager + * @subpackage  Manager
29 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31 * @since       1.0 + * @since       1.0
32 * @version     $Revision: 3223 $ + * @version     $Revision: 3223 $
33 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
34 */ + */
35class Doctrine_Manager extends Doctrine_Configurable implements Countable, IteratorAggregate +class Doctrine_Manager extends Doctrine_Configurable implements Countable, IteratorAggregate
36{ +{
37    /** +    /**
38     * @var array $connections          an array containing all the opened connections +     * @var array $connections          an array containing all the opened connections
39     */ +     */
40    protected $_connections   = array(); +    protected $_connections   = array();
41 +
42    /** +    /**
43     * @var array $bound                an array containing all components that have a bound connection +     * @var array $bound                an array containing all components that have a bound connection
44     */ +     */
45    protected $_bound         = array(); +    protected $_bound         = array();
46 +
47    /** +    /**
48     * @var integer $index              the incremented index +     * @var integer $index              the incremented index
49     */ +     */
50    protected $_index         = 0; +    protected $_index         = 0;
51 +
52    /** +    /**
53     * @var integer $currIndex          the current connection index +     * @var integer $currIndex          the current connection index
54     */ +     */
55    protected $_currIndex     = 0; +    protected $_currIndex     = 0;
56 +
57    /** +    /**
58     * @var string $root                root directory +     * @var string $root                root directory
59     */ +     */
60    protected $_root; +    protected $_root;
61 +
62    /** +    /**
63     * @var Doctrine_Query_Registry     the query registry +     * @var Doctrine_Query_Registry     the query registry
64     */ +     */
65    protected $_queryRegistry; +    protected $_queryRegistry;
66     +    
67    protected static $driverMap = array('oci' => 'oracle'); +    protected static $driverMap = array('oci' => 'oracle');
68 +
69    /** +    /**
70     * constructor +     * constructor
71     * +     *
72     * this is private constructor (use getInstance to get an instance of this class) +     * this is private constructor (use getInstance to get an instance of this class)
73     */ +     */
74    private function __construct() +    private function __construct()
75    { +    {
76        $this->_root = dirname(__FILE__); +        $this->_root = dirname(__FILE__);
77 +
78        Doctrine_Locator_Injectable::initNullObject(new Doctrine_Null); +        Doctrine_Locator_Injectable::initNullObject(new Doctrine_Null);
79    } +    }
80 +
81    /** +    /**
82     * setDefaultAttributes +     * setDefaultAttributes
83     * sets default attributes +     * sets default attributes
84     * +     *
85     * @todo I do not understand the flow here. Explain or refactor? +     * @todo I do not understand the flow here. Explain or refactor?
86     * @return boolean +     * @return boolean
87     */ +     */
88    public function setDefaultAttributes() +    public function setDefaultAttributes()
89    { +    {
90        static $init = false; +        static $init = false;
91        if ( ! $init) { +        if ( ! $init) {
92            $init = true; +            $init = true;
93            $attributes = array( +            $attributes = array(
94                        Doctrine::ATTR_CACHE                    => null, +                        Doctrine::ATTR_CACHE                    => null,
95                        Doctrine::ATTR_RESULT_CACHE             => null, +                        Doctrine::ATTR_RESULT_CACHE             => null,
96                        Doctrine::ATTR_QUERY_CACHE              => null, +                        Doctrine::ATTR_QUERY_CACHE              => null,
97                        Doctrine::ATTR_LOAD_REFERENCES          => true, +                        Doctrine::ATTR_LOAD_REFERENCES          => true,
98                        Doctrine::ATTR_LISTENER                 => new Doctrine_EventListener(), +                        Doctrine::ATTR_LISTENER                 => new Doctrine_EventListener(),
99                        Doctrine::ATTR_RECORD_LISTENER          => new Doctrine_Record_Listener(), +                        Doctrine::ATTR_RECORD_LISTENER          => new Doctrine_Record_Listener(),
100                        Doctrine::ATTR_THROW_EXCEPTIONS         => true, +                        Doctrine::ATTR_THROW_EXCEPTIONS         => true,
101                        Doctrine::ATTR_VALIDATE                 => Doctrine::VALIDATE_NONE, +                        Doctrine::ATTR_VALIDATE                 => Doctrine::VALIDATE_NONE,
102                        Doctrine::ATTR_QUERY_LIMIT              => Doctrine::LIMIT_RECORDS, +                        Doctrine::ATTR_QUERY_LIMIT              => Doctrine::LIMIT_RECORDS,
103                        Doctrine::ATTR_IDXNAME_FORMAT           => "%s_idx", +                        Doctrine::ATTR_IDXNAME_FORMAT           => "%s_idx",
104                        Doctrine::ATTR_SEQNAME_FORMAT           => "%s_seq", +                        Doctrine::ATTR_SEQNAME_FORMAT           => "%s_seq",
105                        Doctrine::ATTR_TBLNAME_FORMAT           => "%s", +                        Doctrine::ATTR_TBLNAME_FORMAT           => "%s",
106                        Doctrine::ATTR_QUOTE_IDENTIFIER         => false, +                        Doctrine::ATTR_QUOTE_IDENTIFIER         => false,
107                        Doctrine::ATTR_SEQCOL_NAME              => 'id', +                        Doctrine::ATTR_SEQCOL_NAME              => 'id',
108                        Doctrine::ATTR_PORTABILITY              => Doctrine::PORTABILITY_ALL, +                        Doctrine::ATTR_PORTABILITY              => Doctrine::PORTABILITY_ALL,
109                        Doctrine::ATTR_EXPORT                   => Doctrine::EXPORT_ALL, +                        Doctrine::ATTR_EXPORT                   => Doctrine::EXPORT_ALL,
110                        Doctrine::ATTR_DECIMAL_PLACES           => 2, +                        Doctrine::ATTR_DECIMAL_PLACES           => 2,
111                        Doctrine::ATTR_DEFAULT_PARAM_NAMESPACE  => 'doctrine', +                        Doctrine::ATTR_DEFAULT_PARAM_NAMESPACE  => 'doctrine',
112                        );  +                        ); 
113            foreach ($attributes as $attribute => $value) { +            foreach ($attributes as $attribute => $value) {
114                $old = $this->getAttribute($attribute); +                $old = $this->getAttribute($attribute);
115                if ($old === null) { +                if ($old === null) {
116                    $this->setAttribute($attribute,$value); +                    $this->setAttribute($attribute,$value);
117                } +                }
118            } +            }
119            return true; +            return true;
120        } +        }
121        return false; +        return false;
122    } +    }
123 +
124    /** +    /**
125     * returns the root directory of Doctrine +     * returns the root directory of Doctrine
126     * +     *
127     * @return string +     * @return string
128     */ +     */
129    final public function getRoot() +    final public function getRoot()
130    { +    {
131        return $this->_root; +        return $this->_root;
132    } +    }
133 +
134    /** +    /**
135     * getInstance +     * getInstance
136     * returns an instance of this class +     * returns an instance of this class
137     * (this class uses the singleton pattern) +     * (this class uses the singleton pattern)
138     * +     *
139     * @return Doctrine_Manager +     * @return Doctrine_Manager
140     */ +     */
141    public static function getInstance() +    public static function getInstance()
142    { +    {
143        static $instance; +        static $instance;
144        if ( ! isset($instance)) { +        if ( ! isset($instance)) {
145            $instance = new self(); +            $instance = new self();
146        } +        }
147        return $instance; +        return $instance;
148    } +    }
149 +
150    /** +    /**
151     * getQueryRegistry +     * getQueryRegistry
152     * lazy-initializes the query registry object and returns it +     * lazy-initializes the query registry object and returns it
153     * +     *
154     * @return Doctrine_Query_Registry +     * @return Doctrine_Query_Registry
155     */ +     */
156    public function getQueryRegistry() +    public function getQueryRegistry()
157    { +    {
158     if ( ! isset($this->_queryRegistry)) { +     if ( ! isset($this->_queryRegistry)) {
159        $this->_queryRegistry = new Doctrine_Query_Registry; +        $this->_queryRegistry = new Doctrine_Query_Registry;
160     } +     }
161        return $this->_queryRegistry; +        return $this->_queryRegistry;
162    } +    }
163 +
164    /** +    /**
165     * setQueryRegistry +     * setQueryRegistry
166     * sets the query registry +     * sets the query registry
167     * +     *
168     * @return Doctrine_Manager     this object +     * @return Doctrine_Manager     this object
169     */ +     */
170    public function setQueryRegistry(Doctrine_Query_Registry $registry) +    public function setQueryRegistry(Doctrine_Query_Registry $registry)
171    { +    {
172        $this->_queryRegistry = $registry; +        $this->_queryRegistry = $registry;
173         +        
174        return $this; +        return $this;
175    } +    }
176 +
177    /** +    /**
178     * fetch +     * fetch
179     * fetches data using the provided queryKey and  +     * fetches data using the provided queryKey and 
180     * the associated query in the query registry +     * the associated query in the query registry
181     * +     *
182     * if no query for given queryKey is being found a  +     * if no query for given queryKey is being found a 
183     * Doctrine_Query_Registry exception is being thrown +     * Doctrine_Query_Registry exception is being thrown
184     * +     *
185     * @param string $queryKey      the query key +     * @param string $queryKey      the query key
186     * @param array $params         prepared statement params (if any) +     * @param array $params         prepared statement params (if any)
187     * @return mixed                the fetched data +     * @return mixed                the fetched data
188     */ +     */
189    public function find($queryKey, $params = array(), $hydrationMode = Doctrine::HYDRATE_RECORD) +    public function find($queryKey, $params = array(), $hydrationMode = Doctrine::HYDRATE_RECORD)
190    { +    {
191        return Doctrine_Manager::getInstance() +        return Doctrine_Manager::getInstance()
192                            ->getQueryRegistry() +                            ->getQueryRegistry()
193                            ->get($queryKey) +                            ->get($queryKey)
194                            ->execute($params, $hydrationMode); +                            ->execute($params, $hydrationMode);
195    } +    }
196 +
197    /** +    /**
198     * fetchOne +     * fetchOne
199     * fetches data using the provided queryKey and  +     * fetches data using the provided queryKey and 
200     * the associated query in the query registry +     * the associated query in the query registry
201     * +     *
202     * if no query for given queryKey is being found a  +     * if no query for given queryKey is being found a 
203     * Doctrine_Query_Registry exception is being thrown +     * Doctrine_Query_Registry exception is being thrown
204     * +     *
205     * @param string $queryKey      the query key +     * @param string $queryKey      the query key
206     * @param array $params         prepared statement params (if any) +     * @param array $params         prepared statement params (if any)
207     * @return mixed                the fetched data +     * @return mixed                the fetched data
208     */ +     */
209    public function findOne($queryKey, $params = array(), $hydrationMode = Doctrine::HYDRATE_RECORD) +    public function findOne($queryKey, $params = array(), $hydrationMode = Doctrine::HYDRATE_RECORD)
210    { +    {
211        return Doctrine_Manager::getInstance() +        return Doctrine_Manager::getInstance()
212                            ->getQueryRegistry() +                            ->getQueryRegistry()
213                            ->get($queryKey) +                            ->get($queryKey)
214                            ->fetchOne($params, $hydrationMode); +                            ->fetchOne($params, $hydrationMode);
215    } +    }
216 +
217    /** +    /**
218     * connection +     * connection
219     * +     *
220     * if the adapter parameter is set this method acts as +     * if the adapter parameter is set this method acts as
221     * a short cut for Doctrine_Manager::getInstance()->openConnection($adapter, $name); +     * a short cut for Doctrine_Manager::getInstance()->openConnection($adapter, $name);
222     * +     *
223     * if the adapter paramater is not set this method acts as +     * if the adapter paramater is not set this method acts as
224     * a short cut for Doctrine_Manager::getInstance()->getCurrentConnection() +     * a short cut for Doctrine_Manager::getInstance()->getCurrentConnection()
225     * +     *
226     * @param PDO|Doctrine_Adapter_Interface $adapter   database driver +     * @param PDO|Doctrine_Adapter_Interface $adapter   database driver
227     * @param string $name                              name of the connection, if empty numeric key is used +     * @param string $name                              name of the connection, if empty numeric key is used
228     * @throws Doctrine_Manager_Exception               if trying to bind a connection with an existing name +     * @throws Doctrine_Manager_Exception               if trying to bind a connection with an existing name
229     * @return Doctrine_Connection +     * @return Doctrine_Connection
230     */ +     */
231    public static function connection($adapter = null, $name = null) +    public static function connection($adapter = null, $name = null)
232    { +    {
233        if ($adapter == null) { +        if ($adapter == null) {
234            return Doctrine_Manager::getInstance()->getCurrentConnection(); +            return Doctrine_Manager::getInstance()->getCurrentConnection();
235        } else { +        } else {
236            return Doctrine_Manager::getInstance()->openConnection($adapter, $name); +            return Doctrine_Manager::getInstance()->openConnection($adapter, $name);
237        } +        }
238    } +    }
239 +
240    /** +    /**
241     * openConnection +     * openConnection
242     * opens a new connection and saves it to Doctrine_Manager->connections +     * opens a new connection and saves it to Doctrine_Manager->connections
243     * +     *
244     * @param PDO|Doctrine_Adapter_Interface $adapter   database driver +     * @param PDO|Doctrine_Adapter_Interface $adapter   database driver
245     * @param string $name                              name of the connection, if empty numeric key is used +     * @param string $name                              name of the connection, if empty numeric key is used
246     * @throws Doctrine_Manager_Exception               if trying to bind a connection with an existing name +     * @throws Doctrine_Manager_Exception               if trying to bind a connection with an existing name
247     * @throws Doctrine_Manager_Exception               if trying to open connection for unknown driver +     * @throws Doctrine_Manager_Exception               if trying to open connection for unknown driver
248     * @return Doctrine_Connection +     * @return Doctrine_Connection
249     */ +     */
250    public function openConnection($adapter, $name = null, $setCurrent = true) +    public function openConnection($adapter, $name = null, $setCurrent = true)
251    { +    {
252        if (is_object($adapter)) { +        if (is_object($adapter)) {
253            if ( ! ($adapter instanceof PDO) && ! in_array('Doctrine_Adapter_Interface', class_implements($adapter))) { +            if ( ! ($adapter instanceof PDO) && ! in_array('Doctrine_Adapter_Interface', class_implements($adapter))) {
254                throw new Doctrine_Manager_Exception("First argument should be an instance of PDO or implement Doctrine_Adapter_Interface"); +                throw new Doctrine_Manager_Exception("First argument should be an instance of PDO or implement Doctrine_Adapter_Interface");
255            } +            }
256 +
257            $driverName = $adapter->getAttribute(Doctrine::ATTR_DRIVER_NAME); +            $driverName = $adapter->getAttribute(Doctrine::ATTR_DRIVER_NAME);
258        } elseif (is_array($adapter)) { +        } elseif (is_array($adapter)) {
259            if ( ! isset($adapter[0])) { +            if ( ! isset($adapter[0])) {
260                throw new Doctrine_Manager_Exception('Empty data source name given.'); +                throw new Doctrine_Manager_Exception('Empty data source name given.');
261            } +            }
262            $e = explode(':', $adapter[0]); +            $e = explode(':', $adapter[0]);
263 +
264            if ($e[0] == 'uri') { +            if ($e[0] == 'uri') {
265                $e[0] = 'odbc'; +                $e[0] = 'odbc';
266            } +            }
267 +
268            $parts['dsn']    = $adapter[0]; +            $parts['dsn']    = $adapter[0];
269            $parts['scheme'] = $e[0]; +            $parts['scheme'] = $e[0];
270            $parts['user']   = (isset($adapter[1])) ? $adapter[1] : null; +            $parts['user']   = (isset($adapter[1])) ? $adapter[1] : null;
271            $parts['pass']   = (isset($adapter[2])) ? $adapter[2] : null; +            $parts['pass']   = (isset($adapter[2])) ? $adapter[2] : null;
272             +            
273            $driverName = $e[0]; +            $driverName = $e[0];
274            $adapter = $parts; +            $adapter = $parts;
275        } else { +        } else {
276            $parts = $this->parseDsn($adapter); +            $parts = $this->parseDsn($adapter);
277             +            
278            $driverName = $parts['scheme']; +            $driverName = $parts['scheme'];
279             +            
280            $adapter = $parts; +            $adapter = $parts;
281        } +        }
282 +
283        // initialize the default attributes +        // initialize the default attributes
284        $this->setDefaultAttributes(); +        $this->setDefaultAttributes();
285 +
286        if ($name !== null) { +        if ($name !== null) {
287            $name = (string) $name; +            $name = (string) $name;
288            if (isset($this->_connections[$name])) { +            if (isset($this->_connections[$name])) {
289                return $this->_connections[$name]; +                return $this->_connections[$name];
290            } +            }
291        } else { +        } else {
292            $name = $this->_index; +            $name = $this->_index;
293            $this->_index++; +            $this->_index++;
294        } +        }
295 +
296 +
297        $drivers = array('mysql'    => 'Doctrine_Connection_Mysql', +        $drivers = array('mysql'    => 'Doctrine_Connection_Mysql',
298                         'sqlite'   => 'Doctrine_Connection_Sqlite', +                         'sqlite'   => 'Doctrine_Connection_Sqlite',
299                         'pgsql'    => 'Doctrine_Connection_Pgsql', +                         'pgsql'    => 'Doctrine_Connection_Pgsql',
300                         'oci'      => 'Doctrine_Connection_Oracle', +                         'oci'      => 'Doctrine_Connection_Oracle',
301                         'oci8'     => 'Doctrine_Connection_Oracle', +                         'oci8'     => 'Doctrine_Connection_Oracle',
302                         'oracle'   => 'Doctrine_Connection_Oracle', +                         'oracle'   => 'Doctrine_Connection_Oracle',
303                         'mssql'    => 'Doctrine_Connection_Mssql', +                         'mssql'    => 'Doctrine_Connection_Mssql',
304                         'dblib'    => 'Doctrine_Connection_Mssql', +                         'dblib'    => 'Doctrine_Connection_Mssql',
305                         'firebird' => 'Doctrine_Connection_Firebird', +                         'firebird' => 'Doctrine_Connection_Firebird',
306                         'informix' => 'Doctrine_Connection_Informix', +                         'informix' => 'Doctrine_Connection_Informix',
307                         'mock'     => 'Doctrine_Connection_Mock'); +                         'mock'     => 'Doctrine_Connection_Mock');
308        if ( ! isset($drivers[$driverName])) { +        if ( ! isset($drivers[$driverName])) {
309            throw new Doctrine_Manager_Exception('Unknown driver ' . $driverName); +            throw new Doctrine_Manager_Exception('Unknown driver ' . $driverName);
310        } +        }
311         +        
312        $className = $drivers[$driverName]; +        $className = $drivers[$driverName];
313        $conn = new $className($this, $adapter); +        $conn = new $className($this, $adapter);
314 +
315        $this->_connections[$name] = $conn; +        $this->_connections[$name] = $conn;
316 +
317        if ($setCurrent) { +        if ($setCurrent) {
318            $this->_currIndex = $name; +            $this->_currIndex = $name;
319        } +        }
320        return $this->_connections[$name]; +        return $this->_connections[$name];
321    } +    }
322     +    
323    /** +    /**
324     * parsePdoDsn  +     * parsePdoDsn 
325     *  +     * 
326     * @param array $dsn An array of dsn information  +     * @param array $dsn An array of dsn information 
327     * @return array The array parsed +     * @return array The array parsed
328     */ +     */
329    public function parsePdoDsn($dsn) +    public function parsePdoDsn($dsn)
330    { +    {
331        $parts = array(); +        $parts = array();
332         +        
333        $names = array('dsn', 'scheme', 'host', 'port', 'user', 'pass', 'path', 'query', 'fragment'); +        $names = array('dsn', 'scheme', 'host', 'port', 'user', 'pass', 'path', 'query', 'fragment');
334 +
335        foreach ($names as $name) { +        foreach ($names as $name) {
336            if ( ! isset($parts[$name])) { +            if ( ! isset($parts[$name])) {
337                $parts[$name] = null; +                $parts[$name] = null;
338            } +            }
339        } +        }
340         +        
341        $e = explode(':', $dsn); +        $e = explode(':', $dsn);
342        $parts['scheme'] = $e[0]; +        $parts['scheme'] = $e[0];
343        $parts['dsn'] = $dsn; +        $parts['dsn'] = $dsn;
344         +        
345        $e = explode(';', $e[1]); +        $e = explode(';', $e[1]);
346        foreach ($e as $string) { +        foreach ($e as $string) {
347            list($key, $value) = explode('=', $string); +            list($key, $value) = explode('=', $string);
348            $parts[$key] = $value; +            $parts[$key] = $value;
349        } +        }
350         +        
351        return $parts; +        return $parts;
352    } +    }
353 +
354    /** +    /**
355     * parseDsn +     * parseDsn
356     * +     *
357     * @param string $dsn +     * @param string $dsn
358     * @return array Parsed contents of DSN +     * @return array Parsed contents of DSN
359     */ +     */
360    public function parseDsn($dsn) +    public function parseDsn($dsn)
361    { +    {
362 +
363 +
364        //fix linux sqlite dsn so that it will parse correctly +        //fix linux sqlite dsn so that it will parse correctly
365        $dsn = str_replace("///", "/", $dsn); +        $dsn = str_replace("///", "/", $dsn);
366 +
367        // silence any warnings +        // silence any warnings
368        $parts = @parse_url($dsn); +        $parts = @parse_url($dsn);
369 +
370        $names = array('dsn', 'scheme', 'host', 'port', 'user', 'pass', 'path', 'query', 'fragment'); +        $names = array('dsn', 'scheme', 'host', 'port', 'user', 'pass', 'path', 'query', 'fragment');
371 +
372        foreach ($names as $name) { +        foreach ($names as $name) {
373            if ( ! isset($parts[$name])) { +            if ( ! isset($parts[$name])) {
374                $parts[$name] = null; +                $parts[$name] = null;
375            } +            }
376        } +        }
377 +
378        if (count($parts) == 0 || ! isset($parts['scheme'])) { +        if (count($parts) == 0 || ! isset($parts['scheme'])) {
379            throw new Doctrine_Manager_Exception('Empty data source name'); +            throw new Doctrine_Manager_Exception('Empty data source name');
380        } +        }
381 +
382        switch ($parts['scheme']) { +        switch ($parts['scheme']) {
383            case 'sqlite': +            case 'sqlite':
384            case 'sqlite2': +            case 'sqlite2':
385            case 'sqlite3': +            case 'sqlite3':
386                if (isset($parts['host']) && $parts['host'] == ':memory') { +                if (isset($parts['host']) && $parts['host'] == ':memory') {
387                    $parts['database'] = ':memory:'; +                    $parts['database'] = ':memory:';
388                    $parts['dsn']      = 'sqlite::memory:'; +                    $parts['dsn']      = 'sqlite::memory:';
389                } else { +                } else {
390                    //fix windows dsn we have to add host: to path and set host to null +                    //fix windows dsn we have to add host: to path and set host to null
391                    if (isset($parts['host'])) { +                    if (isset($parts['host'])) {
392                        $parts['path'] = $parts['host'] . ":" . $parts["path"]; +                        $parts['path'] = $parts['host'] . ":" . $parts["path"];
393                        $parts["host"] = null; +                        $parts["host"] = null;
394                    } +                    }
395                    $parts['database'] = $parts['path']; +                    $parts['database'] = $parts['path'];
396                    $parts['dsn'] = $parts['scheme'] . ':' . $parts['path']; +                    $parts['dsn'] = $parts['scheme'] . ':' . $parts['path'];
397                } +                }
398 +
399                break; +                break;
400             +            
401            case 'mssql': +            case 'mssql':
402            case 'dblib': +            case 'dblib':
403                if ( ! isset($parts['path']) || $parts['path'] == '/') { +                if ( ! isset($parts['path']) || $parts['path'] == '/') {
404                    throw new Doctrine_Manager_Exception('No database available in data source name'); +                    throw new Doctrine_Manager_Exception('No database available in data source name');
405                } +                }
406                if (isset($parts['path'])) { +                if (isset($parts['path'])) {
407                    $parts['database'] = substr($parts['path'], 1); +                    $parts['database'] = substr($parts['path'], 1);
408                } +                }
409                if ( ! isset($parts['host'])) { +                if ( ! isset($parts['host'])) {
410                    throw new Doctrine_Manager_Exception('No hostname set in data source name'); +                    throw new Doctrine_Manager_Exception('No hostname set in data source name');
411                } +                }
412                 +                
413                if (isset(self::$driverMap[$parts['scheme']])) { +                if (isset(self::$driverMap[$parts['scheme']])) {
414                    $parts['scheme'] = self::$driverMap[$parts['scheme']]; +                    $parts['scheme'] = self::$driverMap[$parts['scheme']];
415                } +                }
416 +
417                $parts['dsn'] = $parts['scheme'] . ':host=' +                $parts['dsn'] = $parts['scheme'] . ':host='
418                              . $parts['host'] . (isset($parts['port']) ? ':' . $parts['port']:null) . ';dbname=' +                              . $parts['host'] . (isset($parts['port']) ? ':' . $parts['port']:null) . ';dbname='
419                              . $parts['database']; +                              . $parts['database'];
420                 +                
421                break; +                break;
422 +
423            case 'mysql': +            case 'mysql':
424            case 'informix': +            case 'informix':
425            case 'oci8': +            case 'oci8':
426            case 'oci': +            case 'oci':
427            case 'firebird': +            case 'firebird':
428            case 'pgsql': +            case 'pgsql':
429            case 'odbc': +            case 'odbc':
430            case 'mock': +            case 'mock':
431            case 'oracle': +            case 'oracle':
432                if ( ! isset($parts['path']) || $parts['path'] == '/') { +                if ( ! isset($parts['path']) || $parts['path'] == '/') {
433                    throw new Doctrine_Manager_Exception('No database available in data source name'); +                    throw new Doctrine_Manager_Exception('No database available in data source name');
434                } +                }
435                if (isset($parts['path'])) { +                if (isset($parts['path'])) {
436                    $parts['database'] = substr($parts['path'], 1); +                    $parts['database'] = substr($parts['path'], 1);
437                } +                }
438                if ( ! isset($parts['host'])) { +                if ( ! isset($parts['host'])) {
439                    throw new Doctrine_Manager_Exception('No hostname set in data source name'); +                    throw new Doctrine_Manager_Exception('No hostname set in data source name');
440                } +                }
441                 +                
442                if (isset(self::$driverMap[$parts['scheme']])) { +                if (isset(self::$driverMap[$parts['scheme']])) {
443                    $parts['scheme'] = self::$driverMap[$parts['scheme']]; +                    $parts['scheme'] = self::$driverMap[$parts['scheme']];
444                } +                }
445 +
446                $parts['dsn'] = $parts['scheme'] . ':host=' +                $parts['dsn'] = $parts['scheme'] . ':host='
447                              . $parts['host'] . (isset($parts['port']) ? ';port=' . $parts['port']:null) . ';dbname=' +                              . $parts['host'] . (isset($parts['port']) ? ';port=' . $parts['port']:null) . ';dbname='
448                              . $parts['database']; +                              . $parts['database'];
449                 +                
450                break; +                break;
451            default: +            default:
452                throw new Doctrine_Manager_Exception('Unknown driver '.$parts['scheme']); +                throw new Doctrine_Manager_Exception('Unknown driver '.$parts['scheme']);
453        } +        }
454 +
455 +
456        return $parts; +        return $parts;
457    } +    }
458 +
459    /** +    /**
460     * getConnection +     * getConnection
461     * @param integer $index +     * @param integer $index
462     * @return object Doctrine_Connection +     * @return object Doctrine_Connection
463     * @throws Doctrine_Manager_Exception   if trying to get a non-existent connection +     * @throws Doctrine_Manager_Exception   if trying to get a non-existent connection
464     */ +     */
465    public function getConnection($name) +    public function getConnection($name)
466    { +    {
467        if ( ! isset($this->_connections[$name])) { +        if ( ! isset($this->_connections[$name])) {
468            throw new Doctrine_Manager_Exception('Unknown connection: ' . $name); +            throw new Doctrine_Manager_Exception('Unknown connection: ' . $name);
469        } +        }
470 +
471        return $this->_connections[$name]; +        return $this->_connections[$name];
472    } +    }
473 +
474    /** +    /**
475     * getComponentAlias +     * getComponentAlias
476     * retrieves the alias for given component name +     * retrieves the alias for given component name
477     * if the alias couldn't be found, this method returns the given +     * if the alias couldn't be found, this method returns the given
478     * component name +     * component name
479     * +     *
480     * @param string $componentName +     * @param string $componentName
481     * @return string                   the component alias +     * @return string                   the component alias
482     */ +     */
483    public function getComponentAlias($componentName) +    public function getComponentAlias($componentName)
484    { +    {
485        if (isset($this->componentAliases[$componentName])) { +        if (isset($this->componentAliases[$componentName])) {
486            return $this->componentAliases[$componentName]; +            return $this->componentAliases[$componentName];
487        } +        }
488 +
489        return $componentName; +        return $componentName;
490    } +    }
491 +
492    /** +    /**
493     * sets an alias for given component name +     * sets an alias for given component name
494     * very useful when building a large framework with a possibility +     * very useful when building a large framework with a possibility
495     * to override any given class +     * to override any given class
496     * +     *
497     * @param string $componentName         the name of the component +     * @param string $componentName         the name of the component
498     * @param string $alias +     * @param string $alias
499     * @return Doctrine_Manager +     * @return Doctrine_Manager
500     */ +     */
501    public function setComponentAlias($componentName, $alias) +    public function setComponentAlias($componentName, $alias)
502    { +    {
503        $this->componentAliases[$componentName] = $alias; +        $this->componentAliases[$componentName] = $alias;
504 +
505        return $this; +        return $this;
506    } +    }
507 +
508    /** +    /**
509     * getConnectionName +     * getConnectionName
510     * +     *
511     * @param Doctrine_Connection $conn     connection object to be searched for +     * @param Doctrine_Connection $conn     connection object to be searched for
512     * @return string                       the name of the connection +     * @return string                       the name of the connection
513     */ +     */
514    public function getConnectionName(Doctrine_Connection $conn) +    public function getConnectionName(Doctrine_Connection $conn)
515    { +    {
516        return array_search($conn, $this->_connections, true); +        return array_search($conn, $this->_connections, true);
517    } +    }
518 +
519    /** +    /**
520     * bindComponent +     * bindComponent
521     * binds given component to given connection +     * binds given component to given connection
522     * this means that when ever the given component uses a connection +     * this means that when ever the given component uses a connection
523     * it will be using the bound connection instead of the current connection +     * it will be using the bound connection instead of the current connection
524     * +     *
525     * @param string $componentName +     * @param string $componentName
526     * @param string $connectionName +     * @param string $connectionName
527     * @return boolean +     * @return boolean
528     */ +     */
529    public function bindComponent($componentName, $connectionName) +    public function bindComponent($componentName, $connectionName)
530    { +    {
531        $this->_bound[$componentName] = $connectionName; +        $this->_bound[$componentName] = $connectionName;
532    } +    }
533 +
534    /** +    /**
535     * getConnectionForComponent +     * getConnectionForComponent
536     * +     *
537     * @param string $componentName +     * @param string $componentName
538     * @return Doctrine_Connection +     * @return Doctrine_Connection
539     */ +     */
540    public function getConnectionForComponent($componentName = null) +    public function getConnectionForComponent($componentName = null)
541    { +    {
542        if (isset($this->_bound[$componentName])) { +        if (isset($this->_bound[$componentName])) {
543            return $this->getConnection($this->_bound[$componentName]); +            return $this->getConnection($this->_bound[$componentName]);
544        } +        }
545        return $this->getCurrentConnection(); +        return $this->getCurrentConnection();
546    } +    }
547 +
548    /** +    /**
549     * getTable +     * getTable
550     * this is the same as Doctrine_Connection::getTable() except +     * this is the same as Doctrine_Connection::getTable() except
551     * that it works seamlessly in multi-server/connection environment +     * that it works seamlessly in multi-server/connection environment
552     * +     *
553     * @see Doctrine_Connection::getTable() +     * @see Doctrine_Connection::getTable()
554     * @param string $componentName +     * @param string $componentName
555     * @return Doctrine_Table +     * @return Doctrine_Table
556     */ +     */
557    public function getTable($componentName) +    public function getTable($componentName)
558    { +    {
559        return $this->getConnectionForComponent($componentName)->getTable($componentName); +        return $this->getConnectionForComponent($componentName)->getTable($componentName);
560    } +    }
561 +
562    /** +    /**
563     * table +     * table
564     * this is the same as Doctrine_Connection::getTable() except +     * this is the same as Doctrine_Connection::getTable() except
565     * that it works seamlessly in multi-server/connection environment +     * that it works seamlessly in multi-server/connection environment
566     * +     *
567     * @see Doctrine_Connection::getTable() +     * @see Doctrine_Connection::getTable()
568     * @param string $componentName +     * @param string $componentName
569     * @return Doctrine_Table +     * @return Doctrine_Table
570     */ +     */
571    public static function table($componentName) +    public static function table($componentName)
572    { +    {
573        return Doctrine_Manager::getInstance() +        return Doctrine_Manager::getInstance()
574               ->getConnectionForComponent($componentName) +               ->getConnectionForComponent($componentName)
575               ->getTable($componentName); +               ->getTable($componentName);
576    } +    }
577 +
578    /** +    /**
579     * closes the connection +     * closes the connection
580     * +     *
581     * @param Doctrine_Connection $connection +     * @param Doctrine_Connection $connection
582     * @return void +     * @return void
583     */ +     */
584    public function closeConnection(Doctrine_Connection $connection) +    public function closeConnection(Doctrine_Connection $connection)
585    { +    {
586        $connection->close(); +        $connection->close();
587 +
588        $key = array_search($connection, $this->_connections, true); +        $key = array_search($connection, $this->_connections, true);
589 +
590        if ($key !== false) { +        if ($key !== false) {
591            unset($this->_connections[$key]); +            unset($this->_connections[$key]);
592        } +        }
593        $this->_currIndex = key($this->_connections); +        $this->_currIndex = key($this->_connections);
594 +
595        unset($connection); +        unset($connection);
596    } +    }
597 +
598    /** +    /**
599     * getConnections +     * getConnections
600     * returns all opened connections +     * returns all opened connections
601     * +     *
602     * @return array +     * @return array
603     */ +     */
604    public function getConnections() +    public function getConnections()
605    { +    {
606        return $this->_connections; +        return $this->_connections;
607    } +    }
608 +
609    /** +    /**
610     * setCurrentConnection +     * setCurrentConnection
611     * sets the current connection to $key +     * sets the current connection to $key
612     * +     *
613     * @param mixed $key                        the connection key +     * @param mixed $key                        the connection key
614     * @throws InvalidKeyException +     * @throws InvalidKeyException
615     * @return void +     * @return void
616     */ +     */
617    public function setCurrentConnection($key) +    public function setCurrentConnection($key)
618    { +    {
619        $key = (string) $key; +        $key = (string) $key;
620        if ( ! isset($this->_connections[$key])) { +        if ( ! isset($this->_connections[$key])) {
621            throw new InvalidKeyException(); +            throw new InvalidKeyException();
622        } +        }
623        $this->_currIndex = $key; +        $this->_currIndex = $key;
624    } +    }
625 +
626    /** +    /**
627     * contains +     * contains
628     * whether or not the manager contains specified connection +     * whether or not the manager contains specified connection
629     * +     *
630     * @param mixed $key                        the connection key +     * @param mixed $key                        the connection key
631     * @return boolean +     * @return boolean
632     */ +     */
633    public function contains($key) +    public function contains($key)
634    { +    {
635        return isset($this->_connections[$key]); +        return isset($this->_connections[$key]);
636    } +    }
637 +
638    /** +    /**
639     * count +     * count
640     * returns the number of opened connections +     * returns the number of opened connections
641     * +     *
642     * @return integer +     * @return integer
643     */ +     */
644    public function count() +    public function count()
645    { +    {
646        return count($this->_connections); +        return count($this->_connections);
647    } +    }
648 +
649    /** +    /**
650     * getIterator +     * getIterator
651     * returns an ArrayIterator that iterates through all connections +     * returns an ArrayIterator that iterates through all connections
652     * +     *
653     * @return ArrayIterator +     * @return ArrayIterator
654     */ +     */
655    public function getIterator() +    public function getIterator()
656    { +    {
657        return new ArrayIterator($this->_connections); +        return new ArrayIterator($this->_connections);
658    } +    }
659 +
660    /** +    /**
661     * getCurrentConnection +     * getCurrentConnection
662     * returns the current connection +     * returns the current connection
663     * +     *
664     * @throws Doctrine_Connection_Exception       if there are no open connections +     * @throws Doctrine_Connection_Exception       if there are no open connections
665     * @return Doctrine_Connection +     * @return Doctrine_Connection
666     */ +     */
667    public function getCurrentConnection() +    public function getCurrentConnection()
668    { +    {
669        $i = $this->_currIndex; +        $i = $this->_currIndex;
670        if ( ! isset($this->_connections[$i])) { +        if ( ! isset($this->_connections[$i])) {
671            throw new Doctrine_Connection_Exception(); +            throw new Doctrine_Connection_Exception();
672        } +        }
673        return $this->_connections[$i]; +        return $this->_connections[$i];
674    } +    }
675 +
676    /** +    /**
677     * __toString +     * __toString
678     * returns a string representation of this object +     * returns a string representation of this object
679     * +     *
680     * @return string +     * @return string
681     */ +     */
682    public function __toString() +    public function __toString()
683    { +    {
684        $r[] = "<pre>"; +        $r[] = "<pre>";
685        $r[] = "Doctrine_Manager"; +        $r[] = "Doctrine_Manager";
686        $r[] = "Connections : ".count($this->_connections); +        $r[] = "Connections : ".count($this->_connections);
687        $r[] = "</pre>"; +        $r[] = "</pre>";
688        return implode("\n",$r); +        return implode("\n",$r);
689    } +    }
690} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Manager_Exception.html b/tests_old/coverage/Doctrine_Manager_Exception.html index e8577e7eb..7b98c6776 100644 --- a/tests_old/coverage/Doctrine_Manager_Exception.html +++ b/tests_old/coverage/Doctrine_Manager_Exception.html @@ -10,103 +10,103 @@

Coverage for Doctrine_Manager_Exception

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Migration.html b/tests_old/coverage/Doctrine_Migration.html index b127e9de2..a77cdbf48 100644 --- a/tests_old/coverage/Doctrine_Migration.html +++ b/tests_old/coverage/Doctrine_Migration.html @@ -64,7 +64,7 @@ - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: Exception.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Exception.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Manager_Exception + * Doctrine_Manager_Exception
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Manager + * @subpackage  Manager
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Manager_Exception extends Doctrine_Exception +class Doctrine_Manager_Exception extends Doctrine_Exception
34 { }
 * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -97,7 +97,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Migration_Process.html b/tests_old/coverage/Doctrine_Migration_Process.html index df9b6c974..0bdd4c455 100755 --- a/tests_old/coverage/Doctrine_Migration_Process.html +++ b/tests_old/coverage/Doctrine_Migration_Process.html @@ -64,7 +64,7 @@  * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -91,7 +91,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29  * @since       1.0 @@ -364,25 +364,25 @@         foreach ($columns as $column) {
119            $conn = $this->getConnection($column['tableName']); +            $conn = $this->getConnection($column['tableName']);
120             +            
121            $columnList = $conn->import->listTableColumns($column['tableName']); +            $columnList = $conn->import->listTableColumns($column['tableName']);
122            if (isset($columnList[$column['oldColumnName']])) { +            if (isset($columnList[$column['oldColumnName']])) {
123             $conn->export->alterTable($column['tableName'],  +             $conn->export->alterTable($column['tableName'], 
124                                       array('rename' => array($column['oldColumnName'] => array('name' => $column['newColumnName'], +                                       array('rename' => array($column['oldColumnName'] => array('name' => $column['newColumnName'],
125                                        'definition'=>$columnList[$column['oldColumnName']])))); +                                        'definition'=>$columnList[$column['oldColumnName']]))));
126             } diff --git a/tests_old/coverage/Doctrine_Node.html b/tests_old/coverage/Doctrine_Node.html index 2b920e941..c2e56e389 100644 --- a/tests_old/coverage/Doctrine_Node.html +++ b/tests_old/coverage/Doctrine_Node.html @@ -64,7 +64,7 @@  * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -91,7 +91,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Node_NestedSet.html b/tests_old/coverage/Doctrine_Node_NestedSet.html index 32acdddbb..cfa83898c 100644 --- a/tests_old/coverage/Doctrine_Node_NestedSet.html +++ b/tests_old/coverage/Doctrine_Node_NestedSet.html @@ -64,7 +64,7 @@  * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -91,7 +91,7 @@  * @license    http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link       www.phpdoctrine.com + * @link       www.phpdoctrine.org
29  * @since      1.0 diff --git a/tests_old/coverage/Doctrine_Null.html b/tests_old/coverage/Doctrine_Null.html index c14c7ccc2..9583d2104 100644 --- a/tests_old/coverage/Doctrine_Null.html +++ b/tests_old/coverage/Doctrine_Null.html @@ -10,139 +10,139 @@

Coverage for Doctrine_Null

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Parser.html b/tests_old/coverage/Doctrine_Parser.html index 52c9b54f9..39994451c 100644 --- a/tests_old/coverage/Doctrine_Parser.html +++ b/tests_old/coverage/Doctrine_Parser.html @@ -64,7 +64,7 @@ - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: Null.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Null.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Null + * Doctrine_Null
24 * + *
25 * Simple empty class representing a null value + * Simple empty class representing a null value
26 * used for extra fast null value testing with isset() rather than array_key_exists() + * used for extra fast null value testing with isset() rather than array_key_exists()
27 * + *
28 * @package     Doctrine + * @package     Doctrine
29 * @subpackage  Null + * @subpackage  Null
30 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
31 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
32 * @since       1.0 + * @since       1.0
33 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
34 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
35 */ + */
36final class Doctrine_Null +final class Doctrine_Null
37{  +
38    public function exists() +    public function exists()
39    { +    {
40        return false;     +        return false;    
41    } +    }
42    public function __toString() +    public function __toString()
43    { +    {
44        return ''; +        return '';
45    } +    }
46 }
 * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -91,7 +91,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Parser_Yml.html b/tests_old/coverage/Doctrine_Parser_Yml.html index e86614ed8..edb8d99a4 100644 --- a/tests_old/coverage/Doctrine_Parser_Yml.html +++ b/tests_old/coverage/Doctrine_Parser_Yml.html @@ -70,7 +70,7 @@  * and is licensed under the LGPL. For more information, see
21 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
22  */ @@ -97,7 +97,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Plugin.html b/tests_old/coverage/Doctrine_Plugin.html index 92918dd91..e6cda19cd 100644 --- a/tests_old/coverage/Doctrine_Plugin.html +++ b/tests_old/coverage/Doctrine_Plugin.html @@ -10,720 +10,720 @@

Coverage for Doctrine_Plugin

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id$ + *  $Id$
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Plugin + * Doctrine_Plugin
24 * + *
25 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
26 * @package     Doctrine + * @package     Doctrine
27 * @subpackage  Plugin + * @subpackage  Plugin
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @version     $Revision$ + * @version     $Revision$
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31 * @since       1.0 + * @since       1.0
32 */ + */
33abstract class Doctrine_Plugin +abstract class Doctrine_Plugin
34{ +{
35    /** +    /**
36     * @var array $_options     an array of plugin specific options +     * @var array $_options     an array of plugin specific options
37     */ +     */
38    protected $_options = array('generateFiles' => false, +    protected $_options = array('generateFiles' => false,
39                                'identifier'    => false, +                                'identifier'    => false,
40                                'generateFiles' => false, +                                'generateFiles' => false,
41                                'table'         => false, +                                'table'         => false,
42                                'pluginTable'   => false, +                                'pluginTable'   => false,
43                                'children'      => array(),); +                                'children'      => array(),);
44 +
45    /** +    /**
46     * __get +     * __get
47     * an alias for getOption +     * an alias for getOption
48     * +     *
49     * @param string $option +     * @param string $option
50     */ +     */
51    public function __get($option) +    public function __get($option)
52    { +    {
53        if (isset($this->_options[$option])) { +        if (isset($this->_options[$option])) {
54            return $this->_options[$option]; +            return $this->_options[$option];
55        } +        }
56        return null; +        return null;
57    } +    }
58 +
59    /** +    /**
60     * __isset +     * __isset
61     * +     *
62     * @param string $option +     * @param string $option
63     */ +     */
64    public function __isset($option)  +    public function __isset($option) 
65    { +    {
66        return isset($this->_options[$option]); +        return isset($this->_options[$option]);
67    } +    }
68 +
69    /** +    /**
70     * returns the value of an option +     * returns the value of an option
71     * +     *
72     * @param $option       the name of the option to retrieve +     * @param $option       the name of the option to retrieve
73     * @return mixed        the value of the option +     * @return mixed        the value of the option
74     */ +     */
75    public function getOption($name) +    public function getOption($name)
76    { +    {
77        if ( ! isset($this->_options[$name])) { +        if ( ! isset($this->_options[$name])) {
78            throw new Doctrine_Plugin_Exception('Unknown option ' . $name); +            throw new Doctrine_Plugin_Exception('Unknown option ' . $name);
79        } +        }
80         +        
81        return $this->_options[$name]; +        return $this->_options[$name];
82    } +    }
83 +
84    /** +    /**
85     * sets given value to an option +     * sets given value to an option
86     * +     *
87     * @param $option       the name of the option to be changed +     * @param $option       the name of the option to be changed
88     * @param $value        the value of the option +     * @param $value        the value of the option
89     * @return Doctrine_Plugin  this object +     * @return Doctrine_Plugin  this object
90     */ +     */
91    public function setOption($name, $value) +    public function setOption($name, $value)
92    { +    {
93        $this->_options[$name] = $value; +        $this->_options[$name] = $value;
94         +        
95        return $this; +        return $this;
96    } +    }
97 +
98    public function addChild(Doctrine_Template $template) +    public function addChild(Doctrine_Template $template)
99    { +    {
100        $this->_options['children'][] = $template; +        $this->_options['children'][] = $template;
101    } +    }
102 +
103    /** +    /**
104     * returns all options and their associated values +     * returns all options and their associated values
105     * +     *
106     * @return array    all options as an associative array +     * @return array    all options as an associative array
107     */ +     */
108    public function getOptions() +    public function getOptions()
109    { +    {
110        return $this->_options; +        return $this->_options;
111    } +    }
112 +
113    public function buildPluginDefinition(Doctrine_Table $table) +    public function buildPluginDefinition(Doctrine_Table $table)
114    { +    {
115     $this->_options['table'] = $table; +     $this->_options['table'] = $table;
116 +
117        $this->_options['className'] = str_replace('%CLASS%', +        $this->_options['className'] = str_replace('%CLASS%',
118                                                   $this->_options['table']->getComponentName(), +                                                   $this->_options['table']->getComponentName(),
119                                                   $this->_options['className']); +                                                   $this->_options['className']);
120 +
121        // check that class doesn't exist (otherwise we cannot create it) +        // check that class doesn't exist (otherwise we cannot create it)
122        if (class_exists($this->_options['className'])) { +        if (class_exists($this->_options['className'])) {
123            return false; +            return false;
124        } +        }
125         +        
126        $this->buildDefinition(); +        $this->buildDefinition();
127    } +    }
128     +    
129    abstract public function buildDefinition(); +    abstract public function buildDefinition();
130 +
131    public function buildForeignKeys(Doctrine_Table $table) +    public function buildForeignKeys(Doctrine_Table $table)
132    { +    {
133        $id = $table->getIdentifier(); +        $id = $table->getIdentifier();
134 +
135        $fk = array(); +        $fk = array();
136        foreach ((array) $id as $column) { +        foreach ((array) $id as $column) {
137            $def = $table->getDefinitionOf($column); +            $def = $table->getDefinitionOf($column);
138 +
139            unset($def['autoincrement']); +            unset($def['autoincrement']);
140            unset($def['sequence']); +            unset($def['sequence']);
141            unset($def['unique']); +            unset($def['unique']);
142 +
143            $fk[$column] = $def; +            $fk[$column] = $def;
144        } +        }
145         +        
146        return $fk; +        return $fk;
147    } +    }
148 +
149    public function generateChildDefinitions() +    public function generateChildDefinitions()
150    { +    {
151        foreach ($this->_options['children'] as $child) { +        foreach ($this->_options['children'] as $child) {
152            $this->_options['pluginTable']->addTemplate(get_class($child), $child); +            $this->_options['pluginTable']->addTemplate(get_class($child), $child);
153 +
154            $child->setTable($this->_options['pluginTable']); +            $child->setTable($this->_options['pluginTable']);
155             +            
156            $child->setUp(); +            $child->setUp();
157        } +        }
158    } +    }
159 +
160    /** +    /**
161     * generates foreign keys for the plugin table based on the owner table +     * generates foreign keys for the plugin table based on the owner table
162     * +     *
163     * the foreign keys generated by this method can be used for  +     * the foreign keys generated by this method can be used for 
164     * setting the relations between the owner and the plugin classes +     * setting the relations between the owner and the plugin classes
165     * +     *
166     * @param Doctrine_Table $table     the table object that owns the plugin +     * @param Doctrine_Table $table     the table object that owns the plugin
167     * @return array                    an array of foreign key definitions +     * @return array                    an array of foreign key definitions
168     */ +     */
169    public function generateForeignKeys(Doctrine_Table $table) +    public function generateForeignKeys(Doctrine_Table $table)
170    { +    {
171        $fk = array(); +        $fk = array();
172 +
173        foreach ((array) $table->getIdentifier() as $column) { +        foreach ((array) $table->getIdentifier() as $column) {
174            $def = $table->getDefinitionOf($column); +            $def = $table->getDefinitionOf($column);
175 +
176            unset($def['autoincrement']); +            unset($def['autoincrement']);
177            unset($def['sequence']); +            unset($def['sequence']);
178            unset($def['primary']); +            unset($def['primary']);
179 +
180            $col = $column; +            $col = $column;
181 +
182            $def['primary'] = true; +            $def['primary'] = true;
183            $fk[$col] = $def; +            $fk[$col] = $def;
184        } +        }
185        return $fk; +        return $fk;
186    } +    }
187 +
188    /** +    /**
189     * generates a relation array to given table +     * generates a relation array to given table
190     * +     *
191     * this method can be used for generating the relation from the plugin  +     * this method can be used for generating the relation from the plugin 
192     * table to the owner table +     * table to the owner table
193     * +     *
194     * @param Doctrine_Table $table     the table object to construct the relation to +     * @param Doctrine_Table $table     the table object to construct the relation to
195     * @param array $foreignKeys        an array of foreign keys +     * @param array $foreignKeys        an array of foreign keys
196     * @return array                    the generated relation array +     * @return array                    the generated relation array
197     */ +     */
198    public function generateRelation(Doctrine_Table $table, array $foreignKeys) +    public function generateRelation(Doctrine_Table $table, array $foreignKeys)
199    { +    {
200        $local = (count($foreignKeys) > 1) ? array_keys($foreignKeys) : key($foreignKeys); +        $local = (count($foreignKeys) > 1) ? array_keys($foreignKeys) : key($foreignKeys);
201         +        
202        $relation = array($table->getComponentName() =>  +        $relation = array($table->getComponentName() => 
203                        array('local'    => $local, +                        array('local'    => $local,
204                              'foreign'  => $table->getIdentifier(), +                              'foreign'  => $table->getIdentifier(),
205                              'onDelete' => 'CASCADE', +                              'onDelete' => 'CASCADE',
206                              'onUpdate' => 'CASCADE')); +                              'onUpdate' => 'CASCADE'));
207 +
208        return $relation; +        return $relation;
209    } +    }
210 +
211    /** +    /**
212     * generates the class definition for plugin class +     * generates the class definition for plugin class
213     * +     *
214     * @param array $options    plugin class options, keys representing the option names  +     * @param array $options    plugin class options, keys representing the option names 
215     *                          and values as option values +     *                          and values as option values
216     * @param array $columns    the plugin class columns, keys representing the column names +     * @param array $columns    the plugin class columns, keys representing the column names
217     *                          and values as column definitions +     *                          and values as column definitions
218     * @param array $relations  the bound relations of the plugin class +     * @param array $relations  the bound relations of the plugin class
219     * @return void +     * @return void
220     */ +     */
221    public function generateClass($options, $columns, $relations) +    public function generateClass($options, $columns, $relations)
222    { +    {
223        $builder = new Doctrine_Import_Builder(); +        $builder = new Doctrine_Import_Builder();
224 +
225        if ($this->_options['generateFiles']) { +        if ($this->_options['generateFiles']) {
226            if (isset($this->_options['generatePath']) && $this->_options['generatePath']) { +            if (isset($this->_options['generatePath']) && $this->_options['generatePath']) {
227                $builder->setTargetPath($this->_options['generatePath']); +                $builder->setTargetPath($this->_options['generatePath']);
228 +
229                $builder->buildRecord($options, $columns, $relations); +                $builder->buildRecord($options, $columns, $relations);
230            } else { +            } else {
231                throw new Doctrine_Plugin_Exception('If you wish to generate files then you must specify the path to generate the files in.'); +                throw new Doctrine_Plugin_Exception('If you wish to generate files then you must specify the path to generate the files in.');
232            } +            }
233        } else { +        } else {
234            $def = $builder->buildDefinition($options, $columns, $relations); +            $def = $builder->buildDefinition($options, $columns, $relations);
235 +
236            eval($def); +            eval($def);
237        } +        }
238    } +    }
239} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Query.html b/tests_old/coverage/Doctrine_Query.html index a480112b7..85e83e63c 100644 --- a/tests_old/coverage/Doctrine_Query.html +++ b/tests_old/coverage/Doctrine_Query.html @@ -64,7 +64,7 @@
 * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -100,7 +100,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
31 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
32  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Query_Abstract.html b/tests_old/coverage/Doctrine_Query_Abstract.html index baca94ed1..d72b6ce8f 100644 --- a/tests_old/coverage/Doctrine_Query_Abstract.html +++ b/tests_old/coverage/Doctrine_Query_Abstract.html @@ -64,7 +64,7 @@  * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -91,7 +91,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Query_Check.html b/tests_old/coverage/Doctrine_Query_Check.html index 2c1928506..c4ef0a88d 100644 --- a/tests_old/coverage/Doctrine_Query_Check.html +++ b/tests_old/coverage/Doctrine_Query_Check.html @@ -10,508 +10,508 @@

Coverage for Doctrine_Query_Check

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Query_Condition.html b/tests_old/coverage/Doctrine_Query_Condition.html index 4b0f68113..2d8696439 100644 --- a/tests_old/coverage/Doctrine_Query_Condition.html +++ b/tests_old/coverage/Doctrine_Query_Condition.html @@ -10,339 +10,339 @@

Coverage for Doctrine_Query_Condition

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: From.php 1080 2007-02-10 18:17:08Z romanb $ + *  $Id: From.php 1080 2007-02-10 18:17:08Z romanb $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Query_Check + * Doctrine_Query_Check
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Query + * @subpackage  Query
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 1080 $ + * @version     $Revision: 1080 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Query_Check +class Doctrine_Query_Check
34{ +{
35    /** +    /**
36     * @var Doctrine_Table $table           Doctrine_Table object +     * @var Doctrine_Table $table           Doctrine_Table object
37     */ +     */
38    protected $table; +    protected $table;
39 +
40    /** +    /**
41     * @var string $sql                     database specific sql CHECK constraint definition  +     * @var string $sql                     database specific sql CHECK constraint definition 
42     *                                      parsed from the given dql CHECK definition +     *                                      parsed from the given dql CHECK definition
43     */ +     */
44    protected $sql; +    protected $sql;
45     +    
46    protected $_tokenizer; +    protected $_tokenizer;
47 +
48    /** +    /**
49     * @param Doctrine_Table|string $table  Doctrine_Table object +     * @param Doctrine_Table|string $table  Doctrine_Table object
50     */ +     */
51    public function __construct($table) +    public function __construct($table)
52    { +    {
53        if ( ! ($table instanceof Doctrine_Table)) { +        if ( ! ($table instanceof Doctrine_Table)) {
54            $table = Doctrine_Manager::getInstance() +            $table = Doctrine_Manager::getInstance()
55                        ->getCurrentConnection() +                        ->getCurrentConnection()
56                        ->getTable($table); +                        ->getTable($table);
57        } +        }
58        $this->table = $table; +        $this->table = $table;
59        $this->_tokenizer = new Doctrine_Query_Tokenizer(); +        $this->_tokenizer = new Doctrine_Query_Tokenizer();
60    } +    }
61 +
62    /** +    /**
63     * getTable +     * getTable
64     * returns the table object associated with this object +     * returns the table object associated with this object
65     * +     *
66     * @return Doctrine_Connection +     * @return Doctrine_Connection
67     */ +     */
68    public function getTable() +    public function getTable()
69    { +    {
70        return $this->table; +        return $this->table;
71    } +    }
72 +
73    /** +    /**
74     * parse +     * parse
75     * +     *
76     * @param string $dql       DQL CHECK constraint definition +     * @param string $dql       DQL CHECK constraint definition
77     * @return string +     * @return string
78     */ +     */
79    public function parse($dql) +    public function parse($dql)
80    { +    {
81        $this->sql = $this->parseClause($dql); +        $this->sql = $this->parseClause($dql);
82    } +    }
83 +
84    /** +    /**
85     * parseClause +     * parseClause
86     * +     *
87     * @param string $alias     component alias +     * @param string $alias     component alias
88     * @param string $field     the field name +     * @param string $field     the field name
89     * @param mixed $value      the value of the field +     * @param mixed $value      the value of the field
90     * @return void +     * @return void
91     */ +     */
92    public function parseClause($dql) +    public function parseClause($dql)
93    { +    {
94        $parts = $this->_tokenizer->sqlExplode($dql, ' AND '); +        $parts = $this->_tokenizer->sqlExplode($dql, ' AND ');
95 +
96        if (count($parts) > 1) { +        if (count($parts) > 1) {
97            $ret = array(); +            $ret = array();
98            foreach ($parts as $part) { +            foreach ($parts as $part) {
99                $ret[] = $this->parseSingle($part); +                $ret[] = $this->parseSingle($part);
100            } +            }
101 +
102            $r = implode(' AND ', $ret); +            $r = implode(' AND ', $ret);
103        } else { +        } else {
104            $parts = $this->_tokenizer->quoteExplode($dql, ' OR '); +            $parts = $this->_tokenizer->quoteExplode($dql, ' OR ');
105            if (count($parts) > 1) { +            if (count($parts) > 1) {
106                $ret = array(); +                $ret = array();
107                foreach ($parts as $part) { +                foreach ($parts as $part) {
108                    $ret[] = $this->parseClause($part); +                    $ret[] = $this->parseClause($part);
109                } +                }
110 +
111                $r = implode(' OR ', $ret); +                $r = implode(' OR ', $ret);
112            } else { +            } else {
113                $ret = $this->parseSingle($dql); +                $ret = $this->parseSingle($dql);
114                return $ret; +                return $ret;
115            } +            }
116        } +        }
117        return '(' . $r . ')'; +        return '(' . $r . ')';
118    } +    }
119     +    
120    public function parseSingle($part) +    public function parseSingle($part)
121    { +    {
122        $e = explode(' ', $part); +        $e = explode(' ', $part);
123         +        
124        $e[0] = $this->parseFunction($e[0]); +        $e[0] = $this->parseFunction($e[0]);
125 +
126        switch ($e[1]) { +        switch ($e[1]) {
127            case '>': +            case '>':
128            case '<': +            case '<':
129            case '=': +            case '=':
130            case '!=': +            case '!=':
131            case '<>': +            case '<>':
132 +
133            break; +            break;
134            default: +            default:
135                throw new Doctrine_Query_Exception('Unknown operator ' . $e[1]); +                throw new Doctrine_Query_Exception('Unknown operator ' . $e[1]);
136        } +        }
137 +
138        return implode(' ', $e); +        return implode(' ', $e);
139    } +    }
140    public function parseFunction($dql)  +    public function parseFunction($dql) 
141    { +    {
142        if (($pos = strpos($dql, '(')) !== false) { +        if (($pos = strpos($dql, '(')) !== false) {
143            $func  = substr($dql, 0, $pos); +            $func  = substr($dql, 0, $pos);
144            $value = substr($dql, ($pos + 1), -1); +            $value = substr($dql, ($pos + 1), -1);
145             +            
146            $expr  = $this->table->getConnection()->expression; +            $expr  = $this->table->getConnection()->expression;
147 +
148            if ( ! method_exists($expr, $func)) { +            if ( ! method_exists($expr, $func)) {
149                throw new Doctrine_Query_Exception('Unknown function ' . $func); +                throw new Doctrine_Query_Exception('Unknown function ' . $func);
150            } +            }
151             +            
152            $func  = $expr->$func($value); +            $func  = $expr->$func($value);
153        } +        }
154        return $func; +        return $func;
155    } +    }
156 +
157    /** +    /**
158     * getSql +     * getSql
159     * +     *
160     * returns database specific sql CHECK constraint definition +     * returns database specific sql CHECK constraint definition
161     * parsed from the given dql CHECK definition +     * parsed from the given dql CHECK definition
162     * +     *
163     * @return string +     * @return string
164     */ +     */
165    public function getSql() +    public function getSql()
166    { +    {
167        return $this->sql; +        return $this->sql;
168    } +    }
169 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: Condition.php 3212 2007-11-24 18:58:33Z romanb $ + *  $Id: Condition.php 3212 2007-11-24 18:58:33Z romanb $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Query_Part'); +Doctrine::autoload('Doctrine_Query_Part');
22/** +/**
23 * Doctrine_Query_Condition + * Doctrine_Query_Condition
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Query + * @subpackage  Query
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 3212 $ + * @version     $Revision: 3212 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33abstract class Doctrine_Query_Condition extends Doctrine_Query_Part +abstract class Doctrine_Query_Condition extends Doctrine_Query_Part
34{ +{
35    /** +    /**
36     * DQL CONDITION PARSER +     * DQL CONDITION PARSER
37     * parses the join condition/where/having part of the query string +     * parses the join condition/where/having part of the query string
38     * +     *
39     * @param string $str +     * @param string $str
40     * @return string +     * @return string
41     */ +     */
42    public function parse($str) +    public function parse($str)
43    { +    {
44        $tmp = trim($str); +        $tmp = trim($str);
45 +
46        $parts = $this->_tokenizer->bracketExplode($str, array(' \&\& ', ' AND '), '(', ')'); +        $parts = $this->_tokenizer->bracketExplode($str, array(' \&\& ', ' AND '), '(', ')');
47 +
48        if (count($parts) > 1) { +        if (count($parts) > 1) {
49            $ret = array(); +            $ret = array();
50            foreach ($parts as $part) { +            foreach ($parts as $part) {
51                $part = $this->_tokenizer->bracketTrim($part, '(', ')'); +                $part = $this->_tokenizer->bracketTrim($part, '(', ')');
52                $ret[] = $this->parse($part); +                $ret[] = $this->parse($part);
53            } +            }
54            $r = implode(' AND ', $ret); +            $r = implode(' AND ', $ret);
55        } else { +        } else {
56 +
57            $parts = $this->_tokenizer->bracketExplode($str, array(' \|\| ', ' OR '), '(', ')'); +            $parts = $this->_tokenizer->bracketExplode($str, array(' \|\| ', ' OR '), '(', ')');
58            if (count($parts) > 1) { +            if (count($parts) > 1) {
59                $ret = array(); +                $ret = array();
60                foreach ($parts as $part) { +                foreach ($parts as $part) {
61                    $part = $this->_tokenizer->bracketTrim($part, '(', ')'); +                    $part = $this->_tokenizer->bracketTrim($part, '(', ')');
62                    $ret[] = $this->parse($part); +                    $ret[] = $this->parse($part);
63                } +                }
64                $r = implode(' OR ', $ret); +                $r = implode(' OR ', $ret);
65            } else { +            } else {
66                if (substr($parts[0],0,1) == '(' && substr($parts[0], -1) == ')') { +                if (substr($parts[0],0,1) == '(' && substr($parts[0], -1) == ')') {
67                    return $this->parse(substr($parts[0], 1, -1)); +                    return $this->parse(substr($parts[0], 1, -1));
68                } else { +                } else {
69                    return $this->load($parts[0]); +                    return $this->load($parts[0]);
70                } +                }
71            } +            }
72        } +        }
73 +
74        return '(' . $r . ')'; +        return '(' . $r . ')';
75    } +    }
76 +
77 +
78 +
79    /** +    /**
80     * parses a literal value and returns the parsed value +     * parses a literal value and returns the parsed value
81     * +     *
82     * boolean literals are parsed to integers +     * boolean literals are parsed to integers
83     * components are parsed to associated table aliases +     * components are parsed to associated table aliases
84     * +     *
85     * @param string $value         literal value to be parsed +     * @param string $value         literal value to be parsed
86     * @return string +     * @return string
87     */ +     */
88    public function parseLiteralValue($value) +    public function parseLiteralValue($value)
89    { +    {
90        // check that value isn't a string +        // check that value isn't a string
91        if (strpos($value, '\'') === false) { +        if (strpos($value, '\'') === false) {
92            // parse booleans +            // parse booleans
93            $value = $this->query->getConnection() +            $value = $this->query->getConnection()
94                     ->dataDict->parseBoolean($value); +                     ->dataDict->parseBoolean($value);
95 +
96            $a = explode('.', $value); +            $a = explode('.', $value);
97 +
98            if (count($a) > 1) { +            if (count($a) > 1) {
99            // either a float or a component.. +            // either a float or a component..
100 +
101                if ( ! is_numeric($a[0])) { +                if ( ! is_numeric($a[0])) {
102                    // a component found +                    // a component found
103                    $value = $this->query->getTableAlias($a[0]). '.' . $a[1]; +                    $value = $this->query->getTableAlias($a[0]). '.' . $a[1];
104                } +                }
105            } +            }
106        } else { +        } else {
107            // string literal found +            // string literal found
108        } +        }
109 +
110        return $value; +        return $value;
111    } +    }
112} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Query_Exception.html b/tests_old/coverage/Doctrine_Query_Exception.html index 5cd15a099..a84e296fb 100644 --- a/tests_old/coverage/Doctrine_Query_Exception.html +++ b/tests_old/coverage/Doctrine_Query_Exception.html @@ -10,103 +10,103 @@

Coverage for Doctrine_Query_Exception

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Query_From.html b/tests_old/coverage/Doctrine_Query_From.html index b8e1453e2..4dae572d4 100644 --- a/tests_old/coverage/Doctrine_Query_From.html +++ b/tests_old/coverage/Doctrine_Query_From.html @@ -10,268 +10,268 @@

Coverage for Doctrine_Query_From

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Exception.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $ + *  $Id: Exception.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Exception'); +Doctrine::autoload('Doctrine_Exception');
22/** +/**
23 * Doctrine_Query_Exception + * Doctrine_Query_Exception
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Query + * @subpackage  Query
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 2702 $ + * @version     $Revision: 2702 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Query_Exception extends Doctrine_Exception +class Doctrine_Query_Exception extends Doctrine_Exception
34 { }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Query_Groupby.html b/tests_old/coverage/Doctrine_Query_Groupby.html index 04bde5a41..7e559e794 100644 --- a/tests_old/coverage/Doctrine_Query_Groupby.html +++ b/tests_old/coverage/Doctrine_Query_Groupby.html @@ -10,198 +10,198 @@

Coverage for Doctrine_Query_Groupby

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: From.php 3212 2007-11-24 18:58:33Z romanb $ + *  $Id: From.php 3212 2007-11-24 18:58:33Z romanb $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload("Doctrine_Query_Part"); +Doctrine::autoload("Doctrine_Query_Part");
22/** +/**
23 * Doctrine_Query_From + * Doctrine_Query_From
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Query + * @subpackage  Query
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 3212 $ + * @version     $Revision: 3212 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Query_From extends Doctrine_Query_Part +class Doctrine_Query_From extends Doctrine_Query_Part
34{ +{
35    /** +    /**
36     * DQL FROM PARSER +     * DQL FROM PARSER
37     * parses the FROM part of the query string +     * parses the FROM part of the query string
38     * +     *
39     * @param string $str +     * @param string $str
40     * @return void +     * @return void
41     */ +     */
42    public function parse($str) +    public function parse($str)
43    {         +    {        
44        $str = trim($str); +        $str = trim($str);
45        $parts = $this->_tokenizer->bracketExplode($str, 'JOIN'); +        $parts = $this->_tokenizer->bracketExplode($str, 'JOIN');
46 +
47        $operator = false; +        $operator = false;
48 +
49        switch (trim($parts[0])) { +        switch (trim($parts[0])) {
50            case 'INNER': +            case 'INNER':
51                $operator = ':'; +                $operator = ':';
52            case 'LEFT': +            case 'LEFT':
53                array_shift($parts); +                array_shift($parts);
54            break; +            break;
55        } +        }
56 +
57        $last = ''; +        $last = '';
58 +
59        foreach ($parts as $k => $part) { +        foreach ($parts as $k => $part) {
60            $part = trim($part); +            $part = trim($part);
61 +
62            if (empty($part)) { +            if (empty($part)) {
63                continue; +                continue;
64            } +            }
65 +
66            $e = explode(' ', $part); +            $e = explode(' ', $part);
67 +
68            if (end($e) == 'INNER' || end($e) == 'LEFT') { +            if (end($e) == 'INNER' || end($e) == 'LEFT') {
69                $last = array_pop($e); +                $last = array_pop($e);
70            } +            }
71            $part = implode(' ', $e); +            $part = implode(' ', $e);
72 +
73            foreach ($this->_tokenizer->bracketExplode($part, ',') as $reference) { +            foreach ($this->_tokenizer->bracketExplode($part, ',') as $reference) {
74                $reference = trim($reference); +                $reference = trim($reference);
75                $e = explode(' ', $reference); +                $e = explode(' ', $reference);
76                $e2 = explode('.', $e[0]); +                $e2 = explode('.', $e[0]);
77 +
78                if ($operator) { +                if ($operator) {
79                    $e[0] = array_shift($e2) . $operator . implode('.', $e2); +                    $e[0] = array_shift($e2) . $operator . implode('.', $e2);
80                } +                }
81                 +                
82                $table = $this->query->load(implode(' ', $e)); +                $table = $this->query->load(implode(' ', $e));
83            } +            }
84 +
85            $operator = ($last == 'INNER') ? ':' : '.'; +            $operator = ($last == 'INNER') ? ':' : '.';
86        } +        }
87        return null; +        return null;
88    } +    }
89 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: Groupby.php 3041 2007-10-30 19:10:18Z zYne $ + *  $Id: Groupby.php 3041 2007-10-30 19:10:18Z zYne $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Query_Part'); +Doctrine::autoload('Doctrine_Query_Part');
22/** +/**
23 * Doctrine_Query_Groupby + * Doctrine_Query_Groupby
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Query + * @subpackage  Query
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 3041 $ + * @version     $Revision: 3041 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Query_Groupby extends Doctrine_Query_Part +class Doctrine_Query_Groupby extends Doctrine_Query_Part
34{ +{
35    /** +    /**
36     * DQL GROUP BY PARSER +     * DQL GROUP BY PARSER
37     * parses the group by part of the query string +     * parses the group by part of the query string
38     * +     *
39     * @param string $str +     * @param string $str
40     * @return void +     * @return void
41     */ +     */
42    public function parse($str, $append = false) +    public function parse($str, $append = false)
43    { +    {
44        $r = array(); +        $r = array();
45        foreach (explode(',', $str) as $reference) { +        foreach (explode(',', $str) as $reference) {
46            $reference = trim($reference); +            $reference = trim($reference);
47             +            
48            /** +            /**
49            if (count($e) > 1) { +            if (count($e) > 1) {
50                $field = array_pop($e); +                $field = array_pop($e);
51                $ref   = implode('.', $e); +                $ref   = implode('.', $e);
52                $this->query->load($ref); +                $this->query->load($ref);
53 +
54                $r[] = $this->query->getTableAlias($ref) . '.' . $field; +                $r[] = $this->query->getTableAlias($ref) . '.' . $field;
55            } else { +            } else {
56                $alias = end($e); +                $alias = end($e);
57 +
58                $r[] = $this->query->getAggregateAlias($alias); +                $r[] = $this->query->getAggregateAlias($alias);
59            } +            }
60            */ +            */
61            $r[] = $this->query->parseClause($reference); +            $r[] = $this->query->parseClause($reference);
62        } +        }
63        return implode(', ', $r); +        return implode(', ', $r);
64    } +    }
65} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Query_Having.html b/tests_old/coverage/Doctrine_Query_Having.html index be8db9966..44b37d0f1 100644 --- a/tests_old/coverage/Doctrine_Query_Having.html +++ b/tests_old/coverage/Doctrine_Query_Having.html @@ -10,297 +10,297 @@

Coverage for Doctrine_Query_Having

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: Having.php 3212 2007-11-24 18:58:33Z romanb $ + *  $Id: Having.php 3212 2007-11-24 18:58:33Z romanb $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Query_Condition'); +Doctrine::autoload('Doctrine_Query_Condition');
22/** +/**
23 * Doctrine_Query_Having + * Doctrine_Query_Having
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Query + * @subpackage  Query
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 3212 $ + * @version     $Revision: 3212 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Query_Having extends Doctrine_Query_Condition +class Doctrine_Query_Having extends Doctrine_Query_Condition
34{ +{
35    /** +    /**
36     * DQL Aggregate Function parser +     * DQL Aggregate Function parser
37     * +     *
38     * @param string $func +     * @param string $func
39     * @return mixed +     * @return mixed
40     */ +     */
41    private function parseAggregateFunction($func) +    private function parseAggregateFunction($func)
42    { +    {
43        $pos = strpos($func, '('); +        $pos = strpos($func, '(');
44 +
45        if ($pos !== false) { +        if ($pos !== false) {
46            $funcs  = array(); +            $funcs  = array();
47 +
48            $name   = substr($func, 0, $pos); +            $name   = substr($func, 0, $pos);
49            $func   = substr($func, ($pos + 1), -1); +            $func   = substr($func, ($pos + 1), -1);
50            $params = $this->_tokenizer->bracketExplode($func, ',', '(', ')'); +            $params = $this->_tokenizer->bracketExplode($func, ',', '(', ')');
51 +
52            foreach ($params as $k => $param) { +            foreach ($params as $k => $param) {
53                $params[$k] = $this->parseAggregateFunction($param); +                $params[$k] = $this->parseAggregateFunction($param);
54            } +            }
55 +
56            $funcs = $name . '(' . implode(', ', $params) . ')'; +            $funcs = $name . '(' . implode(', ', $params) . ')';
57 +
58            return $funcs; +            return $funcs;
59 +
60        } else { +        } else {
61            if ( ! is_numeric($func)) { +            if ( ! is_numeric($func)) {
62                $a = explode('.', $func); +                $a = explode('.', $func);
63 +
64                if (count($a) > 1) { +                if (count($a) > 1) {
65                    $field     = array_pop($a); +                    $field     = array_pop($a);
66                    $reference = implode('.', $a); +                    $reference = implode('.', $a);
67                    $map       = $this->query->load($reference, false); +                    $map       = $this->query->load($reference, false);
68                    $field     = $map['table']->getColumnName($field); +                    $field     = $map['table']->getColumnName($field);
69                    $func      = $this->query->getTableAlias($reference) . '.' . $field; +                    $func      = $this->query->getTableAlias($reference) . '.' . $field;
70                } else { +                } else {
71                    $field = end($a); +                    $field = end($a);
72                    $func  = $this->query->getAggregateAlias($field); +                    $func  = $this->query->getAggregateAlias($field);
73                } +                }
74                return $func; +                return $func;
75            } else { +            } else {
76                return $func; +                return $func;
77            } +            }
78        } +        }
79    } +    }
80 +
81 +
82    /** +    /**
83     * load +     * load
84     * returns the parsed query part +     * returns the parsed query part
85     * +     *
86     * @param string $having +     * @param string $having
87     * @return string +     * @return string
88     */ +     */
89    final public function load($having) +    final public function load($having)
90    { +    {
91        $tokens = $this->_tokenizer->bracketExplode($having, ' ', '(', ')'); +        $tokens = $this->_tokenizer->bracketExplode($having, ' ', '(', ')');
92        $part = $this->parseAggregateFunction(array_shift($tokens)); +        $part = $this->parseAggregateFunction(array_shift($tokens));
93        $operator  = array_shift($tokens); +        $operator  = array_shift($tokens);
94        $value     = implode(' ', $tokens); +        $value     = implode(' ', $tokens);
95        $part .= ' ' . $operator . ' ' . $value; +        $part .= ' ' . $operator . ' ' . $value;
96        return $part; +        return $part;
97    } +    }
98} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Query_JoinCondition.html b/tests_old/coverage/Doctrine_Query_JoinCondition.html index b65faea0c..22abebeff 100644 --- a/tests_old/coverage/Doctrine_Query_JoinCondition.html +++ b/tests_old/coverage/Doctrine_Query_JoinCondition.html @@ -10,313 +10,313 @@

Coverage for Doctrine_Query_JoinCondition

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Query_Limit.html b/tests_old/coverage/Doctrine_Query_Limit.html index c5997d68f..0e50b65df 100644 --- a/tests_old/coverage/Doctrine_Query_Limit.html +++ b/tests_old/coverage/Doctrine_Query_Limit.html @@ -10,118 +10,118 @@

Coverage for Doctrine_Query_Limit

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: JoinCondition.php 3212 2007-11-24 18:58:33Z romanb $ + *  $Id: JoinCondition.php 3212 2007-11-24 18:58:33Z romanb $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Query_Part'); +Doctrine::autoload('Doctrine_Query_Part');
22/** +/**
23 * Doctrine_Query_JoinCondition + * Doctrine_Query_JoinCondition
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Query + * @subpackage  Query
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 3212 $ + * @version     $Revision: 3212 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Query_JoinCondition extends Doctrine_Query_Condition  +class Doctrine_Query_JoinCondition extends Doctrine_Query_Condition 
34{ +{
35    public function load($condition)  +    public function load($condition) 
36    { +    {
37        $condition = trim($condition); +        $condition = trim($condition);
38 +
39        $e = $this->_tokenizer->sqlExplode($condition); +        $e = $this->_tokenizer->sqlExplode($condition);
40 +
41        if (count($e) > 2) { +        if (count($e) > 2) {
42            $a         = explode('.', $e[0]); +            $a         = explode('.', $e[0]);
43            $field     = array_pop($a); +            $field     = array_pop($a);
44            $reference = implode('.', $a); +            $reference = implode('.', $a);
45            $operator  = $e[1]; +            $operator  = $e[1];
46            $value     = $e[2]; +            $value     = $e[2];
47 +
48            $alias     = $this->query->getTableAlias($reference); +            $alias     = $this->query->getTableAlias($reference);
49            $map       = $this->query->getAliasDeclaration($reference); +            $map       = $this->query->getAliasDeclaration($reference);
50            $table     = $map['table']; +            $table     = $map['table'];
51            // check if value is enumerated value +            // check if value is enumerated value
52            $enumIndex = $table->enumIndex($field, trim($value, "'")); +            $enumIndex = $table->enumIndex($field, trim($value, "'"));
53 +
54 +
55            if (substr($value, 0, 1) == '(') { +            if (substr($value, 0, 1) == '(') {
56                // trim brackets +                // trim brackets
57                $trimmed   = $this->_tokenizer->bracketTrim($value); +                $trimmed   = $this->_tokenizer->bracketTrim($value);
58 +
59                if (substr($trimmed, 0, 4) == 'FROM' || substr($trimmed, 0, 6) == 'SELECT') { +                if (substr($trimmed, 0, 4) == 'FROM' || substr($trimmed, 0, 6) == 'SELECT') {
60                    // subquery found +                    // subquery found
61                    $q = $this->query->createSubquery(); +                    $q = $this->query->createSubquery();
62                    $value = '(' . $q->parseQuery($trimmed)->getQuery() . ')'; +                    $value = '(' . $q->parseQuery($trimmed)->getQuery() . ')';
63                } elseif (substr($trimmed, 0, 4) == 'SQL:') { +                } elseif (substr($trimmed, 0, 4) == 'SQL:') {
64                    $value = '(' . substr($trimmed, 4) . ')'; +                    $value = '(' . substr($trimmed, 4) . ')';
65                } else { +                } else {
66                    // simple in expression found +                    // simple in expression found
67                    $e     = $this->_tokenizer->sqlExplode($trimmed, ','); +                    $e     = $this->_tokenizer->sqlExplode($trimmed, ',');
68 +
69                    $value = array(); +                    $value = array();
70                    foreach ($e as $part) { +                    foreach ($e as $part) {
71                        $index   = $table->enumIndex($field, trim($part, "'")); +                        $index   = $table->enumIndex($field, trim($part, "'"));
72                        if ($index !== false) { +                        if ($index !== false) {
73                            $value[] = $index; +                            $value[] = $index;
74                        } else { +                        } else {
75                            $value[] = $this->parseLiteralValue($part); +                            $value[] = $this->parseLiteralValue($part);
76                        } +                        }
77                    } +                    }
78                    $value = '(' . implode(', ', $value) . ')'; +                    $value = '(' . implode(', ', $value) . ')';
79                } +                }
80            } else { +            } else {
81                if ($enumIndex !== false) { +                if ($enumIndex !== false) {
82                    $value = $enumIndex; +                    $value = $enumIndex;
83                } else { +                } else {
84                    $value = $this->parseLiteralValue($value); +                    $value = $this->parseLiteralValue($value);
85                } +                }
86            } +            }
87 +
88            switch ($operator) { +            switch ($operator) {
89                case '<': +                case '<':
90                case '>': +                case '>':
91                case '=': +                case '=':
92                case '!=': +                case '!=':
93                    if ($enumIndex !== false) { +                    if ($enumIndex !== false) {
94                        $value  = $enumIndex; +                        $value  = $enumIndex;
95                    } +                    }
96                default: +                default:
97                    $condition  = $alias . '.' . $field . ' ' +                    $condition  = $alias . '.' . $field . ' '
98                                . $operator . ' ' . $value; +                                . $operator . ' ' . $value;
99            } +            }
100 +
101        } +        }
102        return $condition; +        return $condition;
103    } +    }
104 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Query_Offset.html b/tests_old/coverage/Doctrine_Query_Offset.html index a52755c91..07994616c 100644 --- a/tests_old/coverage/Doctrine_Query_Offset.html +++ b/tests_old/coverage/Doctrine_Query_Offset.html @@ -10,118 +10,118 @@

Coverage for Doctrine_Query_Offset

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Where.php 1352 2007-05-15 10:07:05Z zYne $ + *  $Id: Where.php 1352 2007-05-15 10:07:05Z zYne $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Query_Limit + * Doctrine_Query_Limit
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Query + * @subpackage  Query
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 1352 $ + * @version     $Revision: 1352 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Query_Limit extends Doctrine_Query_Part +class Doctrine_Query_Limit extends Doctrine_Query_Part
34{ +{
35    public function parse($limit)  +    public function parse($limit) 
36    { +    {
37        return (int) $limit; +        return (int) $limit;
38    } +    }
39 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Query_Orderby.html b/tests_old/coverage/Doctrine_Query_Orderby.html index c957ed6ee..affd99034 100644 --- a/tests_old/coverage/Doctrine_Query_Orderby.html +++ b/tests_old/coverage/Doctrine_Query_Orderby.html @@ -10,162 +10,162 @@

Coverage for Doctrine_Query_Orderby

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Where.php 1352 2007-05-15 10:07:05Z zYne $ + *  $Id: Where.php 1352 2007-05-15 10:07:05Z zYne $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Query_Offset + * Doctrine_Query_Offset
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Query + * @subpackage  Query
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 1352 $ + * @version     $Revision: 1352 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Query_Offset extends Doctrine_Query_Part +class Doctrine_Query_Offset extends Doctrine_Query_Part
34{ +{
35    public function parse($offset) +    public function parse($offset)
36    { +    {
37        return (int) $offset; +        return (int) $offset;
38    } +    }
39 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: Orderby.php 3041 2007-10-30 19:10:18Z zYne $ + *  $Id: Orderby.php 3041 2007-10-30 19:10:18Z zYne $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Query_Part'); +Doctrine::autoload('Doctrine_Query_Part');
22/** +/**
23 * Doctrine_Query_Orderby + * Doctrine_Query_Orderby
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Query + * @subpackage  Query
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 3041 $ + * @version     $Revision: 3041 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Query_Orderby extends Doctrine_Query_Part +class Doctrine_Query_Orderby extends Doctrine_Query_Part
34{ +{
35    /** +    /**
36     * DQL ORDER BY PARSER +     * DQL ORDER BY PARSER
37     * parses the order by part of the query string +     * parses the order by part of the query string
38     * +     *
39     * @param string $str +     * @param string $str
40     * @return void +     * @return void
41     */ +     */
42    public function parse($str, $append = false) +    public function parse($str, $append = false)
43    { +    {
44        $ret = array(); +        $ret = array();
45 +
46        foreach (explode(',', trim($str)) as $r) { +        foreach (explode(',', trim($str)) as $r) {
47            $r = $this->query->parseClause($r); +            $r = $this->query->parseClause($r);
48 +
49            $ret[] = $r; +            $ret[] = $r;
50        } +        }
51        return $ret; +        return $ret;
52    } +    }
53} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Query_Part.html b/tests_old/coverage/Doctrine_Query_Part.html index e88faf35a..a7311b4cd 100644 --- a/tests_old/coverage/Doctrine_Query_Part.html +++ b/tests_old/coverage/Doctrine_Query_Part.html @@ -10,186 +10,186 @@

Coverage for Doctrine_Query_Part

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: Part.php 3212 2007-11-24 18:58:33Z romanb $ + *  $Id: Part.php 3212 2007-11-24 18:58:33Z romanb $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Query_Part + * Doctrine_Query_Part
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Query + * @subpackage  Query
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 3212 $ + * @version     $Revision: 3212 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33abstract class Doctrine_Query_Part +abstract class Doctrine_Query_Part
34{ +{
35    /** +    /**
36     * @var Doctrine_Query $query           the query object associated with this parser +     * @var Doctrine_Query $query           the query object associated with this parser
37     */ +     */
38    protected $query; +    protected $query;
39     +    
40    protected $_tokenizer; +    protected $_tokenizer;
41 +
42    /** +    /**
43     * @param Doctrine_Query $query         the query object associated with this parser +     * @param Doctrine_Query $query         the query object associated with this parser
44     */ +     */
45    public function __construct($query, Doctrine_Query_Tokenizer $tokenizer = null) +    public function __construct($query, Doctrine_Query_Tokenizer $tokenizer = null)
46    { +    {
47        $this->query = $query; +        $this->query = $query;
48        if ( ! $tokenizer) { +        if ( ! $tokenizer) {
49            $tokenizer = new Doctrine_Query_Tokenizer(); +            $tokenizer = new Doctrine_Query_Tokenizer();
50        } +        }
51        $this->_tokenizer = $tokenizer; +        $this->_tokenizer = $tokenizer;
52    } +    }
53 +
54    /** +    /**
55     * @return Doctrine_Query $query        the query object associated with this parser +     * @return Doctrine_Query $query        the query object associated with this parser
56     */ +     */
57    public function getQuery() +    public function getQuery()
58    { +    {
59        return $this->query; +        return $this->query;
60    } +    }
61} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Query_Registry.html b/tests_old/coverage/Doctrine_Query_Registry.html index 57eeedb40..9ca0fe93c 100644 --- a/tests_old/coverage/Doctrine_Query_Registry.html +++ b/tests_old/coverage/Doctrine_Query_Registry.html @@ -10,211 +10,211 @@

Coverage for Doctrine_Query_Registry

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Query_Select.html b/tests_old/coverage/Doctrine_Query_Select.html index 31c84bc40..6aa360c84 100644 --- a/tests_old/coverage/Doctrine_Query_Select.html +++ b/tests_old/coverage/Doctrine_Query_Select.html @@ -10,118 +10,118 @@

Coverage for Doctrine_Query_Select

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id$ + *  $Id$
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Query_Registry + * Doctrine_Query_Registry
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Query + * @subpackage  Query
27 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30 * @since       1.0 + * @since       1.0
31 * @version     $Revision$ + * @version     $Revision$
32 */ + */
33class Doctrine_Query_Registry +class Doctrine_Query_Registry
34{ +{
35    protected $_queries = array(); +    protected $_queries = array();
36 +
37    public function add($key, $query) +    public function add($key, $query)
38    { +    {
39     if (strpos($key, '/') === false) { +     if (strpos($key, '/') === false) {
40            $this->_queries[$key] = $query; +            $this->_queries[$key] = $query;
41        } else { +        } else {
42            // namespace found +            // namespace found
43             +            
44            $e = explode('/', $key); +            $e = explode('/', $key);
45 +
46            $this->_queries[$e[0]][$e[1]] = $query; +            $this->_queries[$e[0]][$e[1]] = $query;
47        } +        }
48    } +    }
49     +    
50    public function get($key, $namespace = null) +    public function get($key, $namespace = null)
51    { +    {
52        if (isset($namespace)) { +        if (isset($namespace)) {
53            if ( ! isset($this->_queries[$namespace][$key])) { +            if ( ! isset($this->_queries[$namespace][$key])) {
54                throw new Doctrine_Query_Registry_Exception('A query with the name ' . $namespace . '/' . $key . ' does not exist.'); +                throw new Doctrine_Query_Registry_Exception('A query with the name ' . $namespace . '/' . $key . ' does not exist.');
55            } +            }
56            $query = $this->_queries[$namespace][$key]; +            $query = $this->_queries[$namespace][$key];
57        } else { +        } else {
58            if ( ! isset($this->_queries[$key])) { +            if ( ! isset($this->_queries[$key])) {
59                throw new Doctrine_Query_Registry_Exception('A query with the name ' . $key . ' does not exist.'); +                throw new Doctrine_Query_Registry_Exception('A query with the name ' . $key . ' does not exist.');
60            } +            }
61            $query = $this->_queries[$key]; +            $query = $this->_queries[$key];
62        } +        }
63         +        
64        if ( ! ($query instanceof Doctrine_Query)) { +        if ( ! ($query instanceof Doctrine_Query)) {
65            $query = Doctrine_Query::create()->parseQuery($query); +            $query = Doctrine_Query::create()->parseQuery($query);
66        } +        }
67         +        
68        return $query; +        return $query;
69    } +    }
70 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Query_Set.html b/tests_old/coverage/Doctrine_Query_Set.html index 0bb5077c7..506605659 100644 --- a/tests_old/coverage/Doctrine_Query_Set.html +++ b/tests_old/coverage/Doctrine_Query_Set.html @@ -10,181 +10,181 @@

Coverage for Doctrine_Query_Set

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: From.php 1080 2007-02-10 18:17:08Z romanb $ + *  $Id: From.php 1080 2007-02-10 18:17:08Z romanb $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload("Doctrine_Query_Part"); +Doctrine::autoload("Doctrine_Query_Part");
22/** +/**
23 * Doctrine_Query_Select + * Doctrine_Query_Select
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Query + * @subpackage  Query
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 1080 $ + * @version     $Revision: 1080 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Query_Select extends Doctrine_Query_Part +class Doctrine_Query_Select extends Doctrine_Query_Part
34{ +{
35    public function parse($dql)  +    public function parse($dql) 
36    { +    {
37        $this->query->parseSelect($dql); +        $this->query->parseSelect($dql);
38    } +    }
39 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Query_Tokenizer.html b/tests_old/coverage/Doctrine_Query_Tokenizer.html index 285855037..e33c3c661 100644 --- a/tests_old/coverage/Doctrine_Query_Tokenizer.html +++ b/tests_old/coverage/Doctrine_Query_Tokenizer.html @@ -64,7 +64,7 @@ - -
1<?php +<?php
2/* +/*
3 *  $Id: Set.php 3212 2007-11-24 18:58:33Z romanb $ + *  $Id: Set.php 3212 2007-11-24 18:58:33Z romanb $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Query_Part'); +Doctrine::autoload('Doctrine_Query_Part');
22/** +/**
23 * Doctrine_Query + * Doctrine_Query
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Query + * @subpackage  Query
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 3212 $ + * @version     $Revision: 3212 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Query_Set extends Doctrine_Query_Part +class Doctrine_Query_Set extends Doctrine_Query_Part
34{ +{
35    public function parse($dql) +    public function parse($dql)
36    { +    {
37     $terms = $this->_tokenizer->sqlExplode($dql, ' '); +     $terms = $this->_tokenizer->sqlExplode($dql, ' ');
38     +    
39     foreach ($terms as $term) { +     foreach ($terms as $term) {
40 +
41            preg_match_all("/[a-z0-9_]+\.[a-z0-9_]+[\.[a-z0-9]+]*/i", $term, $m); +            preg_match_all("/[a-z0-9_]+\.[a-z0-9_]+[\.[a-z0-9]+]*/i", $term, $m);
42     +    
43            if (isset($m[0])) { +            if (isset($m[0])) {
44                foreach ($m[0] as $part) { +                foreach ($m[0] as $part) {
45                    $e   = explode('.', trim($part)); +                    $e   = explode('.', trim($part));
46                    $field = array_pop($e); +                    $field = array_pop($e);
47         +        
48                    $reference = implode('.', $e); +                    $reference = implode('.', $e);
49         +        
50                    $alias = $this->query->getTableAlias($reference); +                    $alias = $this->query->getTableAlias($reference);
51                    $map   = $this->query->getAliasDeclaration($reference); +                    $map   = $this->query->getAliasDeclaration($reference);
52         +        
53                    $dql = str_replace($part, $map['table']->getColumnName($field), $dql); +                    $dql = str_replace($part, $map['table']->getColumnName($field), $dql);
54                } +                }
55            } +            }
56        } +        }
57 +
58        return $dql; +        return $dql;
59    } +    }
60 }
 * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -91,7 +91,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Query_Where.html b/tests_old/coverage/Doctrine_Query_Where.html index f3acb08df..7facd727b 100644 --- a/tests_old/coverage/Doctrine_Query_Where.html +++ b/tests_old/coverage/Doctrine_Query_Where.html @@ -10,513 +10,513 @@

Coverage for Doctrine_Query_Where

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: Where.php 3212 2007-11-24 18:58:33Z romanb $ + *  $Id: Where.php 3212 2007-11-24 18:58:33Z romanb $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Query_Condition'); +Doctrine::autoload('Doctrine_Query_Condition');
22/** +/**
23 * Doctrine_Query_Where + * Doctrine_Query_Where
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Query + * @subpackage  Query
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 3212 $ + * @version     $Revision: 3212 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Query_Where extends Doctrine_Query_Condition +class Doctrine_Query_Where extends Doctrine_Query_Condition
34{ +{
35    public function load($where)  +    public function load($where) 
36    { +    {
37        $where = $this->_tokenizer->bracketTrim(trim($where)); +        $where = $this->_tokenizer->bracketTrim(trim($where));
38        $conn  = $this->query->getConnection(); +        $conn  = $this->query->getConnection();
39        $terms = $this->_tokenizer->sqlExplode($where);   +        $terms = $this->_tokenizer->sqlExplode($where);  
40 +
41        if (count($terms) > 1) { +        if (count($terms) > 1) {
42            if (substr($where, 0, 6) == 'EXISTS') { +            if (substr($where, 0, 6) == 'EXISTS') {
43                return $this->parseExists($where, true); +                return $this->parseExists($where, true);
44            } elseif (substr($where, 0, 10) == 'NOT EXISTS') { +            } elseif (substr($where, 0, 10) == 'NOT EXISTS') {
45                return $this->parseExists($where, false); +                return $this->parseExists($where, false);
46            } +            }
47        } +        }
48 +
49        if (count($terms) < 3) { +        if (count($terms) < 3) {
50            $terms = $this->_tokenizer->sqlExplode($where, array('=', '<', '<>', '>', '!=')); +            $terms = $this->_tokenizer->sqlExplode($where, array('=', '<', '<>', '>', '!='));
51        } +        }
52 +
53        if (count($terms) > 1) { +        if (count($terms) > 1) {
54            $first = array_shift($terms); +            $first = array_shift($terms);
55            $value = array_pop($terms); +            $value = array_pop($terms);
56            $operator = trim(substr($where, strlen($first), -strlen($value))); +            $operator = trim(substr($where, strlen($first), -strlen($value)));
57            $table = null; +            $table = null;
58            $field = null; +            $field = null;
59 +
60            if (strpos($first, "'") === false && strpos($first, '(') === false) { +            if (strpos($first, "'") === false && strpos($first, '(') === false) {
61                // normal field reference found +                // normal field reference found
62                $a = explode('.', $first); +                $a = explode('.', $first);
63         +        
64                $field = array_pop($a); +                $field = array_pop($a);
65                $reference = implode('.', $a); +                $reference = implode('.', $a);
66                 +                
67                if (empty($reference)) { +                if (empty($reference)) {
68                    $map = $this->query->getRootDeclaration();   +                    $map = $this->query->getRootDeclaration();  
69                     +                    
70                    $alias = $this->query->getTableAlias($this->query->getRootAlias()); +                    $alias = $this->query->getTableAlias($this->query->getRootAlias());
71                    $table = $map['table']; +                    $table = $map['table'];
72                } else { +                } else {
73                    $map = $this->query->load($reference, false); +                    $map = $this->query->load($reference, false);
74     +    
75                    $alias = $this->query->getTableAlias($reference); +                    $alias = $this->query->getTableAlias($reference);
76                    $table = $map['table']; +                    $table = $map['table'];
77                } +                }
78            } +            }
79            $first = $this->query->parseClause($first); +            $first = $this->query->parseClause($first);
80 +
81            $sql = $first . ' ' . $operator . ' ' . $this->parseValue($value, $table, $field); +            $sql = $first . ' ' . $operator . ' ' . $this->parseValue($value, $table, $field);
82         +        
83            return $sql;   +            return $sql;  
84        } else { +        } else {
85 +
86        } +        }
87    } +    }
88 +
89    public function parseValue($value, Doctrine_Table $table = null, $field = null) +    public function parseValue($value, Doctrine_Table $table = null, $field = null)
90    { +    {
91        if (substr($value, 0, 1) == '(') { +        if (substr($value, 0, 1) == '(') {
92            // trim brackets +            // trim brackets
93            $trimmed = $this->_tokenizer->bracketTrim($value); +            $trimmed = $this->_tokenizer->bracketTrim($value);
94 +
95            if (substr($trimmed, 0, 4) == 'FROM' || +            if (substr($trimmed, 0, 4) == 'FROM' ||
96                substr($trimmed, 0, 6) == 'SELECT') { +                substr($trimmed, 0, 6) == 'SELECT') {
97 +
98                // subquery found +                // subquery found
99                $q     = new Doctrine_Query(); +                $q     = new Doctrine_Query();
100                $value = '(' . $this->query->createSubquery()->parseQuery($trimmed, false)->getQuery() . ')'; +                $value = '(' . $this->query->createSubquery()->parseQuery($trimmed, false)->getQuery() . ')';
101 +
102            } elseif (substr($trimmed, 0, 4) == 'SQL:') { +            } elseif (substr($trimmed, 0, 4) == 'SQL:') {
103                $value = '(' . substr($trimmed, 4) . ')'; +                $value = '(' . substr($trimmed, 4) . ')';
104            } else { +            } else {
105                // simple in expression found +                // simple in expression found
106                $e = $this->_tokenizer->sqlExplode($trimmed, ','); +                $e = $this->_tokenizer->sqlExplode($trimmed, ',');
107 +
108                $value = array(); +                $value = array();
109 +
110                $index = false; +                $index = false;
111 +
112                foreach ($e as $part) { +                foreach ($e as $part) {
113                    if (isset($table) && isset($field)) { +                    if (isset($table) && isset($field)) {
114                        $index = $table->enumIndex($field, trim($part, "'")); +                        $index = $table->enumIndex($field, trim($part, "'"));
115                    } +                    }
116 +
117                    if ($index !== false) { +                    if ($index !== false) {
118                        $value[] = $index; +                        $value[] = $index;
119                    } else { +                    } else {
120                        $value[] = $this->parseLiteralValue($part); +                        $value[] = $this->parseLiteralValue($part);
121                    } +                    }
122                } +                }
123 +
124                $value = '(' . implode(', ', $value) . ')'; +                $value = '(' . implode(', ', $value) . ')';
125            } +            }
126        } else if (substr($value, 0, 1) == ':' || $value === '?') { +        } else if (substr($value, 0, 1) == ':' || $value === '?') {
127            // placeholder found +            // placeholder found
128            if (isset($table) && isset($field) && $table->getTypeOf($field) == 'enum') { +            if (isset($table) && isset($field) && $table->getTypeOf($field) == 'enum') {
129                $this->query->addEnumParam($value, $table, $field); +                $this->query->addEnumParam($value, $table, $field);
130            } else { +            } else {
131                $this->query->addEnumParam($value, null, null); +                $this->query->addEnumParam($value, null, null);
132            } +            }
133        } else { +        } else {
134            $enumIndex = false; +            $enumIndex = false;
135            if (isset($table) && isset($field)) { +            if (isset($table) && isset($field)) {
136                // check if value is enumerated value +                // check if value is enumerated value
137                $enumIndex = $table->enumIndex($field, trim($value, "'")); +                $enumIndex = $table->enumIndex($field, trim($value, "'"));
138            } +            }
139 +
140            if ($enumIndex !== false) { +            if ($enumIndex !== false) {
141                $value = $enumIndex; +                $value = $enumIndex;
142            } else { +            } else {
143                $value = $this->parseLiteralValue($value); +                $value = $this->parseLiteralValue($value);
144            } +            }
145        } +        }
146        return $value; +        return $value;
147    } +    }
148 +
149    /** +    /**
150     * parses an EXISTS expression +     * parses an EXISTS expression
151     * +     *
152     * @param string $where         query where part to be parsed +     * @param string $where         query where part to be parsed
153     * @param boolean $negation     whether or not to use the NOT keyword +     * @param boolean $negation     whether or not to use the NOT keyword
154     * @return string +     * @return string
155     */ +     */
156    public function parseExists($where, $negation) +    public function parseExists($where, $negation)
157    { +    {
158        $operator = ($negation) ? 'EXISTS' : 'NOT EXISTS'; +        $operator = ($negation) ? 'EXISTS' : 'NOT EXISTS';
159 +
160        $pos = strpos($where, '('); +        $pos = strpos($where, '(');
161 +
162        if ($pos == false) { +        if ($pos == false) {
163            throw new Doctrine_Query_Exception('Unknown expression, expected a subquery with () -marks'); +            throw new Doctrine_Query_Exception('Unknown expression, expected a subquery with () -marks');
164        } +        }
165 +
166        $sub = $this->_tokenizer->bracketTrim(substr($where, $pos)); +        $sub = $this->_tokenizer->bracketTrim(substr($where, $pos));
167 +
168        return $operator . ' (' . $this->query->createSubquery()->parseQuery($sub, false)->getQuery() . ')'; +        return $operator . ' (' . $this->query->createSubquery()->parseQuery($sub, false)->getQuery() . ')';
169    } +    }
170} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_RawSql.html b/tests_old/coverage/Doctrine_RawSql.html index 5ee4e03dd..66d12ef59 100644 --- a/tests_old/coverage/Doctrine_RawSql.html +++ b/tests_old/coverage/Doctrine_RawSql.html @@ -10,993 +10,993 @@

Coverage for Doctrine_RawSql

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: RawSql.php 3209 2007-11-24 18:11:09Z romanb $ + *  $Id: RawSql.php 3209 2007-11-24 18:11:09Z romanb $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Query_Abstract'); +Doctrine::autoload('Doctrine_Query_Abstract');
22/** +/**
23 * Doctrine_RawSql + * Doctrine_RawSql
24 * + *
25 * Doctrine_RawSql is an implementation of Doctrine_Query_Abstract that skips the entire + * Doctrine_RawSql is an implementation of Doctrine_Query_Abstract that skips the entire
26 * DQL parsing procedure. The "DQL" that is passed to a RawSql query object for execution + * DQL parsing procedure. The "DQL" that is passed to a RawSql query object for execution
27 * is considered to be plain SQL and will be used "as is". The only query part that is special + * is considered to be plain SQL and will be used "as is". The only query part that is special
28 * in a RawSql query is the SELECT part, which has a special syntax that provides Doctrine + * in a RawSql query is the SELECT part, which has a special syntax that provides Doctrine
29 * with the necessary information to properly hydrate the query results. + * with the necessary information to properly hydrate the query results.
30 * + *
31 * @package     Doctrine + * @package     Doctrine
32 * @subpackage  RawSql + * @subpackage  RawSql
33 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
34 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
35 * @since       1.0 + * @since       1.0
36 * @version     $Revision: 3209 $ + * @version     $Revision: 3209 $
37 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
38 */ + */
39class Doctrine_RawSql extends Doctrine_Query_Abstract +class Doctrine_RawSql extends Doctrine_Query_Abstract
40{ +{
41    /** +    /**
42     * @var array $fields +     * @var array $fields
43     */ +     */
44    private $fields = array(); +    private $fields = array();
45     +    
46    /** +    /**
47     * @deprecated +     * @deprecated
48     */ +     */
49    public function parseQueryPart($queryPartName, $queryPart, $append = false) +    public function parseQueryPart($queryPartName, $queryPart, $append = false)
50    { +    {
51        return $this->parseDqlQueryPart($queryPartName, $queryPart, $append); +        return $this->parseDqlQueryPart($queryPartName, $queryPart, $append);
52    } +    }
53 +
54    /** +    /**
55     * parseDqlQueryPart +     * parseDqlQueryPart
56     * parses given DQL query part. Overrides Doctrine_Query_Abstract::parseDqlQueryPart(). +     * parses given DQL query part. Overrides Doctrine_Query_Abstract::parseDqlQueryPart().
57     * This implementation does no parsing at all, except of the SELECT portion of the query +     * This implementation does no parsing at all, except of the SELECT portion of the query
58     * which is special in RawSql queries. The entire remaining parts are used "as is", so +     * which is special in RawSql queries. The entire remaining parts are used "as is", so
59     * the user of the RawSql query is responsible for writing SQL that is portable between +     * the user of the RawSql query is responsible for writing SQL that is portable between
60     * different DBMS. +     * different DBMS.
61     * +     *
62     * @param string $queryPartName     the name of the query part +     * @param string $queryPartName     the name of the query part
63     * @param string $queryPart         query part to be parsed +     * @param string $queryPart         query part to be parsed
64     * @param boolean $append           whether or not to append the query part to its stack +     * @param boolean $append           whether or not to append the query part to its stack
65     *                                  if false is given, this method will overwrite +     *                                  if false is given, this method will overwrite
66     *                                  the given query part stack with $queryPart +     *                                  the given query part stack with $queryPart
67     * @return Doctrine_Query           this object +     * @return Doctrine_Query           this object
68     */ +     */
69  public function parseDqlQueryPart($queryPartName, $queryPart, $append = false) +  public function parseDqlQueryPart($queryPartName, $queryPart, $append = false)
70    { +    {
71        if ($queryPartName == 'select') { +        if ($queryPartName == 'select') {
72          $this->_parseSelectFields($queryPart); +          $this->_parseSelectFields($queryPart);
73          return $this; +          return $this;
74      } +      }
75      if ( ! isset($this->parts[$queryPartName])) { +      if ( ! isset($this->parts[$queryPartName])) {
76          $this->_sqlParts[$queryPartName] = array(); +          $this->_sqlParts[$queryPartName] = array();
77      } +      }
78      +     
79      if ( ! $append) { +      if ( ! $append) {
80          $this->_sqlParts[$queryPartName] = array($queryPart); +          $this->_sqlParts[$queryPartName] = array($queryPart);
81      } else { +      } else {
82          $this->_sqlParts[$queryPartName][] = $queryPart; +          $this->_sqlParts[$queryPartName][] = $queryPart;
83      } +      }
84      return $this; +      return $this;
85    } +    }
86     +    
87    /** +    /**
88     * Adds a DQL query part. Overrides Doctrine_Query_Abstract::_addDqlQueryPart(). +     * Adds a DQL query part. Overrides Doctrine_Query_Abstract::_addDqlQueryPart().
89     * This implementation for RawSql parses the new parts right away, generating the SQL. +     * This implementation for RawSql parses the new parts right away, generating the SQL.
90     */ +     */
91    protected function _addDqlQueryPart($queryPartName, $queryPart, $append = false) +    protected function _addDqlQueryPart($queryPartName, $queryPart, $append = false)
92    { +    {
93        return $this->parseQueryPart($queryPartName, $queryPart, $append); +        return $this->parseQueryPart($queryPartName, $queryPart, $append);
94    } +    }
95     +    
96    /** +    /**
97     * Add select parts to fields. +     * Add select parts to fields.
98     * +     *
99     * @param $queryPart sting The name of the querypart +     * @param $queryPart sting The name of the querypart
100     */ +     */
101    private function _parseSelectFields($queryPart){ +    private function _parseSelectFields($queryPart){
102        preg_match_all('/{([^}{]*)}/U', $queryPart, $m); +        preg_match_all('/{([^}{]*)}/U', $queryPart, $m);
103        $this->fields = $m[1]; +        $this->fields = $m[1];
104        $this->_sqlParts['select'] = array(); +        $this->_sqlParts['select'] = array();
105    } +    }
106     +    
107    /** +    /**
108     * parseDqlQuery +     * parseDqlQuery
109     * parses an sql query and adds the parts to internal array. +     * parses an sql query and adds the parts to internal array.
110     * Overrides Doctrine_Query_Abstract::parseDqlQuery(). +     * Overrides Doctrine_Query_Abstract::parseDqlQuery().
111     * This implementation simply tokenizes the provided query string and uses them +     * This implementation simply tokenizes the provided query string and uses them
112     * as SQL parts right away. +     * as SQL parts right away.
113     * +     *
114     * @param string $query     query to be parsed +     * @param string $query     query to be parsed
115     * @return Doctrine_RawSql  this object +     * @return Doctrine_RawSql  this object
116     */ +     */
117    public function parseDqlQuery($query) +    public function parseDqlQuery($query)
118    { +    {
119        $this->_parseSelectFields($query); +        $this->_parseSelectFields($query);
120        $this->clear(); +        $this->clear();
121 +
122        $tokens = $this->_tokenizer->sqlExplode($query, ' '); +        $tokens = $this->_tokenizer->sqlExplode($query, ' ');
123 +
124        $parts = array(); +        $parts = array();
125        foreach ($tokens as $key => $part) { +        foreach ($tokens as $key => $part) {
126            $partLowerCase = strtolower($part); +            $partLowerCase = strtolower($part);
127            switch ($partLowerCase) { +            switch ($partLowerCase) {
128                case 'select': +                case 'select':
129                case 'from': +                case 'from':
130                case 'where': +                case 'where':
131                case 'limit': +                case 'limit':
132                case 'offset': +                case 'offset':
133                case 'having': +                case 'having':
134                    $type = $partLowerCase; +                    $type = $partLowerCase;
135                    if ( ! isset($parts[$partLowerCase])) { +                    if ( ! isset($parts[$partLowerCase])) {
136                        $parts[$partLowerCase] = array(); +                        $parts[$partLowerCase] = array();
137                    } +                    }
138                    break; +                    break;
139                case 'order': +                case 'order':
140                case 'group': +                case 'group':
141                    $i = $key + 1; +                    $i = $key + 1;
142                    if (isset($tokens[$i]) && strtolower($tokens[$i]) === 'by') { +                    if (isset($tokens[$i]) && strtolower($tokens[$i]) === 'by') {
143                        $type = $partLowerCase . 'by'; +                        $type = $partLowerCase . 'by';
144                        $parts[$type] = array(); +                        $parts[$type] = array();
145                    } else { +                    } else {
146                        //not a keyword so we add it to the previous type +                        //not a keyword so we add it to the previous type
147                        $parts[$type][] = $part; +                        $parts[$type][] = $part;
148                    } +                    }
149                    break; +                    break;
150                case 'by': +                case 'by':
151                    continue; +                    continue;
152                default: +                default:
153                    //not a keyword so we add it to the previous type. +                    //not a keyword so we add it to the previous type.
154                    if ( ! isset($parts[$type][0])) { +                    if ( ! isset($parts[$type][0])) {
155                        $parts[$type][0] = $part; +                        $parts[$type][0] = $part;
156                    } else { +                    } else {
157                        // why does this add to index 0 and not append to the  +                        // why does this add to index 0 and not append to the 
158                        // array. If it had done that one could have used  +                        // array. If it had done that one could have used 
159                        // parseQueryPart. +                        // parseQueryPart.
160                        $parts[$type][0] .= ' '.$part; +                        $parts[$type][0] .= ' '.$part;
161                    } +                    }
162            } +            }
163        } +        }
164 +
165        $this->_sqlParts = $parts; +        $this->_sqlParts = $parts;
166        $this->_sqlParts['select'] = array(); +        $this->_sqlParts['select'] = array();
167 +
168        return $this; +        return $this;
169    } +    }
170 +
171    /** +    /**
172     * getSqlQuery +     * getSqlQuery
173     * builds the sql query. +     * builds the sql query.
174     * +     *
175     * @return string       the built sql query +     * @return string       the built sql query
176     */ +     */
177    public function getSqlQuery($params = array()) +    public function getSqlQuery($params = array())
178    {         +    {        
179        $select = array(); +        $select = array();
180 +
181        foreach ($this->fields as $field) { +        foreach ($this->fields as $field) {
182            $e = explode('.', $field); +            $e = explode('.', $field);
183            if ( ! isset($e[1])) { +            if ( ! isset($e[1])) {
184                throw new Doctrine_RawSql_Exception('All selected fields in Sql query must be in format tableAlias.fieldName'); +                throw new Doctrine_RawSql_Exception('All selected fields in Sql query must be in format tableAlias.fieldName');
185            } +            }
186            // try to auto-add component +            // try to auto-add component
187            if ( ! $this->hasSqlTableAlias($e[0])) { +            if ( ! $this->hasSqlTableAlias($e[0])) {
188                try { +                try {
189                    $this->addComponent($e[0], ucwords($e[0])); +                    $this->addComponent($e[0], ucwords($e[0]));
190                } catch (Doctrine_Exception $exception) { +                } catch (Doctrine_Exception $exception) {
191                    throw new Doctrine_RawSql_Exception('The associated component for table alias ' . $e[0] . ' couldn\'t be found.'); +                    throw new Doctrine_RawSql_Exception('The associated component for table alias ' . $e[0] . ' couldn\'t be found.');
192                } +                }
193            } +            }
194 +
195            $componentAlias = $this->getComponentAlias($e[0]); +            $componentAlias = $this->getComponentAlias($e[0]);
196             +            
197            if ($e[1] == '*') { +            if ($e[1] == '*') {
198                foreach ($this->_queryComponents[$componentAlias]['table']->getColumnNames() as $name) { +                foreach ($this->_queryComponents[$componentAlias]['table']->getColumnNames() as $name) {
199                    $field = $e[0] . '.' . $name; +                    $field = $e[0] . '.' . $name;
200 +
201                    $select[$componentAlias][$field] = $field . ' AS ' . $e[0] . '__' . $name; +                    $select[$componentAlias][$field] = $field . ' AS ' . $e[0] . '__' . $name;
202                } +                }
203            } else { +            } else {
204                $field = $e[0] . '.' . $e[1]; +                $field = $e[0] . '.' . $e[1];
205                $select[$componentAlias][$field] = $field . ' AS ' . $e[0] . '__' . $e[1]; +                $select[$componentAlias][$field] = $field . ' AS ' . $e[0] . '__' . $e[1];
206            } +            }
207        } +        }
208 +
209        // force-add all primary key fields +        // force-add all primary key fields
210 +
211        foreach ($this->getTableAliasMap() as $tableAlias => $componentAlias) { +        foreach ($this->getTableAliasMap() as $tableAlias => $componentAlias) {
212            $map = $this->_queryComponents[$componentAlias]; +            $map = $this->_queryComponents[$componentAlias];
213 +
214            foreach ((array) $map['table']->getIdentifier() as $key) { +            foreach ((array) $map['table']->getIdentifier() as $key) {
215                $field = $tableAlias . '.' . $key; +                $field = $tableAlias . '.' . $key;
216 +
217                if ( ! isset($this->_sqlParts['select'][$field])) { +                if ( ! isset($this->_sqlParts['select'][$field])) {
218                    $select[$componentAlias][$field] = $field . ' AS ' . $tableAlias . '__' . $key; +                    $select[$componentAlias][$field] = $field . ' AS ' . $tableAlias . '__' . $key;
219                } +                }
220            } +            }
221        } +        }
222         +        
223        // first add the fields of the root component +        // first add the fields of the root component
224        reset($this->_queryComponents); +        reset($this->_queryComponents);
225        $componentAlias = key($this->_queryComponents); +        $componentAlias = key($this->_queryComponents);
226 +
227        $q = 'SELECT ' . implode(', ', $select[$componentAlias]); +        $q = 'SELECT ' . implode(', ', $select[$componentAlias]);
228        unset($select[$componentAlias]); +        unset($select[$componentAlias]);
229 +
230        foreach ($select as $component => $fields) { +        foreach ($select as $component => $fields) {
231            if ( ! empty($fields)) { +            if ( ! empty($fields)) {
232                $q .= ', ' . implode(', ', $fields); +                $q .= ', ' . implode(', ', $fields);
233            } +            }
234        } +        }
235 +
236        $string = $this->applyInheritance(); +        $string = $this->applyInheritance();
237        if ( ! empty($string)) { +        if ( ! empty($string)) {
238            $this->_sqlParts['where'][] = $string; +            $this->_sqlParts['where'][] = $string;
239        } +        }
240        $copy = $this->_sqlParts; +        $copy = $this->_sqlParts;
241        unset($copy['select']); +        unset($copy['select']);
242 +
243        $q .= ( ! empty($this->_sqlParts['from']))?    ' FROM '     . implode(' ', $this->_sqlParts['from']) : ''; +        $q .= ( ! empty($this->_sqlParts['from']))?    ' FROM '     . implode(' ', $this->_sqlParts['from']) : '';
244        $q .= ( ! empty($this->_sqlParts['where']))?   ' WHERE '    . implode(' AND ', $this->_sqlParts['where']) : ''; +        $q .= ( ! empty($this->_sqlParts['where']))?   ' WHERE '    . implode(' AND ', $this->_sqlParts['where']) : '';
245        $q .= ( ! empty($this->_sqlParts['groupby']))? ' GROUP BY ' . implode(', ', $this->_sqlParts['groupby']) : ''; +        $q .= ( ! empty($this->_sqlParts['groupby']))? ' GROUP BY ' . implode(', ', $this->_sqlParts['groupby']) : '';
246        $q .= ( ! empty($this->_sqlParts['having']))?  ' HAVING '   . implode(' AND ', $this->_sqlParts['having']) : ''; +        $q .= ( ! empty($this->_sqlParts['having']))?  ' HAVING '   . implode(' AND ', $this->_sqlParts['having']) : '';
247        $q .= ( ! empty($this->_sqlParts['orderby']))? ' ORDER BY ' . implode(', ', $this->_sqlParts['orderby']) : ''; +        $q .= ( ! empty($this->_sqlParts['orderby']))? ' ORDER BY ' . implode(', ', $this->_sqlParts['orderby']) : '';
248        $q .= ( ! empty($this->_sqlParts['limit']))?   ' LIMIT ' . implode(' ', $this->_sqlParts['limit']) : ''; +        $q .= ( ! empty($this->_sqlParts['limit']))?   ' LIMIT ' . implode(' ', $this->_sqlParts['limit']) : '';
249        $q .= ( ! empty($this->_sqlParts['offset']))?  ' OFFSET ' . implode(' ', $this->_sqlParts['offset']) : ''; +        $q .= ( ! empty($this->_sqlParts['offset']))?  ' OFFSET ' . implode(' ', $this->_sqlParts['offset']) : '';
250 +
251        if ( ! empty($string)) { +        if ( ! empty($string)) {
252            array_pop($this->_sqlParts['where']); +            array_pop($this->_sqlParts['where']);
253        } +        }
254        return $q; +        return $q;
255    } +    }
256 +
257    /** +    /**
258     * getFields +     * getFields
259     * returns the fields associated with this parser +     * returns the fields associated with this parser
260     * +     *
261     * @return array    all the fields associated with this parser +     * @return array    all the fields associated with this parser
262     */ +     */
263    public function getFields() +    public function getFields()
264    { +    {
265        return $this->fields; +        return $this->fields;
266    } +    }
267 +
268    /** +    /**
269     * addComponent +     * addComponent
270     * +     *
271     * @param string $tableAlias +     * @param string $tableAlias
272     * @param string $componentName +     * @param string $componentName
273     * @return Doctrine_RawSql +     * @return Doctrine_RawSql
274     */ +     */
275    public function addComponent($tableAlias, $path) +    public function addComponent($tableAlias, $path)
276    { +    {
277        $tmp           = explode(' ', $path); +        $tmp           = explode(' ', $path);
278        $originalAlias = (count($tmp) > 1) ? end($tmp) : null; +        $originalAlias = (count($tmp) > 1) ? end($tmp) : null;
279 +
280        $e = explode('.', $tmp[0]); +        $e = explode('.', $tmp[0]);
281 +
282        $fullPath = $tmp[0]; +        $fullPath = $tmp[0];
283        $fullLength = strlen($fullPath); +        $fullLength = strlen($fullPath);
284 +
285        $table = null; +        $table = null;
286 +
287        $currPath = ''; +        $currPath = '';
288 +
289        if (isset($this->_queryComponents[$e[0]])) { +        if (isset($this->_queryComponents[$e[0]])) {
290            $table = $this->_queryComponents[$e[0]]['table']; +            $table = $this->_queryComponents[$e[0]]['table'];
291 +
292            $currPath = $parent = array_shift($e); +            $currPath = $parent = array_shift($e);
293        } +        }
294 +
295        foreach ($e as $k => $component) { +        foreach ($e as $k => $component) {
296            // get length of the previous path +            // get length of the previous path
297            $length = strlen($currPath); +            $length = strlen($currPath);
298 +
299            // build the current component path +            // build the current component path
300            $currPath = ($currPath) ? $currPath . '.' . $component : $component; +            $currPath = ($currPath) ? $currPath . '.' . $component : $component;
301 +
302            $delimeter = substr($fullPath, $length, 1); +            $delimeter = substr($fullPath, $length, 1);
303 +
304            // if an alias is not given use the current path as an alias identifier +            // if an alias is not given use the current path as an alias identifier
305            if (strlen($currPath) === $fullLength && isset($originalAlias)) { +            if (strlen($currPath) === $fullLength && isset($originalAlias)) {
306                $componentAlias = $originalAlias; +                $componentAlias = $originalAlias;
307            } else { +            } else {
308                $componentAlias = $currPath; +                $componentAlias = $currPath;
309            } +            }
310            if ( ! isset($table)) { +            if ( ! isset($table)) {
311                $conn = Doctrine_Manager::getInstance() +                $conn = Doctrine_Manager::getInstance()
312                        ->getConnectionForComponent($component); +                        ->getConnectionForComponent($component);
313                         +                        
314                $table = $conn->getTable($component); +                $table = $conn->getTable($component);
315                $this->_queryComponents[$componentAlias] = array('table' => $table); +                $this->_queryComponents[$componentAlias] = array('table' => $table);
316            } else { +            } else {
317                $relation = $table->getRelation($component); +                $relation = $table->getRelation($component);
318 +
319                $this->_queryComponents[$componentAlias] = array('table'    => $relation->getTable(), +                $this->_queryComponents[$componentAlias] = array('table'    => $relation->getTable(),
320                                                          'parent'   => $parent, +                                                          'parent'   => $parent,
321                                                          'relation' => $relation); +                                                          'relation' => $relation);
322            } +            }
323            $this->addSqlTableAlias($tableAlias, $componentAlias); +            $this->addSqlTableAlias($tableAlias, $componentAlias);
324 +
325            $parent = $currPath; +            $parent = $currPath;
326        } +        }
327 +
328        return $this; +        return $this;
329    } +    }
330} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_RawSql_Exception.html b/tests_old/coverage/Doctrine_RawSql_Exception.html index 0cf53f43e..aa895b3d6 100644 --- a/tests_old/coverage/Doctrine_RawSql_Exception.html +++ b/tests_old/coverage/Doctrine_RawSql_Exception.html @@ -10,103 +10,103 @@

Coverage for Doctrine_RawSql_Exception

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Record.html b/tests_old/coverage/Doctrine_Record.html index f8f17052e..be48c0584 100644 --- a/tests_old/coverage/Doctrine_Record.html +++ b/tests_old/coverage/Doctrine_Record.html @@ -64,7 +64,7 @@ - -
1<?php +<?php
2/* +/*
3 *  $Id: Exception.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $ + *  $Id: Exception.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Exception'); +Doctrine::autoload('Doctrine_Exception');
22/** +/**
23 * Doctrine_RawSql_Exception + * Doctrine_RawSql_Exception
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  RawSql + * @subpackage  RawSql
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 2702 $ + * @version     $Revision: 2702 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_RawSql_Exception extends Doctrine_Exception +class Doctrine_RawSql_Exception extends Doctrine_Exception
34 { }
 * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -97,7 +97,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Record_Abstract.html b/tests_old/coverage/Doctrine_Record_Abstract.html index 01cbf0c25..313c1fccf 100644 --- a/tests_old/coverage/Doctrine_Record_Abstract.html +++ b/tests_old/coverage/Doctrine_Record_Abstract.html @@ -10,1005 +10,1005 @@

Coverage for Doctrine_Record_Abstract

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id$ + *  $Id$
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Access'); +Doctrine::autoload('Doctrine_Access');
22/** +/**
23 * Doctrine_Record_Abstract + * Doctrine_Record_Abstract
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Record + * @subpackage  Record
27 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30 * @since       1.0 + * @since       1.0
31 * @version     $Revision$ + * @version     $Revision$
32 */ + */
33abstract class Doctrine_Record_Abstract extends Doctrine_Access +abstract class Doctrine_Record_Abstract extends Doctrine_Access
34{ +{
35    /** +    /**
36     * @param Doctrine_Table $_table     reference to associated Doctrine_Table instance +     * @param Doctrine_Table $_table     reference to associated Doctrine_Table instance
37     */ +     */
38    protected $_table; +    protected $_table;
39 +
40    /** +    /**
41     * addListener +     * addListener
42     * +     *
43     * @param Doctrine_EventListener_Interface|Doctrine_Overloadable $listener +     * @param Doctrine_EventListener_Interface|Doctrine_Overloadable $listener
44     * @return Doctrine_Record +     * @return Doctrine_Record
45     */ +     */
46    public function addListener($listener, $name = null) +    public function addListener($listener, $name = null)
47    { +    {
48        $this->_table->addRecordListener($listener, $name = null); +        $this->_table->addRecordListener($listener, $name = null);
49 +
50        return $this; +        return $this;
51    } +    }
52 +
53    /** +    /**
54     * getListener +     * getListener
55     * +     *
56     * @return Doctrine_EventListener_Interface|Doctrine_Overloadable +     * @return Doctrine_EventListener_Interface|Doctrine_Overloadable
57     */ +     */
58    public function getListener() +    public function getListener()
59    { +    {
60        return $this->_table->getRecordListener(); +        return $this->_table->getRecordListener();
61    } +    }
62 +
63    /** +    /**
64     * setListener +     * setListener
65     * +     *
66     * @param Doctrine_EventListener_Interface|Doctrine_Overloadable $listener +     * @param Doctrine_EventListener_Interface|Doctrine_Overloadable $listener
67     * @return Doctrine_Record +     * @return Doctrine_Record
68     */ +     */
69    public function setListener($listener) +    public function setListener($listener)
70    { +    {
71        $this->_table->setRecordListener($listener); +        $this->_table->setRecordListener($listener);
72 +
73        return $this; +        return $this;
74    } +    }
75 +
76    /** +    /**
77     * index +     * index
78     * defines or retrieves an index +     * defines or retrieves an index
79     * if the second parameter is set this method defines an index +     * if the second parameter is set this method defines an index
80     * if not this method retrieves index named $name +     * if not this method retrieves index named $name
81     * +     *
82     * @param string $name              the name of the index +     * @param string $name              the name of the index
83     * @param array $definition         the definition array +     * @param array $definition         the definition array
84     * @return mixed +     * @return mixed
85     */ +     */
86    public function index($name, array $definition = array()) +    public function index($name, array $definition = array())
87    { +    {
88        if ( ! $definition) { +        if ( ! $definition) {
89            return $this->_table->getIndex($name); +            return $this->_table->getIndex($name);
90        } else { +        } else {
91            return $this->_table->addIndex($name, $definition); +            return $this->_table->addIndex($name, $definition);
92        } +        }
93    } +    }
94    public function setAttribute($attr, $value) +    public function setAttribute($attr, $value)
95    { +    {
96        $this->_table->setAttribute($attr, $value); +        $this->_table->setAttribute($attr, $value);
97    } +    }
98    public function setTableName($tableName) +    public function setTableName($tableName)
99    { +    {
100        $this->_table->setTableName($tableName); +        $this->_table->setTableName($tableName);
101    } +    }
102    public function setInheritanceMap($map) +    public function setInheritanceMap($map)
103    { +    {
104        $this->_table->setOption('inheritanceMap', $map); +        $this->_table->setOption('inheritanceMap', $map);
105    } +    }
106 +
107    public function setSubclasses($map) +    public function setSubclasses($map)
108    { +    {
109        if (isset($map[get_class($this)])) { +        if (isset($map[get_class($this)])) {
110            $this->_table->setOption('inheritanceMap', $map[get_class($this)]); +            $this->_table->setOption('inheritanceMap', $map[get_class($this)]);
111            return; +            return;
112        } +        }
113        $this->_table->setOption('subclasses', array_keys($map)); +        $this->_table->setOption('subclasses', array_keys($map));
114        $conn = $this->_table->getConnection();  +        $conn = $this->_table->getConnection(); 
115        foreach ($map as $key => $value) { +        foreach ($map as $key => $value) {
116            $table = $conn->getTable($key); +            $table = $conn->getTable($key);
117            $table->setOption('inheritanceMap', $value); +            $table->setOption('inheritanceMap', $value);
118        } +        }
119    } +    }
120 +
121    /** +    /**
122     * attribute +     * attribute
123     * sets or retrieves an option +     * sets or retrieves an option
124     * +     *
125     * @see Doctrine::ATTR_* constants   availible attributes +     * @see Doctrine::ATTR_* constants   availible attributes
126     * @param mixed $attr +     * @param mixed $attr
127     * @param mixed $value +     * @param mixed $value
128     * @return mixed +     * @return mixed
129     */ +     */
130    public function attribute($attr, $value) +    public function attribute($attr, $value)
131    { +    {
132        if ($value == null) { +        if ($value == null) {
133            if (is_array($attr)) { +            if (is_array($attr)) {
134                foreach ($attr as $k => $v) { +                foreach ($attr as $k => $v) {
135                    $this->_table->setAttribute($k, $v); +                    $this->_table->setAttribute($k, $v);
136                } +                }
137            } else { +            } else {
138                return $this->_table->getAttribute($attr); +                return $this->_table->getAttribute($attr);
139            } +            }
140        } else { +        } else {
141            $this->_table->setAttribute($attr, $value); +            $this->_table->setAttribute($attr, $value);
142        }     +        }    
143    } +    }
144 +
145    /** +    /**
146     * option +     * option
147     * sets or retrieves an option +     * sets or retrieves an option
148     * +     *
149     * @see Doctrine_Table::$options    availible options +     * @see Doctrine_Table::$options    availible options
150     * @param mixed $name               the name of the option +     * @param mixed $name               the name of the option
151     * @param mixed $value              options value +     * @param mixed $value              options value
152     * @return mixed +     * @return mixed
153     */ +     */
154    public function option($name, $value = null) +    public function option($name, $value = null)
155    { +    {
156        if ($value === null) { +        if ($value === null) {
157            if (is_array($name)) { +            if (is_array($name)) {
158                foreach ($name as $k => $v) { +                foreach ($name as $k => $v) {
159                    $this->_table->setOption($k, $v); +                    $this->_table->setOption($k, $v);
160                } +                }
161            } else { +            } else {
162                return $this->_table->getOption($name); +                return $this->_table->getOption($name);
163            } +            }
164        } else { +        } else {
165            $this->_table->setOption($name, $value); +            $this->_table->setOption($name, $value);
166        } +        }
167    } +    }
168 +
169    /** +    /**
170     * ownsOne +     * ownsOne
171     * binds One-to-One composite relation +     * binds One-to-One composite relation
172     * +     *
173     * @param string $componentName     the name of the related component +     * @param string $componentName     the name of the related component
174     * @param string $options           relation options +     * @param string $options           relation options
175     * @see Doctrine_Relation::_$definition +     * @see Doctrine_Relation::_$definition
176     * @return Doctrine_Record          this object +     * @return Doctrine_Record          this object
177     */ +     */
178    public function ownsOne() +    public function ownsOne()
179    { +    {
180        $this->_table->bind(func_get_args(), Doctrine_Relation::ONE_COMPOSITE); +        $this->_table->bind(func_get_args(), Doctrine_Relation::ONE_COMPOSITE);
181         +        
182        return $this; +        return $this;
183    } +    }
184 +
185    /** +    /**
186     * ownsMany +     * ownsMany
187     * binds One-to-Many / Many-to-Many composite relation +     * binds One-to-Many / Many-to-Many composite relation
188     * +     *
189     * @param string $componentName     the name of the related component +     * @param string $componentName     the name of the related component
190     * @param string $options           relation options +     * @param string $options           relation options
191     * @see Doctrine_Relation::_$definition +     * @see Doctrine_Relation::_$definition
192     * @return Doctrine_Record          this object +     * @return Doctrine_Record          this object
193     */ +     */
194    public function ownsMany() +    public function ownsMany()
195    { +    {
196        $this->_table->bind(func_get_args(), Doctrine_Relation::MANY_COMPOSITE); +        $this->_table->bind(func_get_args(), Doctrine_Relation::MANY_COMPOSITE);
197        return $this; +        return $this;
198    } +    }
199 +
200    /** +    /**
201     * hasOne +     * hasOne
202     * binds One-to-One aggregate relation +     * binds One-to-One aggregate relation
203     * +     *
204     * @param string $componentName     the name of the related component +     * @param string $componentName     the name of the related component
205     * @param string $options           relation options +     * @param string $options           relation options
206     * @see Doctrine_Relation::_$definition +     * @see Doctrine_Relation::_$definition
207     * @return Doctrine_Record          this object +     * @return Doctrine_Record          this object
208     */ +     */
209    public function hasOne() +    public function hasOne()
210    { +    {
211        $this->_table->bind(func_get_args(), Doctrine_Relation::ONE_AGGREGATE); +        $this->_table->bind(func_get_args(), Doctrine_Relation::ONE_AGGREGATE);
212 +
213        return $this; +        return $this;
214    } +    }
215 +
216    /** +    /**
217     * hasMany +     * hasMany
218     * binds One-to-Many / Many-to-Many aggregate relation +     * binds One-to-Many / Many-to-Many aggregate relation
219     * +     *
220     * @param string $componentName     the name of the related component +     * @param string $componentName     the name of the related component
221     * @param string $options           relation options +     * @param string $options           relation options
222     * @see Doctrine_Relation::_$definition +     * @see Doctrine_Relation::_$definition
223     * @return Doctrine_Record          this object +     * @return Doctrine_Record          this object
224     */ +     */
225    public function hasMany() +    public function hasMany()
226    { +    {
227        $this->_table->bind(func_get_args(), Doctrine_Relation::MANY_AGGREGATE); +        $this->_table->bind(func_get_args(), Doctrine_Relation::MANY_AGGREGATE);
228 +
229        return $this; +        return $this;
230    } +    }
231 +
232    /** +    /**
233     * hasColumn +     * hasColumn
234     * sets a column definition +     * sets a column definition
235     * +     *
236     * @param string $name +     * @param string $name
237     * @param string $type +     * @param string $type
238     * @param integer $length +     * @param integer $length
239     * @param mixed $options +     * @param mixed $options
240     * @return void +     * @return void
241     */ +     */
242    public function hasColumn($name, $type, $length = 2147483647, $options = "") +    public function hasColumn($name, $type, $length = 2147483647, $options = "")
243    { +    {
244        $this->_table->setColumn($name, $type, $length, $options); +        $this->_table->setColumn($name, $type, $length, $options);
245    } +    }
246    public function hasColumns(array $definitions) +    public function hasColumns(array $definitions)
247    { +    {
248        foreach ($definitions as $name => $options) { +        foreach ($definitions as $name => $options) {
249            $this->hasColumn($name, $options['type'], $options['length'], $options); +            $this->hasColumn($name, $options['type'], $options['length'], $options);
250        } +        }
251    }  +    } 
252    /** +    /**
253     * loadTemplate +     * loadTemplate
254     * +     *
255     * @param string $template +     * @param string $template
256     */ +     */
257    public function loadTemplate($template, array $options = array()) +    public function loadTemplate($template, array $options = array())
258    { +    {
259        $this->actAs($template, $options); +        $this->actAs($template, $options);
260    } +    }
261 +
262    /** +    /**
263     * bindQueryParts +     * bindQueryParts
264     * binds query parts to given component +     * binds query parts to given component
265     * +     *
266     * @param array $queryParts         an array of pre-bound query parts +     * @param array $queryParts         an array of pre-bound query parts
267     * @return Doctrine_Record          this object +     * @return Doctrine_Record          this object
268     */ +     */
269    public function bindQueryParts(array $queryParts) +    public function bindQueryParts(array $queryParts)
270    { +    {
271     $this->_table->bindQueryParts($queryParts); +     $this->_table->bindQueryParts($queryParts);
272 +
273        return $this; +        return $this;
274    } +    }
275 +
276    /** +    /**
277     * actAs +     * actAs
278     * loads a given plugin  +     * loads a given plugin 
279     * +     *
280     * @param mixed $tpl +     * @param mixed $tpl
281     * @param array $options +     * @param array $options
282     */ +     */
283    public function actAs($tpl, array $options = array()) +    public function actAs($tpl, array $options = array())
284    { +    {
285 +
286        if ( ! is_object($tpl)) { +        if ( ! is_object($tpl)) {
287            if (class_exists($tpl, true)) { +            if (class_exists($tpl, true)) {
288                $tpl = new $tpl($options); +                $tpl = new $tpl($options);
289            } else { +            } else {
290                $className = 'Doctrine_Template_' . $tpl; +                $className = 'Doctrine_Template_' . $tpl;
291 +
292                if ( ! class_exists($className, true)) { +                if ( ! class_exists($className, true)) {
293                    throw new Doctrine_Record_Exception("Couldn't load plugin."); +                    throw new Doctrine_Record_Exception("Couldn't load plugin.");
294                } +                }
295 +
296 +
297                $tpl = new $className($options); +                $tpl = new $className($options);
298            } +            }
299        } +        }
300 +
301        if ( ! ($tpl instanceof Doctrine_Template)) { +        if ( ! ($tpl instanceof Doctrine_Template)) {
302            throw new Doctrine_Record_Exception('Loaded plugin class is not an istance of Doctrine_Template.'); +            throw new Doctrine_Record_Exception('Loaded plugin class is not an istance of Doctrine_Template.');
303        } +        }
304        $className = get_class($tpl); +        $className = get_class($tpl);
305         +        
306        $this->_table->addTemplate($className, $tpl); +        $this->_table->addTemplate($className, $tpl);
307 +
308        $tpl->setTable($this->_table); +        $tpl->setTable($this->_table);
309        $tpl->setUp(); +        $tpl->setUp();
310        $tpl->setTableDefinition(); +        $tpl->setTableDefinition();
311 +
312        return $this; +        return $this;
313    } +    }
314 +
315    /** +    /**
316     * check +     * check
317     * adds a check constraint +     * adds a check constraint
318     * +     *
319     * @param mixed $constraint     either a SQL constraint portion or an array of CHECK constraints +     * @param mixed $constraint     either a SQL constraint portion or an array of CHECK constraints
320     * @param string $name          optional constraint name +     * @param string $name          optional constraint name
321     * @return Doctrine_Record      this object +     * @return Doctrine_Record      this object
322     */ +     */
323    public function check($constraint, $name = null) +    public function check($constraint, $name = null)
324    { +    {
325        if (is_array($constraint)) { +        if (is_array($constraint)) {
326            foreach ($constraint as $name => $def) { +            foreach ($constraint as $name => $def) {
327                $this->_table->addCheckConstraint($def, $name); +                $this->_table->addCheckConstraint($def, $name);
328            } +            }
329        } else { +        } else {
330            $this->_table->addCheckConstraint($constraint, $name); +            $this->_table->addCheckConstraint($constraint, $name);
331        } +        }
332        return $this; +        return $this;
333    } +    }
334} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Record_Exception.html b/tests_old/coverage/Doctrine_Record_Exception.html index 403625884..878065e7f 100644 --- a/tests_old/coverage/Doctrine_Record_Exception.html +++ b/tests_old/coverage/Doctrine_Record_Exception.html @@ -10,103 +10,103 @@

Coverage for Doctrine_Record_Exception

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Record_Filter.html b/tests_old/coverage/Doctrine_Record_Filter.html index b75f43e9f..9ff7274aa 100644 --- a/tests_old/coverage/Doctrine_Record_Filter.html +++ b/tests_old/coverage/Doctrine_Record_Filter.html @@ -10,187 +10,187 @@

Coverage for Doctrine_Record_Filter

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Exception.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $ + *  $Id: Exception.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Exception'); +Doctrine::autoload('Doctrine_Exception');
22/** +/**
23 * Doctrine_Exception + * Doctrine_Exception
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Record + * @subpackage  Record
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 2702 $ + * @version     $Revision: 2702 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Record_Exception extends Doctrine_Exception +class Doctrine_Record_Exception extends Doctrine_Exception
34 { }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Record_Filter_Compound.html b/tests_old/coverage/Doctrine_Record_Filter_Compound.html index f995b655e..55d6db987 100644 --- a/tests_old/coverage/Doctrine_Record_Filter_Compound.html +++ b/tests_old/coverage/Doctrine_Record_Filter_Compound.html @@ -10,301 +10,301 @@

Coverage for Doctrine_Record_Filter_Compound

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Record.php 1298 2007-05-01 19:26:03Z zYne $ + *  $Id: Record.php 1298 2007-05-01 19:26:03Z zYne $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Record_Filter + * Doctrine_Record_Filter
24 * Filters the record getters and setters + * Filters the record getters and setters
25 * + *
26 * @package     Doctrine + * @package     Doctrine
27 * @subpackage  Record + * @subpackage  Record
28 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
29 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31 * @since       1.0 + * @since       1.0
32 * @version     $Revision: 1298 $ + * @version     $Revision: 1298 $
33 */ + */
34abstract class Doctrine_Record_Filter +abstract class Doctrine_Record_Filter
35{ +{
36    protected $_table; +    protected $_table;
37 +
38    public function setTable(Doctrine_Table $table) +    public function setTable(Doctrine_Table $table)
39    { +    {
40        $this->_table = $table; +        $this->_table = $table;
41    } +    }
42    public function getTable() +    public function getTable()
43    { +    {
44        return $this->_table; +        return $this->_table;
45    } +    }
46 +
47    /** +    /**
48     * filterSet +     * filterSet
49     * defines an implementation for filtering the set() method of Doctrine_Record +     * defines an implementation for filtering the set() method of Doctrine_Record
50     * +     *
51     * @param mixed $name                       name of the property or related component +     * @param mixed $name                       name of the property or related component
52     */ +     */
53    abstract public function filterSet(Doctrine_Record $record, $name, $value); +    abstract public function filterSet(Doctrine_Record $record, $name, $value);
54 +
55    /** +    /**
56     * filterGet +     * filterGet
57     * defines an implementation for filtering the get() method of Doctrine_Record +     * defines an implementation for filtering the get() method of Doctrine_Record
58     * +     *
59     * @param mixed $name                       name of the property or related component +     * @param mixed $name                       name of the property or related component
60     */ +     */
61    abstract public function filterGet(Doctrine_Record $record, $name); +    abstract public function filterGet(Doctrine_Record $record, $name);
62 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Record_Filter_Standard.html b/tests_old/coverage/Doctrine_Record_Filter_Standard.html index d0829bb96..1b075d0d1 100644 --- a/tests_old/coverage/Doctrine_Record_Filter_Standard.html +++ b/tests_old/coverage/Doctrine_Record_Filter_Standard.html @@ -10,172 +10,172 @@

Coverage for Doctrine_Record_Filter_Standard

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Record.php 1298 2007-05-01 19:26:03Z zYne $ + *  $Id: Record.php 1298 2007-05-01 19:26:03Z zYne $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Record_Filter_Compound + * Doctrine_Record_Filter_Compound
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Record + * @subpackage  Record
27 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30 * @since       1.0 + * @since       1.0
31 * @version     $Revision: 1298 $ + * @version     $Revision: 1298 $
32 */ + */
33class Doctrine_Record_Filter_Compound extends Doctrine_Record_Filter +class Doctrine_Record_Filter_Compound extends Doctrine_Record_Filter
34{ +{
35    protected $_aliases = array(); +    protected $_aliases = array();
36 +
37    public function __construct(array $aliases) +    public function __construct(array $aliases)
38    { +    {
39        $this->_aliases = $aliases; +        $this->_aliases = $aliases;
40    } +    }
41    public function init() +    public function init()
42    { +    {
43     // check that all aliases exist +     // check that all aliases exist
44     foreach ($this->_aliases as $alias) { +     foreach ($this->_aliases as $alias) {
45            $this->_table->getRelation($alias); +            $this->_table->getRelation($alias);
46     } +     }
47    } +    }
48 +
49    /** +    /**
50     * filterSet +     * filterSet
51     * defines an implementation for filtering the set() method of Doctrine_Record +     * defines an implementation for filtering the set() method of Doctrine_Record
52     * +     *
53     * @param mixed $name                       name of the property or related component +     * @param mixed $name                       name of the property or related component
54     */ +     */
55    public function filterSet(Doctrine_Record $record, $name, $value) +    public function filterSet(Doctrine_Record $record, $name, $value)
56    { +    {
57        foreach ($this->_aliases as $alias) { +        foreach ($this->_aliases as $alias) {
58            if ( ! $record->exists()) { +            if ( ! $record->exists()) {
59                if (isset($record[$alias][$name])) { +                if (isset($record[$alias][$name])) {
60                    $record[$alias][$name] = $value; +                    $record[$alias][$name] = $value;
61                     +                    
62                    return $record; +                    return $record;
63                } +                }
64            } else { +            } else {
65                // we do not want to execute N + 1 queries here, hence we cannot use get() +                // we do not want to execute N + 1 queries here, hence we cannot use get()
66                if (($ref = $record->reference($alias)) !== null) { +                if (($ref = $record->reference($alias)) !== null) {
67                    if (isset($ref[$name])) { +                    if (isset($ref[$name])) {
68                        $ref[$name] = $value; +                        $ref[$name] = $value;
69                    } +                    }
70                     +                    
71                    return $record; +                    return $record;
72                } +                }
73            } +            }
74        } +        }
75    } +    }
76 +
77    /** +    /**
78     * filterGet +     * filterGet
79     * defines an implementation for filtering the get() method of Doctrine_Record +     * defines an implementation for filtering the get() method of Doctrine_Record
80     * +     *
81     * @param mixed $name                       name of the property or related component +     * @param mixed $name                       name of the property or related component
82     */ +     */
83    public function filterGet(Doctrine_Record $record, $name) +    public function filterGet(Doctrine_Record $record, $name)
84    { +    {
85        foreach ($this->_aliases as $alias) { +        foreach ($this->_aliases as $alias) {
86            if ( ! $record->exists()) { +            if ( ! $record->exists()) {
87                if (isset($record[$alias][$name])) { +                if (isset($record[$alias][$name])) {
88                    return $record[$alias][$name]; +                    return $record[$alias][$name];
89                } +                }
90            } else { +            } else {
91                // we do not want to execute N + 1 queries here, hence we cannot use get() +                // we do not want to execute N + 1 queries here, hence we cannot use get()
92                if (($ref = $record->reference($alias)) !== null) { +                if (($ref = $record->reference($alias)) !== null) {
93                    if (isset($ref[$name])) { +                    if (isset($ref[$name])) {
94                        return $ref[$name]; +                        return $ref[$name];
95                    } +                    }
96                } +                }
97            } +            }
98        } +        }
99    } +    }
100 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Record_Iterator.html b/tests_old/coverage/Doctrine_Record_Iterator.html index cbc30d24c..b286cf67f 100644 --- a/tests_old/coverage/Doctrine_Record_Iterator.html +++ b/tests_old/coverage/Doctrine_Record_Iterator.html @@ -10,244 +10,244 @@

Coverage for Doctrine_Record_Iterator

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Record.php 1298 2007-05-01 19:26:03Z zYne $ + *  $Id: Record.php 1298 2007-05-01 19:26:03Z zYne $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Record_Filter_Standard + * Doctrine_Record_Filter_Standard
24 * Filters the record getters and setters + * Filters the record getters and setters
25 * + *
26 * @package     Doctrine + * @package     Doctrine
27 * @subpackage  Record + * @subpackage  Record
28 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
29 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31 * @since       1.0 + * @since       1.0
32 * @version     $Revision: 1298 $ + * @version     $Revision: 1298 $
33 */ + */
34class Doctrine_Record_Filter_Standard extends Doctrine_Record_Filter +class Doctrine_Record_Filter_Standard extends Doctrine_Record_Filter
35{ +{
36    /** +    /**
37     * filterSet +     * filterSet
38     * defines an implementation for filtering the set() method of Doctrine_Record +     * defines an implementation for filtering the set() method of Doctrine_Record
39     * +     *
40     * @param mixed $name                       name of the property or related component +     * @param mixed $name                       name of the property or related component
41     */ +     */
42    public function filterSet(Doctrine_Record $record, $name, $value) +    public function filterSet(Doctrine_Record $record, $name, $value)
43    { +    {
44        throw new Doctrine_Record_Exception('Unknown record property / related component \'' . $name . '\'.'); +        throw new Doctrine_Record_Exception('Unknown record property / related component \'' . $name . '\'.');
45    } +    }
46 +
47    /** +    /**
48     * filterGet +     * filterGet
49     * defines an implementation for filtering the get() method of Doctrine_Record +     * defines an implementation for filtering the get() method of Doctrine_Record
50     * +     *
51     * @param mixed $name                       name of the property or related component +     * @param mixed $name                       name of the property or related component
52     */ +     */
53    public function filterGet(Doctrine_Record $record, $name) +    public function filterGet(Doctrine_Record $record, $name)
54    { +    {
55        throw new Doctrine_Record_Exception('Unknown record property / related component \'' . $name . '\'.'); +        throw new Doctrine_Record_Exception('Unknown record property / related component \'' . $name . '\'.');
56    } +    }
57 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Record_Listener.html b/tests_old/coverage/Doctrine_Record_Listener.html index bc40c65ea..9526fb833 100644 --- a/tests_old/coverage/Doctrine_Record_Listener.html +++ b/tests_old/coverage/Doctrine_Record_Listener.html @@ -10,231 +10,231 @@

Coverage for Doctrine_Record_Listener

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Iterator.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Iterator.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Record_Iterator + * Doctrine_Record_Iterator
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Record + * @subpackage  Record
27 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30 * @since       1.0 + * @since       1.0
31 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
32 */ + */
33class Doctrine_Record_Iterator extends ArrayIterator +class Doctrine_Record_Iterator extends ArrayIterator
34{ +{
35    /** +    /**
36     * @var Doctrine_Record $record +     * @var Doctrine_Record $record
37     */ +     */
38    private $record; +    private $record;
39 +
40    /** +    /**
41     * @var Doctrine_Null $null +     * @var Doctrine_Null $null
42     */ +     */
43    private static $null; +    private static $null;
44 +
45    /** +    /**
46     * constructor +     * constructor
47     * +     *
48     * @param Doctrine_Record $record +     * @param Doctrine_Record $record
49     */ +     */
50    public function __construct(Doctrine_Record $record) +    public function __construct(Doctrine_Record $record)
51    { +    {
52        $this->record = $record; +        $this->record = $record;
53        parent::__construct($record->getData()); +        parent::__construct($record->getData());
54    } +    }
55 +
56    /** +    /**
57     * initNullObject +     * initNullObject
58     * +     *
59     * @param Doctrine_Null $null +     * @param Doctrine_Null $null
60     */ +     */
61    public static function initNullObject(Doctrine_Null $null) +    public static function initNullObject(Doctrine_Null $null)
62    { +    {
63        self::$null = $null; +        self::$null = $null;
64    } +    }
65 +
66    /** +    /**
67     * current +     * current
68     * +     *
69     * @return mixed +     * @return mixed
70     */ +     */
71    public function current() +    public function current()
72    { +    {
73        $value = parent::current(); +        $value = parent::current();
74 +
75        if ($value === self::$null) { +        if ($value === self::$null) {
76            return null; +            return null;
77        } else { +        } else {
78            return $value; +            return $value;
79        } +        }
80    } +    }
81 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id$ + *  $Id$
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Record_Listener + * Doctrine_Record_Listener
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Record + * @subpackage  Record
27 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30 * @since       1.0 + * @since       1.0
31 * @version     $Revision$ + * @version     $Revision$
32 */ + */
33class Doctrine_Record_Listener implements Doctrine_Record_Listener_Interface +class Doctrine_Record_Listener implements Doctrine_Record_Listener_Interface
34{ +{
35    public function preSerialize(Doctrine_Event $event) +    public function preSerialize(Doctrine_Event $event)
36    { } +    { }
37 +
38    public function postSerialize(Doctrine_Event $event) +    public function postSerialize(Doctrine_Event $event)
39    { } +    { }
40 +
41    public function preUnserialize(Doctrine_Event $event) +    public function preUnserialize(Doctrine_Event $event)
42    { } +    { }
43 +
44    public function postUnserialize(Doctrine_Event $event) +    public function postUnserialize(Doctrine_Event $event)
45    { } +    { }
46 +
47    public function preSave(Doctrine_Event $event) +    public function preSave(Doctrine_Event $event)
48    { } +    { }
49 +
50    public function postSave(Doctrine_Event $event) +    public function postSave(Doctrine_Event $event)
51    { } +    { }
52 +
53    public function preDelete(Doctrine_Event $event) +    public function preDelete(Doctrine_Event $event)
54    { } +    { }
55 +
56    public function postDelete(Doctrine_Event $event) +    public function postDelete(Doctrine_Event $event)
57    { } +    { }
58 +
59    public function preUpdate(Doctrine_Event $event) +    public function preUpdate(Doctrine_Event $event)
60    { } +    { }
61 +
62    public function postUpdate(Doctrine_Event $event) +    public function postUpdate(Doctrine_Event $event)
63    { } +    { }
64 +
65    public function preInsert(Doctrine_Event $event) +    public function preInsert(Doctrine_Event $event)
66    { } +    { }
67 +
68    public function postInsert(Doctrine_Event $event) +    public function postInsert(Doctrine_Event $event)
69    { } +    { }
70     +    
71    public function preHydrate(Doctrine_Event $event) +    public function preHydrate(Doctrine_Event $event)
72    { } +    { }
73     +    
74    public function postHydrate(Doctrine_Event $event) +    public function postHydrate(Doctrine_Event $event)
75    { } +    { }
76} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Record_Listener_Chain.html b/tests_old/coverage/Doctrine_Record_Listener_Chain.html index 947e3e067..6e960e38d 100644 --- a/tests_old/coverage/Doctrine_Record_Listener_Chain.html +++ b/tests_old/coverage/Doctrine_Record_Listener_Chain.html @@ -10,570 +10,570 @@

Coverage for Doctrine_Record_Listener_Chain

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id$ + *  $Id$
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Access'); +Doctrine::autoload('Doctrine_Access');
22 +
23/** +/**
24 * Doctrine_Record_Listener_Chain + * Doctrine_Record_Listener_Chain
25 * this class represents a chain of different listeners, + * this class represents a chain of different listeners,
26 * useful for having multiple listeners listening the events at the same time + * useful for having multiple listeners listening the events at the same time
27 * + *
28 * @package     Doctrine + * @package     Doctrine
29 * @subpackage  Record + * @subpackage  Record
30 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
31 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
32 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
33 * @since       1.0 + * @since       1.0
34 * @version     $Revision$ + * @version     $Revision$
35 */ + */
36class Doctrine_Record_Listener_Chain extends Doctrine_Access implements Doctrine_Record_Listener_Interface +class Doctrine_Record_Listener_Chain extends Doctrine_Access implements Doctrine_Record_Listener_Interface
37{ +{
38    /** +    /**
39     * @var array $listeners        an array containing all listeners +     * @var array $listeners        an array containing all listeners
40     */ +     */
41    protected $_listeners = array(); +    protected $_listeners = array();
42 +
43    /** +    /**
44     * add +     * add
45     * adds a listener to the chain of listeners +     * adds a listener to the chain of listeners
46     * +     *
47     * @param object $listener +     * @param object $listener
48     * @param string $name +     * @param string $name
49     * @return void +     * @return void
50     */ +     */
51    public function add($listener, $name = null) +    public function add($listener, $name = null)
52    { +    {
53        if ( ! ($listener instanceof Doctrine_Record_Listener_Interface) && +        if ( ! ($listener instanceof Doctrine_Record_Listener_Interface) &&
54             ! ($listener instanceof Doctrine_Overloadable)) { +             ! ($listener instanceof Doctrine_Overloadable)) {
55             +            
56            throw new Doctrine_EventListener_Exception("Couldn't add eventlistener. Record listeners should implement either Doctrine_EventListener_Interface or Doctrine_Overloadable"); +            throw new Doctrine_EventListener_Exception("Couldn't add eventlistener. Record listeners should implement either Doctrine_EventListener_Interface or Doctrine_Overloadable");
57        } +        }
58        if ($name === null) { +        if ($name === null) {
59            $this->_listeners[] = $listener; +            $this->_listeners[] = $listener;
60        } else { +        } else {
61            $this->_listeners[$name] = $listener; +            $this->_listeners[$name] = $listener;
62        } +        }
63    } +    }
64 +
65    /** +    /**
66     * returns a Doctrine_Record_Listener on success +     * returns a Doctrine_Record_Listener on success
67     * and null on failure +     * and null on failure
68     * +     *
69     * @param mixed $key +     * @param mixed $key
70     * @return mixed +     * @return mixed
71     */ +     */
72    public function get($key) +    public function get($key)
73    { +    {
74        if ( ! isset($this->_listeners[$key])) { +        if ( ! isset($this->_listeners[$key])) {
75            return null; +            return null;
76        } +        }
77        return $this->_listeners[$key]; +        return $this->_listeners[$key];
78    } +    }
79 +
80    /** +    /**
81     * set +     * set
82     * +     *
83     * @param mixed $key +     * @param mixed $key
84     * @param Doctrine_Record_Listener $listener    listener to be added +     * @param Doctrine_Record_Listener $listener    listener to be added
85     * @return Doctrine_Record_Listener_Chain       this object +     * @return Doctrine_Record_Listener_Chain       this object
86     */ +     */
87    public function set($key, Doctrine_EventListener $listener) +    public function set($key, Doctrine_EventListener $listener)
88    { +    {
89        $this->_listeners[$key] = $listener; +        $this->_listeners[$key] = $listener;
90    } +    }
91 +
92    public function preSerialize(Doctrine_Event $event) +    public function preSerialize(Doctrine_Event $event)
93    {  +    { 
94        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
95            $listener->preSerialize($event); +            $listener->preSerialize($event);
96        } +        }
97    } +    }
98 +
99    public function postSerialize(Doctrine_Event $event) +    public function postSerialize(Doctrine_Event $event)
100    {  +    { 
101        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
102            $listener->preSerialize($event); +            $listener->preSerialize($event);
103        } +        }
104    } +    }
105 +
106    public function preUnserialize(Doctrine_Event $event) +    public function preUnserialize(Doctrine_Event $event)
107    {  +    { 
108        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
109            $listener->preUnserialize($event); +            $listener->preUnserialize($event);
110        } +        }
111    } +    }
112 +
113    public function postUnserialize(Doctrine_Event $event) +    public function postUnserialize(Doctrine_Event $event)
114    {  +    { 
115        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
116            $listener->postUnserialize($event); +            $listener->postUnserialize($event);
117        } +        }
118    } +    }
119 +
120    public function preSave(Doctrine_Event $event) +    public function preSave(Doctrine_Event $event)
121    {  +    { 
122        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
123            $listener->preSave($event); +            $listener->preSave($event);
124        } +        }
125    } +    }
126 +
127    public function postSave(Doctrine_Event $event) +    public function postSave(Doctrine_Event $event)
128    {  +    { 
129        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
130            $listener->postSave($event); +            $listener->postSave($event);
131        } +        }
132    } +    }
133 +
134    public function preDelete(Doctrine_Event $event) +    public function preDelete(Doctrine_Event $event)
135    {  +    { 
136        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
137            $listener->preDelete($event); +            $listener->preDelete($event);
138        } +        }
139    } +    }
140 +
141    public function postDelete(Doctrine_Event $event) +    public function postDelete(Doctrine_Event $event)
142    { +    {
143        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
144            $listener->postDelete($event); +            $listener->postDelete($event);
145        } +        }
146    } +    }
147 +
148    public function preUpdate(Doctrine_Event $event) +    public function preUpdate(Doctrine_Event $event)
149    {  +    { 
150        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
151            $listener->preUpdate($event); +            $listener->preUpdate($event);
152        } +        }
153    } +    }
154 +
155    public function postUpdate(Doctrine_Event $event) +    public function postUpdate(Doctrine_Event $event)
156    {  +    { 
157        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
158            $listener->postUpdate($event); +            $listener->postUpdate($event);
159        } +        }
160    } +    }
161 +
162    public function preInsert(Doctrine_Event $event) +    public function preInsert(Doctrine_Event $event)
163    {  +    { 
164        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
165            $listener->preInsert($event); +            $listener->preInsert($event);
166        } +        }
167    } +    }
168 +
169    public function postInsert(Doctrine_Event $event) +    public function postInsert(Doctrine_Event $event)
170    {  +    { 
171        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
172            $listener->postInsert($event); +            $listener->postInsert($event);
173        } +        }
174    } +    }
175     +    
176 +
177    public function preHydrate(Doctrine_Event $event) +    public function preHydrate(Doctrine_Event $event)
178    {  +    { 
179        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
180            $listener->preHydrate($event); +            $listener->preHydrate($event);
181        } +        }
182    } +    }
183    public function postHydrate(Doctrine_Event $event) +    public function postHydrate(Doctrine_Event $event)
184    { +    {
185        foreach ($this->_listeners as $listener) { +        foreach ($this->_listeners as $listener) {
186            $listener->postHydrate($event); +            $listener->postHydrate($event);
187        } +        }
188    } +    }
189} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Relation.html b/tests_old/coverage/Doctrine_Relation.html index 68e780afb..64311ce08 100644 --- a/tests_old/coverage/Doctrine_Relation.html +++ b/tests_old/coverage/Doctrine_Relation.html @@ -10,991 +10,991 @@

Coverage for Doctrine_Relation

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Relation_Association.html b/tests_old/coverage/Doctrine_Relation_Association.html index 0fb312a32..9e19e491a 100644 --- a/tests_old/coverage/Doctrine_Relation_Association.html +++ b/tests_old/coverage/Doctrine_Relation_Association.html @@ -10,295 +10,295 @@

Coverage for Doctrine_Relation_Association

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Relation.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Relation.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Relation + * Doctrine_Relation
24 * This class represents a relation between components + * This class represents a relation between components
25 * + *
26 * @package     Doctrine + * @package     Doctrine
27 * @subpackage  Relation + * @subpackage  Relation
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30 * @since       1.0 + * @since       1.0
31 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
32 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
33 */ + */
34abstract class Doctrine_Relation implements ArrayAccess +abstract class Doctrine_Relation implements ArrayAccess
35{ +{
36    /** +    /**
37     * RELATION CONSTANTS +     * RELATION CONSTANTS
38     */ +     */
39 +
40    /** +    /**
41     * constant for ONE_TO_ONE and MANY_TO_ONE aggregate relationships +     * constant for ONE_TO_ONE and MANY_TO_ONE aggregate relationships
42     */ +     */
43    const ONE_AGGREGATE         = 0; +    const ONE_AGGREGATE         = 0;
44 +
45    /** +    /**
46     * constant for ONE_TO_ONE and MANY_TO_ONE composite relationships +     * constant for ONE_TO_ONE and MANY_TO_ONE composite relationships
47     */ +     */
48    const ONE_COMPOSITE         = 1; +    const ONE_COMPOSITE         = 1;
49 +
50    /** +    /**
51     * constant for MANY_TO_MANY and ONE_TO_MANY aggregate relationships +     * constant for MANY_TO_MANY and ONE_TO_MANY aggregate relationships
52     */ +     */
53    const MANY_AGGREGATE        = 2; +    const MANY_AGGREGATE        = 2;
54 +
55    /** +    /**
56     * constant for MANY_TO_MANY and ONE_TO_MANY composite relationships +     * constant for MANY_TO_MANY and ONE_TO_MANY composite relationships
57     */ +     */
58    const MANY_COMPOSITE        = 3; +    const MANY_COMPOSITE        = 3;
59 +
60    const ONE   = 0; +    const ONE   = 0;
61    const MANY  = 2; +    const MANY  = 2;
62     +    
63    protected $definition = array('alias'       => true, +    protected $definition = array('alias'       => true,
64                                  'foreign'     => true, +                                  'foreign'     => true,
65                                  'local'       => true, +                                  'local'       => true,
66                                  'class'       => true, +                                  'class'       => true,
67                                  'type'        => true, +                                  'type'        => true,
68                                  'table'       => true, +                                  'table'       => true,
69                                  'name'        => false, +                                  'name'        => false,
70                                  'refTable'    => false, +                                  'refTable'    => false,
71                                  'onDelete'    => false, +                                  'onDelete'    => false,
72                                  'onUpdate'    => false, +                                  'onUpdate'    => false,
73                                  'deferred'    => false, +                                  'deferred'    => false,
74                                  'deferrable'  => false, +                                  'deferrable'  => false,
75                                  'constraint'  => false, +                                  'constraint'  => false,
76                                  'equal'       => false, +                                  'equal'       => false,
77                                  ); +                                  );
78 +
79    /** +    /**
80     * constructor +     * constructor
81     * +     *
82     * @param array $definition         an associative array with the following structure: +     * @param array $definition         an associative array with the following structure:
83     *          name                    foreign key constraint name +     *          name                    foreign key constraint name
84     * +     *
85     *          local                   the local field(s) +     *          local                   the local field(s)
86     * +     *
87     *          foreign                 the foreign reference field(s) +     *          foreign                 the foreign reference field(s)
88     * +     *
89     *          table                   the foreign table object +     *          table                   the foreign table object
90     * +     *
91     *          refTable                the reference table object (if any) +     *          refTable                the reference table object (if any)
92     * +     *
93     *          onDelete                referential delete action +     *          onDelete                referential delete action
94     *   +     *  
95     *          onUpdate                referential update action +     *          onUpdate                referential update action
96     * +     *
97     *          deferred                deferred constraint checking  +     *          deferred                deferred constraint checking 
98     * +     *
99     *          alias                   relation alias +     *          alias                   relation alias
100     * +     *
101     *          type                    the relation type, either Doctrine_Relation::ONE or Doctrine_Relation::MANY +     *          type                    the relation type, either Doctrine_Relation::ONE or Doctrine_Relation::MANY
102     * +     *
103     *          constraint              boolean value, true if the relation has an explicit referential integrity constraint +     *          constraint              boolean value, true if the relation has an explicit referential integrity constraint
104     * +     *
105     * The onDelete and onUpdate keys accept the following values: +     * The onDelete and onUpdate keys accept the following values:
106     * +     *
107     * CASCADE: Delete or update the row from the parent table and automatically delete or +     * CASCADE: Delete or update the row from the parent table and automatically delete or
108     *          update the matching rows in the child table. Both ON DELETE CASCADE and ON UPDATE CASCADE are supported. +     *          update the matching rows in the child table. Both ON DELETE CASCADE and ON UPDATE CASCADE are supported.
109     *          Between two tables, you should not define several ON UPDATE CASCADE clauses that act on the same column +     *          Between two tables, you should not define several ON UPDATE CASCADE clauses that act on the same column
110     *          in the parent table or in the child table. +     *          in the parent table or in the child table.
111     * +     *
112     * SET NULL: Delete or update the row from the parent table and set the foreign key column or columns in the +     * SET NULL: Delete or update the row from the parent table and set the foreign key column or columns in the
113     *          child table to NULL. This is valid only if the foreign key columns do not have the NOT NULL qualifier  +     *          child table to NULL. This is valid only if the foreign key columns do not have the NOT NULL qualifier 
114     *          specified. Both ON DELETE SET NULL and ON UPDATE SET NULL clauses are supported. +     *          specified. Both ON DELETE SET NULL and ON UPDATE SET NULL clauses are supported.
115     * +     *
116     * NO ACTION: In standard SQL, NO ACTION means no action in the sense that an attempt to delete or update a primary  +     * NO ACTION: In standard SQL, NO ACTION means no action in the sense that an attempt to delete or update a primary 
117     *           key value is not allowed to proceed if there is a related foreign key value in the referenced table. +     *           key value is not allowed to proceed if there is a related foreign key value in the referenced table.
118     * +     *
119     * RESTRICT: Rejects the delete or update operation for the parent table. NO ACTION and RESTRICT are the same as +     * RESTRICT: Rejects the delete or update operation for the parent table. NO ACTION and RESTRICT are the same as
120     *           omitting the ON DELETE or ON UPDATE clause. +     *           omitting the ON DELETE or ON UPDATE clause.
121     * +     *
122     * SET DEFAULT +     * SET DEFAULT
123     */ +     */
124    public function __construct(array $definition) +    public function __construct(array $definition)
125    { +    {
126        $def = array(); +        $def = array();
127        foreach ($this->definition as $key => $val) { +        foreach ($this->definition as $key => $val) {
128            if ( ! isset($definition[$key]) && $val) { +            if ( ! isset($definition[$key]) && $val) {
129                throw new Doctrine_Exception($key . ' is required!'); +                throw new Doctrine_Exception($key . ' is required!');
130            } +            }
131            if (isset($definition[$key])) { +            if (isset($definition[$key])) {
132                $def[$key] = $definition[$key]; +                $def[$key] = $definition[$key];
133            } else { +            } else {
134                $def[$key] = null;           +                $def[$key] = null;          
135            } +            }
136        } +        }
137 +
138        $this->definition = $def; +        $this->definition = $def;
139    } +    }
140 +
141    /** +    /**
142     * hasConstraint +     * hasConstraint
143     * whether or not this relation has an explicit constraint +     * whether or not this relation has an explicit constraint
144     * +     *
145     * @return boolean +     * @return boolean
146     */ +     */
147    public function hasConstraint() +    public function hasConstraint()
148    { +    {
149        return ($this->definition['constraint'] || +        return ($this->definition['constraint'] ||
150                ($this->definition['onUpdate']) || +                ($this->definition['onUpdate']) ||
151                ($this->definition['onDelete'])); +                ($this->definition['onDelete']));
152    } +    }
153    public function isDeferred() +    public function isDeferred()
154    { +    {
155        return $this->definition['deferred']; +        return $this->definition['deferred'];
156    } +    }
157 +
158    public function isDeferrable() +    public function isDeferrable()
159    { +    {
160        return $this->definition['deferrable']; +        return $this->definition['deferrable'];
161    } +    }
162    public function isEqual() +    public function isEqual()
163    { +    {
164        return $this->definition['equal']; +        return $this->definition['equal'];
165    } +    }
166 +
167    public function offsetExists($offset) +    public function offsetExists($offset)
168    { +    {
169        return isset($this->definition[$offset]); +        return isset($this->definition[$offset]);
170    } +    }
171 +
172    public function offsetGet($offset) +    public function offsetGet($offset)
173    { +    {
174        if (isset($this->definition[$offset])) { +        if (isset($this->definition[$offset])) {
175            return $this->definition[$offset]; +            return $this->definition[$offset];
176        } +        }
177         +        
178        return null; +        return null;
179    } +    }
180 +
181    public function offsetSet($offset, $value) +    public function offsetSet($offset, $value)
182    { +    {
183        if (isset($this->definition[$offset])) { +        if (isset($this->definition[$offset])) {
184            $this->definition[$offset] = $value; +            $this->definition[$offset] = $value;
185        } +        }
186    } +    }
187 +
188    public function offsetUnset($offset) +    public function offsetUnset($offset)
189    { +    {
190        $this->definition[$offset] = false; +        $this->definition[$offset] = false;
191    } +    }
192 +
193    /** +    /**
194     * toArray +     * toArray
195     * +     *
196     * @return array +     * @return array
197     */ +     */
198    public function toArray()  +    public function toArray() 
199    { +    {
200        return $this->definition; +        return $this->definition;
201    } +    }
202 +
203    /** +    /**
204     * getAlias +     * getAlias
205     * returns the relation alias +     * returns the relation alias
206     * +     *
207     * @return string +     * @return string
208     */ +     */
209    final public function getAlias() +    final public function getAlias()
210    { +    {
211        return $this->definition['alias']; +        return $this->definition['alias'];
212    } +    }
213 +
214    /** +    /**
215     * getType +     * getType
216     * returns the relation type, either 0 or 1 +     * returns the relation type, either 0 or 1
217     * +     *
218     * @see Doctrine_Relation MANY_* and ONE_* constants +     * @see Doctrine_Relation MANY_* and ONE_* constants
219     * @return integer +     * @return integer
220     */ +     */
221    final public function getType() +    final public function getType()
222    { +    {
223        return $this->definition['type']; +        return $this->definition['type'];
224    } +    }
225 +
226    /** +    /**
227     * getTable +     * getTable
228     * returns the foreign table object +     * returns the foreign table object
229     * +     *
230     * @return object Doctrine_Table +     * @return object Doctrine_Table
231     */ +     */
232    final public function getTable() +    final public function getTable()
233    { +    {
234        return Doctrine_Manager::getInstance() +        return Doctrine_Manager::getInstance()
235               ->getConnectionForComponent($this->definition['class']) +               ->getConnectionForComponent($this->definition['class'])
236               ->getTable($this->definition['class']); +               ->getTable($this->definition['class']);
237    } +    }
238 +
239    /** +    /**
240     * getLocal +     * getLocal
241     * returns the name of the local column +     * returns the name of the local column
242     * +     *
243     * @return string +     * @return string
244     */ +     */
245    final public function getLocal() +    final public function getLocal()
246    { +    {
247        return $this->definition['local']; +        return $this->definition['local'];
248    } +    }
249 +
250    /** +    /**
251     * getForeign +     * getForeign
252     * returns the name of the foreignkey column where +     * returns the name of the foreignkey column where
253     * the localkey column is pointing at +     * the localkey column is pointing at
254     * +     *
255     * @return string +     * @return string
256     */ +     */
257    final public function getForeign() +    final public function getForeign()
258    { +    {
259        return $this->definition['foreign']; +        return $this->definition['foreign'];
260    } +    }
261 +
262    /** +    /**
263     * isComposite +     * isComposite
264     * returns whether or not this relation is a composite relation +     * returns whether or not this relation is a composite relation
265     * +     *
266     * @return boolean +     * @return boolean
267     */ +     */
268    final public function isComposite() +    final public function isComposite()
269    { +    {
270        return ($this->definition['type'] == Doctrine_Relation::ONE_COMPOSITE || +        return ($this->definition['type'] == Doctrine_Relation::ONE_COMPOSITE ||
271                $this->definition['type'] == Doctrine_Relation::MANY_COMPOSITE); +                $this->definition['type'] == Doctrine_Relation::MANY_COMPOSITE);
272    } +    }
273 +
274    /** +    /**
275     * isOneToOne +     * isOneToOne
276     * returns whether or not this relation is a one-to-one relation +     * returns whether or not this relation is a one-to-one relation
277     * +     *
278     * @return boolean +     * @return boolean
279     */ +     */
280    final public function isOneToOne() +    final public function isOneToOne()
281    { +    {
282        return ($this->definition['type'] == Doctrine_Relation::ONE_AGGREGATE || +        return ($this->definition['type'] == Doctrine_Relation::ONE_AGGREGATE ||
283                $this->definition['type'] == Doctrine_Relation::ONE_COMPOSITE); +                $this->definition['type'] == Doctrine_Relation::ONE_COMPOSITE);
284    } +    }
285 +
286    /** +    /**
287     * getRelationDql +     * getRelationDql
288     * +     *
289     * @param integer $count +     * @param integer $count
290     * @return string +     * @return string
291     */ +     */
292    public function getRelationDql($count) +    public function getRelationDql($count)
293    { +    {
294        $component = $this->getTable()->getComponentName(); +        $component = $this->getTable()->getComponentName();
295 +
296        $dql  = 'FROM ' . $component +        $dql  = 'FROM ' . $component
297              . ' WHERE ' . $component . '.' . $this->definition['foreign'] +              . ' WHERE ' . $component . '.' . $this->definition['foreign']
298              . ' IN (' . substr(str_repeat('?, ', $count), 0, -2) . ')'; +              . ' IN (' . substr(str_repeat('?, ', $count), 0, -2) . ')';
299 +
300        return $dql; +        return $dql;
301    } +    }
302 +
303    /** +    /**
304     * fetchRelatedFor +     * fetchRelatedFor
305     * +     *
306     * fetches a component related to given record +     * fetches a component related to given record
307     * +     *
308     * @param Doctrine_Record $record +     * @param Doctrine_Record $record
309     * @return Doctrine_Record|Doctrine_Collection +     * @return Doctrine_Record|Doctrine_Collection
310     */ +     */
311    abstract public function fetchRelatedFor(Doctrine_Record $record); +    abstract public function fetchRelatedFor(Doctrine_Record $record);
312 +
313    /** +    /**
314     * __toString +     * __toString
315     * +     *
316     * @return string +     * @return string
317     */ +     */
318    public function __toString() +    public function __toString()
319    { +    {
320        $r[] = "<pre>"; +        $r[] = "<pre>";
321        foreach ($this->definition as $k => $v) { +        foreach ($this->definition as $k => $v) {
322            if (is_object($v)) { +            if (is_object($v)) {
323                $v = 'Object(' . get_class($v) . ')'; +                $v = 'Object(' . get_class($v) . ')';
324            } +            }
325            $r[] = $k . ' : ' . $v; +            $r[] = $k . ' : ' . $v;
326        } +        }
327        $r[] = "</pre>"; +        $r[] = "</pre>";
328        return implode("\n", $r); +        return implode("\n", $r);
329    } +    }
330 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Relation_Exception.html b/tests_old/coverage/Doctrine_Relation_Exception.html index 47a4d3b61..41c0accd1 100644 --- a/tests_old/coverage/Doctrine_Relation_Exception.html +++ b/tests_old/coverage/Doctrine_Relation_Exception.html @@ -10,103 +10,103 @@

Coverage for Doctrine_Relation_Exception

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Association.php 3209 2007-11-24 18:11:09Z romanb $ + *  $Id: Association.php 3209 2007-11-24 18:11:09Z romanb $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Relation'); +Doctrine::autoload('Doctrine_Relation');
22/** +/**
23 * Doctrine_Relation_Association    this class takes care of association mapping + * Doctrine_Relation_Association    this class takes care of association mapping
24 *                         (= many-to-many relationships, where the relationship is handled with an additional relational table + *                         (= many-to-many relationships, where the relationship is handled with an additional relational table
25 *                         which holds 2 foreign keys) + *                         which holds 2 foreign keys)
26 * + *
27 * + *
28 * @package     Doctrine + * @package     Doctrine
29 * @subpackage  Relation + * @subpackage  Relation
30 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
31 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
32 * @since       1.0 + * @since       1.0
33 * @version     $Revision: 3209 $ + * @version     $Revision: 3209 $
34 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
35 */ + */
36class Doctrine_Relation_Association extends Doctrine_Relation +class Doctrine_Relation_Association extends Doctrine_Relation
37{ +{
38    /** +    /**
39     * @return Doctrine_Table +     * @return Doctrine_Table
40     */ +     */
41    public function getAssociationFactory() +    public function getAssociationFactory()
42    { +    {
43        return $this->definition['refTable']; +        return $this->definition['refTable'];
44    } +    }
45    public function getAssociationTable() +    public function getAssociationTable()
46    { +    {
47        return $this->definition['refTable']; +        return $this->definition['refTable'];
48    } +    }
49 +
50    /** +    /**
51     * getRelationDql +     * getRelationDql
52     * +     *
53     * @param integer $count +     * @param integer $count
54     * @return string +     * @return string
55     */ +     */
56    public function getRelationDql($count, $context = 'record') +    public function getRelationDql($count, $context = 'record')
57    { +    {
58        $table = $this->definition['refTable']; +        $table = $this->definition['refTable'];
59        $component = $this->definition['refTable']->getComponentName(); +        $component = $this->definition['refTable']->getComponentName();
60         +        
61        switch ($context) { +        switch ($context) {
62            case "record": +            case "record":
63                $sub  = substr(str_repeat("?, ", $count),0,-2); +                $sub  = substr(str_repeat("?, ", $count),0,-2);
64                $dql  = 'FROM ' . $this->getTable()->getComponentName(); +                $dql  = 'FROM ' . $this->getTable()->getComponentName();
65                $dql .= '.' . $component; +                $dql .= '.' . $component;
66                $dql .= ' WHERE ' . $this->getTable()->getComponentName() +                $dql .= ' WHERE ' . $this->getTable()->getComponentName()
67                . '.' . $component . '.' . $this->definition['local'] . ' IN (' . $sub . ')'; +                . '.' . $component . '.' . $this->definition['local'] . ' IN (' . $sub . ')';
68                break; +                break;
69            case "collection": +            case "collection":
70                $sub  = substr(str_repeat("?, ", $count),0,-2); +                $sub  = substr(str_repeat("?, ", $count),0,-2);
71                $dql  = 'FROM ' . $component . '.' . $this->getTable()->getComponentName(); +                $dql  = 'FROM ' . $component . '.' . $this->getTable()->getComponentName();
72                $dql .= ' WHERE ' . $component . '.' . $this->definition['local'] . ' IN (' . $sub . ')'; +                $dql .= ' WHERE ' . $component . '.' . $this->definition['local'] . ' IN (' . $sub . ')';
73                break; +                break;
74        } +        }
75 +
76        return $dql; +        return $dql;
77    } +    }
78 +
79    /** +    /**
80     * fetchRelatedFor +     * fetchRelatedFor
81     * +     *
82     * fetches a component related to given record +     * fetches a component related to given record
83     * +     *
84     * @param Doctrine_Record $record +     * @param Doctrine_Record $record
85     * @return Doctrine_Record|Doctrine_Collection +     * @return Doctrine_Record|Doctrine_Collection
86     */ +     */
87    public function fetchRelatedFor(Doctrine_Record $record) +    public function fetchRelatedFor(Doctrine_Record $record)
88    { +    {
89        $id = $record->getIncremented(); +        $id = $record->getIncremented();
90        if (empty($id) || ! $this->definition['table']->getAttribute(Doctrine::ATTR_LOAD_REFERENCES)) { +        if (empty($id) || ! $this->definition['table']->getAttribute(Doctrine::ATTR_LOAD_REFERENCES)) {
91            $coll = new Doctrine_Collection($this->getTable()); +            $coll = new Doctrine_Collection($this->getTable());
92        } else { +        } else {
93            $coll = Doctrine_Query::create()->query($this->getRelationDql(1), array($id)); +            $coll = Doctrine_Query::create()->query($this->getRelationDql(1), array($id));
94        } +        }
95        $coll->setReference($record, $this); +        $coll->setReference($record, $this);
96        return $coll; +        return $coll;
97    } +    }
98 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Relation_ForeignKey.html b/tests_old/coverage/Doctrine_Relation_ForeignKey.html index fa239d37e..e2838d73a 100644 --- a/tests_old/coverage/Doctrine_Relation_ForeignKey.html +++ b/tests_old/coverage/Doctrine_Relation_ForeignKey.html @@ -10,298 +10,298 @@

Coverage for Doctrine_Relation_ForeignKey

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Exception.php 1344 2007-05-12 23:27:16Z zYne $ + *  $Id: Exception.php 1344 2007-05-12 23:27:16Z zYne $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */         + */        
21Doctrine::autoload('Doctrine_Exception'); +Doctrine::autoload('Doctrine_Exception');
22/** +/**
23 * Doctrine_Relation_Exception + * Doctrine_Relation_Exception
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Relation + * @subpackage  Relation
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 1344 $ + * @version     $Revision: 1344 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Relation_Exception extends Doctrine_Exception +class Doctrine_Relation_Exception extends Doctrine_Exception
34 { }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Relation_LocalKey.html b/tests_old/coverage/Doctrine_Relation_LocalKey.html index 257654113..76fbe231e 100644 --- a/tests_old/coverage/Doctrine_Relation_LocalKey.html +++ b/tests_old/coverage/Doctrine_Relation_LocalKey.html @@ -10,244 +10,244 @@

Coverage for Doctrine_Relation_LocalKey

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: ForeignKey.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: ForeignKey.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Relation'); +Doctrine::autoload('Doctrine_Relation');
22/** +/**
23 * Doctrine_Relation_ForeignKey + * Doctrine_Relation_ForeignKey
24 * This class represents a foreign key relation + * This class represents a foreign key relation
25 * + *
26 * @package     Doctrine + * @package     Doctrine
27 * @subpackage  Relation + * @subpackage  Relation
28 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
29 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31 * @since       1.0 + * @since       1.0
32 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
33 */ + */
34class Doctrine_Relation_ForeignKey extends Doctrine_Relation +class Doctrine_Relation_ForeignKey extends Doctrine_Relation
35{ +{
36    /** +    /**
37     * fetchRelatedFor +     * fetchRelatedFor
38     * +     *
39     * fetches a component related to given record +     * fetches a component related to given record
40     * +     *
41     * @param Doctrine_Record $record +     * @param Doctrine_Record $record
42     * @return Doctrine_Record|Doctrine_Collection +     * @return Doctrine_Record|Doctrine_Collection
43     */ +     */
44    public function fetchRelatedFor(Doctrine_Record $record) +    public function fetchRelatedFor(Doctrine_Record $record)
45    { +    {
46        $id = array(); +        $id = array();
47        foreach ((array) $this->definition['local'] as $local) { +        foreach ((array) $this->definition['local'] as $local) {
48           $value = $record->get($local); +           $value = $record->get($local);
49           if (isset($value)) { +           if (isset($value)) {
50               $id[] = $value; +               $id[] = $value;
51           } +           }
52        } +        }
53        if ($this->isOneToOne()) { +        if ($this->isOneToOne()) {
54            if ( ! $record->exists() || empty($id) ||  +            if ( ! $record->exists() || empty($id) || 
55                 ! $this->definition['table']->getAttribute(Doctrine::ATTR_LOAD_REFERENCES)) { +                 ! $this->definition['table']->getAttribute(Doctrine::ATTR_LOAD_REFERENCES)) {
56                 +                
57                $related = $this->getTable()->create(); +                $related = $this->getTable()->create();
58            } else { +            } else {
59                $dql  = 'FROM ' . $this->getTable()->getComponentName() +                $dql  = 'FROM ' . $this->getTable()->getComponentName()
60                      . ' WHERE ' . $this->getCondition(); +                      . ' WHERE ' . $this->getCondition();
61 +
62                $coll = $this->getTable()->getConnection()->query($dql, $id); +                $coll = $this->getTable()->getConnection()->query($dql, $id);
63                $related = $coll[0]; +                $related = $coll[0];
64            } +            }
65 +
66            $related->set($this->definition['foreign'], $record, false); +            $related->set($this->definition['foreign'], $record, false);
67 +
68        } else { +        } else {
69 +
70            if ( ! $record->exists() || empty($id) ||  +            if ( ! $record->exists() || empty($id) || 
71                 ! $this->definition['table']->getAttribute(Doctrine::ATTR_LOAD_REFERENCES)) { +                 ! $this->definition['table']->getAttribute(Doctrine::ATTR_LOAD_REFERENCES)) {
72                 +                
73                $related = new Doctrine_Collection($this->getTable()); +                $related = new Doctrine_Collection($this->getTable());
74            } else { +            } else {
75                $query      = $this->getRelationDql(1); +                $query      = $this->getRelationDql(1);
76                $related    = $this->getTable()->getConnection()->query($query, $id); +                $related    = $this->getTable()->getConnection()->query($query, $id);
77            } +            }
78            $related->setReference($record, $this); +            $related->setReference($record, $this);
79        } +        }
80        return $related; +        return $related;
81    } +    }
82 +
83    /** +    /**
84     * getCondition +     * getCondition
85     * +     *
86     * @param string $alias +     * @param string $alias
87     */ +     */
88    public function getCondition($alias = null) +    public function getCondition($alias = null)
89    { +    {
90        if ( ! $alias) { +        if ( ! $alias) {
91           $alias = $this->getTable()->getComponentName(); +           $alias = $this->getTable()->getComponentName();
92        } +        }
93        $conditions = array(); +        $conditions = array();
94        foreach ((array) $this->definition['foreign'] as $foreign) { +        foreach ((array) $this->definition['foreign'] as $foreign) {
95            $conditions[] = $alias . '.' . $foreign . ' = ?'; +            $conditions[] = $alias . '.' . $foreign . ' = ?';
96        } +        }
97        return implode(' AND ', $conditions); +        return implode(' AND ', $conditions);
98    } +    }
99 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Relation_Nest.html b/tests_old/coverage/Doctrine_Relation_Nest.html index f8709b1a2..0289cb375 100644 --- a/tests_old/coverage/Doctrine_Relation_Nest.html +++ b/tests_old/coverage/Doctrine_Relation_Nest.html @@ -10,430 +10,430 @@

Coverage for Doctrine_Relation_Nest

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: LocalKey.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: LocalKey.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Relation'); +Doctrine::autoload('Doctrine_Relation');
22/** +/**
23 * Doctrine_Relation_LocalKey + * Doctrine_Relation_LocalKey
24 * This class represents a local key relation + * This class represents a local key relation
25 * + *
26 * @package     Doctrine + * @package     Doctrine
27 * @subpackage  Relation + * @subpackage  Relation
28 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
29 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31 * @since       1.0 + * @since       1.0
32 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
33 */ + */
34class Doctrine_Relation_LocalKey extends Doctrine_Relation +class Doctrine_Relation_LocalKey extends Doctrine_Relation
35{ +{
36    /** +    /**
37     * fetchRelatedFor +     * fetchRelatedFor
38     * +     *
39     * fetches a component related to given record +     * fetches a component related to given record
40     * +     *
41     * @param Doctrine_Record $record +     * @param Doctrine_Record $record
42     * @return Doctrine_Record|Doctrine_Collection +     * @return Doctrine_Record|Doctrine_Collection
43     */ +     */
44    public function fetchRelatedFor(Doctrine_Record $record) +    public function fetchRelatedFor(Doctrine_Record $record)
45    { +    {
46        $id = $record->get($this->definition['local']); +        $id = $record->get($this->definition['local']);
47 +
48        if (empty($id) || ! $this->definition['table']->getAttribute(Doctrine::ATTR_LOAD_REFERENCES)) { +        if (empty($id) || ! $this->definition['table']->getAttribute(Doctrine::ATTR_LOAD_REFERENCES)) {
49            $related = $this->getTable()->create(); +            $related = $this->getTable()->create();
50        } else { +        } else {
51            $dql  = 'FROM ' . $this->getTable()->getComponentName() +            $dql  = 'FROM ' . $this->getTable()->getComponentName()
52                 . ' WHERE ' . $this->getCondition(); +                 . ' WHERE ' . $this->getCondition();
53 +
54            $related = $this->getTable() +            $related = $this->getTable()
55                            ->getConnection() +                            ->getConnection()
56                            ->query($dql, array($id)) +                            ->query($dql, array($id))
57                            ->getFirst(); +                            ->getFirst();
58             +            
59            if ( ! $related || empty($related)) { +            if ( ! $related || empty($related)) {
60                $related = $this->getTable()->create(); +                $related = $this->getTable()->create();
61            } +            }
62        } +        }
63 +
64        $record->set($this->definition['local'], $related, false); +        $record->set($this->definition['local'], $related, false);
65 +
66        return $related; +        return $related;
67    } +    }
68 +
69    /** +    /**
70     * getCondition +     * getCondition
71     * +     *
72     * @param string $alias +     * @param string $alias
73     */ +     */
74    public function getCondition($alias = null) +    public function getCondition($alias = null)
75    { +    {
76        if ( ! $alias) { +        if ( ! $alias) {
77           $alias = $this->getTable()->getComponentName(); +           $alias = $this->getTable()->getComponentName();
78        } +        }
79        return $alias . '.' . $this->definition['foreign'] . ' = ?'; +        return $alias . '.' . $this->definition['foreign'] . ' = ?';
80    } +    }
81 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Relation_Parser.html b/tests_old/coverage/Doctrine_Relation_Parser.html index 67c2fa54c..27e7d816c 100644 --- a/tests_old/coverage/Doctrine_Relation_Parser.html +++ b/tests_old/coverage/Doctrine_Relation_Parser.html @@ -10,1471 +10,1471 @@

Coverage for Doctrine_Relation_Parser

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Self.php 1434 2007-05-22 15:57:17Z zYne $ + *  $Id: Self.php 1434 2007-05-22 15:57:17Z zYne $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Relation_Association'); +Doctrine::autoload('Doctrine_Relation_Association');
22/** +/**
23 * Doctrine_Relation_Association_Self + * Doctrine_Relation_Association_Self
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Relation + * @subpackage  Relation
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 1434 $ + * @version     $Revision: 1434 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Relation_Nest extends Doctrine_Relation_Association +class Doctrine_Relation_Nest extends Doctrine_Relation_Association
34{ +{
35    /** +    /**
36     * getRelationDql +     * getRelationDql
37     * +     *
38     * @param integer $count +     * @param integer $count
39     * @return string +     * @return string
40     */ +     */
41    public function getRelationDql($count, $context = 'record') +    public function getRelationDql($count, $context = 'record')
42    { +    {
43        switch ($context) { +        switch ($context) {
44            case 'record': +            case 'record':
45                $sub    = 'SELECT '.$this->definition['foreign']  +                $sub    = 'SELECT '.$this->definition['foreign'] 
46                        . ' FROM '.$this->definition['refTable']->getTableName() +                        . ' FROM '.$this->definition['refTable']->getTableName()
47                        . ' WHERE '.$this->definition['local'] +                        . ' WHERE '.$this->definition['local']
48                        . ' = ?'; +                        . ' = ?';
49 +
50                $sub2   = 'SELECT '.$this->definition['local'] +                $sub2   = 'SELECT '.$this->definition['local']
51                        . ' FROM '.$this->definition['refTable']->getTableName() +                        . ' FROM '.$this->definition['refTable']->getTableName()
52                        . ' WHERE '.$this->definition['foreign'] +                        . ' WHERE '.$this->definition['foreign']
53                        . ' = ?'; +                        . ' = ?';
54 +
55                $dql  = 'FROM ' . $this->definition['table']->getComponentName() +                $dql  = 'FROM ' . $this->definition['table']->getComponentName()
56                      . '.' . $this->definition['refTable']->getComponentName() +                      . '.' . $this->definition['refTable']->getComponentName()
57                      . ' WHERE ' . $this->definition['table']->getComponentName() +                      . ' WHERE ' . $this->definition['table']->getComponentName()
58                      . '.' . $this->definition['table']->getIdentifier()  +                      . '.' . $this->definition['table']->getIdentifier() 
59                      . ' IN (' . $sub . ')' +                      . ' IN (' . $sub . ')'
60                      . ' || ' . $this->definition['table']->getComponentName()  +                      . ' || ' . $this->definition['table']->getComponentName() 
61                      . '.' . $this->definition['table']->getIdentifier()  +                      . '.' . $this->definition['table']->getIdentifier() 
62                      . ' IN (' . $sub2 . ')'; +                      . ' IN (' . $sub2 . ')';
63                break; +                break;
64            case 'collection': +            case 'collection':
65                $sub  = substr(str_repeat('?, ', $count),0,-2); +                $sub  = substr(str_repeat('?, ', $count),0,-2);
66                $dql  = 'FROM '.$this->definition['refTable']->getComponentName() +                $dql  = 'FROM '.$this->definition['refTable']->getComponentName()
67                      . '.' . $this->definition['table']->getComponentName() +                      . '.' . $this->definition['table']->getComponentName()
68                      . ' WHERE '.$this->definition['refTable']->getComponentName() +                      . ' WHERE '.$this->definition['refTable']->getComponentName()
69                      . '.' . $this->definition['local'] . ' IN (' . $sub . ')'; +                      . '.' . $this->definition['local'] . ' IN (' . $sub . ')';
70        }; +        };
71 +
72        return $dql; +        return $dql;
73    } +    }
74 +
75    /** +    /**
76    public function fetchRelatedFor(Doctrine_Record $record) +    public function fetchRelatedFor(Doctrine_Record $record)
77    { +    {
78        $id = $record->getIncremented(); +        $id = $record->getIncremented();
79 +
80        if (empty($id) || ! $this->definition['table']->getAttribute(Doctrine::ATTR_LOAD_REFERENCES)) { +        if (empty($id) || ! $this->definition['table']->getAttribute(Doctrine::ATTR_LOAD_REFERENCES)) {
81            return new Doctrine_Collection($this->getTable()); +            return new Doctrine_Collection($this->getTable());
82        } else { +        } else {
83            $q = new Doctrine_Query(); +            $q = new Doctrine_Query();
84             +            
85            $c  = $this->getTable()->getComponentName(); +            $c  = $this->getTable()->getComponentName();
86            $a  = substr($c, 0, 1); +            $a  = substr($c, 0, 1);
87            $c2 = $this->getAssociationTable()->getComponentName(); +            $c2 = $this->getAssociationTable()->getComponentName();
88            $a2 = substr($c2, 0, 1); +            $a2 = substr($c2, 0, 1);
89 +
90            $q->from($c) +            $q->from($c)
91              ->innerJoin($c . '.' . $c2) +              ->innerJoin($c . '.' . $c2)
92 +
93            $sub = 'SELECT ' . $this->getForeign()  +            $sub = 'SELECT ' . $this->getForeign() 
94                 . ' FROM '  . $c2 +                 . ' FROM '  . $c2
95                 . ' WHERE ' . $this->getLocal()  +                 . ' WHERE ' . $this->getLocal() 
96                 . ' = ?'; +                 . ' = ?';
97        } +        }
98    } +    }
99    */ +    */
100 +
101    public function fetchRelatedFor(Doctrine_Record $record) +    public function fetchRelatedFor(Doctrine_Record $record)
102    { +    {
103        $id = $record->getIncremented(); +        $id = $record->getIncremented();
104 +
105 +
106        if (empty($id) || ! $this->definition['table']->getAttribute(Doctrine::ATTR_LOAD_REFERENCES)) { +        if (empty($id) || ! $this->definition['table']->getAttribute(Doctrine::ATTR_LOAD_REFERENCES)) {
107            return new Doctrine_Collection($this->getTable()); +            return new Doctrine_Collection($this->getTable());
108        } else { +        } else {
109            $q = new Doctrine_RawSql(); +            $q = new Doctrine_RawSql();
110 +
111            $assocTable = $this->getAssociationFactory()->getTableName(); +            $assocTable = $this->getAssociationFactory()->getTableName();
112            $tableName  = $record->getTable()->getTableName(); +            $tableName  = $record->getTable()->getTableName();
113            $identifier = $record->getTable()->getIdentifier(); +            $identifier = $record->getTable()->getIdentifier();
114     +    
115            $sub = 'SELECT ' . $this->getForeign() +            $sub = 'SELECT ' . $this->getForeign()
116                 . ' FROM ' . $assocTable  +                 . ' FROM ' . $assocTable 
117                 . ' WHERE ' . $this->getLocal()  +                 . ' WHERE ' . $this->getLocal() 
118                 . ' = ?'; +                 . ' = ?';
119 +
120            $condition[] = $tableName . '.' . $identifier . ' IN (' . $sub . ')'; +            $condition[] = $tableName . '.' . $identifier . ' IN (' . $sub . ')';
121            $joinCondition[] = $tableName . '.' . $identifier . ' = ' . $assocTable . '.' . $this->getForeign(); +            $joinCondition[] = $tableName . '.' . $identifier . ' = ' . $assocTable . '.' . $this->getForeign();
122 +
123            if ($this->definition['equal']) { +            if ($this->definition['equal']) {
124                $sub2   = 'SELECT ' . $this->getLocal() +                $sub2   = 'SELECT ' . $this->getLocal()
125                        . ' FROM '  . $assocTable +                        . ' FROM '  . $assocTable
126                        . ' WHERE ' . $this->getForeign() +                        . ' WHERE ' . $this->getForeign()
127                        . ' = ?'; +                        . ' = ?';
128 +
129                $condition[] = $tableName . '.' . $identifier . ' IN (' . $sub2 . ')'; +                $condition[] = $tableName . '.' . $identifier . ' IN (' . $sub2 . ')';
130                $joinCondition[] = $tableName . '.' . $identifier . ' = ' . $assocTable . '.' . $this->getLocal(); +                $joinCondition[] = $tableName . '.' . $identifier . ' = ' . $assocTable . '.' . $this->getLocal();
131            } +            }
132            $q->select('{'.$tableName.'.*}, {'.$assocTable.'.*}') +            $q->select('{'.$tableName.'.*}, {'.$assocTable.'.*}')
133              ->from($tableName . ' INNER JOIN ' . $assocTable . ' ON ' . implode(' OR ', $joinCondition)) +              ->from($tableName . ' INNER JOIN ' . $assocTable . ' ON ' . implode(' OR ', $joinCondition))
134              ->where(implode(' OR ', $condition)); +              ->where(implode(' OR ', $condition));
135            $q->addComponent($tableName,  $record->getTable()->getComponentName()); +            $q->addComponent($tableName,  $record->getTable()->getComponentName());
136            $q->addComponent($assocTable, $record->getTable()->getComponentName(). '.' . $this->getAssociationFactory()->getComponentName()); +            $q->addComponent($assocTable, $record->getTable()->getComponentName(). '.' . $this->getAssociationFactory()->getComponentName());
137 +
138            $params = ($this->definition['equal']) ? array($id, $id) : array($id); +            $params = ($this->definition['equal']) ? array($id, $id) : array($id);
139 +
140            return $q->execute($params); +            return $q->execute($params);
141        } +        }
142    } +    }
143 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Relation_Parser_Exception.html b/tests_old/coverage/Doctrine_Relation_Parser_Exception.html index e4d0d4f7c..499fc0ced 100644 --- a/tests_old/coverage/Doctrine_Relation_Parser_Exception.html +++ b/tests_old/coverage/Doctrine_Relation_Parser_Exception.html @@ -10,103 +10,103 @@

Coverage for Doctrine_Relation_Parser_Exception

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Table.php 1397 2007-05-19 19:54:15Z zYne $ + *  $Id: Table.php 1397 2007-05-19 19:54:15Z zYne $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Relation_Parser + * Doctrine_Relation_Parser
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Relation + * @subpackage  Relation
27 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @version     $Revision: 1397 $ + * @version     $Revision: 1397 $
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31 * @since       1.0 + * @since       1.0
32 * @todo Composite key support? + * @todo Composite key support?
33 */ + */
34class Doctrine_Relation_Parser  +class Doctrine_Relation_Parser 
35{ +{
36    /** +    /**
37     * @var Doctrine_Table $_table          the table object this parser belongs to +     * @var Doctrine_Table $_table          the table object this parser belongs to
38     */ +     */
39    protected $_table; +    protected $_table;
40 +
41    /** +    /**
42     * @var array $_relations               an array containing all the Doctrine_Relation objects for this table +     * @var array $_relations               an array containing all the Doctrine_Relation objects for this table
43     */ +     */
44    protected $_relations = array(); +    protected $_relations = array();
45 +
46    /** +    /**
47     * @var array $_pending                 relations waiting for parsing +     * @var array $_pending                 relations waiting for parsing
48     */ +     */
49    protected $_pending   = array(); +    protected $_pending   = array();
50 +
51    /** +    /**
52     * constructor +     * constructor
53     * +     *
54     * @param Doctrine_Table $table         the table object this parser belongs to +     * @param Doctrine_Table $table         the table object this parser belongs to
55     */ +     */
56    public function __construct(Doctrine_Table $table)  +    public function __construct(Doctrine_Table $table) 
57    { +    {
58        $this->_table = $table; +        $this->_table = $table;
59    } +    }
60 +
61    /** +    /**
62     * getTable +     * getTable
63     * +     *
64     * @return Doctrine_Table   the table object this parser belongs to +     * @return Doctrine_Table   the table object this parser belongs to
65     */ +     */
66    public function getTable() +    public function getTable()
67    { +    {
68        return $this->_table; +        return $this->_table;
69    } +    }
70 +
71    /** +    /**
72     * getPendingRelation +     * getPendingRelation
73     * +     *
74     * @return array            an array defining a pending relation +     * @return array            an array defining a pending relation
75     */ +     */
76    public function getPendingRelation($name)  +    public function getPendingRelation($name) 
77    { +    {
78        if ( ! isset($this->_pending[$name])) { +        if ( ! isset($this->_pending[$name])) {
79            throw new Doctrine_Relation_Exception('Unknown pending relation ' . $name); +            throw new Doctrine_Relation_Exception('Unknown pending relation ' . $name);
80        } +        }
81         +        
82        return $this->_pending[$name]; +        return $this->_pending[$name];
83    } +    }
84     +    
85    public function hasRelation($name) +    public function hasRelation($name)
86    { +    {
87        if ( ! isset($this->_pending[$name]) && ! isset($this->_relations[$name])) { +        if ( ! isset($this->_pending[$name]) && ! isset($this->_relations[$name])) {
88            return false; +            return false;
89        } +        }
90         +        
91        return true; +        return true;
92    } +    }
93 +
94    /** +    /**
95     * binds a relation +     * binds a relation
96     * +     *
97     * @param string $name +     * @param string $name
98     * @param string $field +     * @param string $field
99     * @return void +     * @return void
100     */ +     */
101    public function bind($name, $options = array()) +    public function bind($name, $options = array())
102    { +    {
103        if (isset($this->relations[$name])) { +        if (isset($this->relations[$name])) {
104            unset($this->relations[$name]); +            unset($this->relations[$name]);
105        } +        }
106 +
107        /* looks like old code? +        /* looks like old code?
108        $lower = strtolower($name); +        $lower = strtolower($name);
109        if ($this->_table->hasColumn($lower)) { +        if ($this->_table->hasColumn($lower)) {
110            throw new Doctrine_Relation_Exception("Couldn't bind relation. Column with name " . $lower . ' already exists!'); +            throw new Doctrine_Relation_Exception("Couldn't bind relation. Column with name " . $lower . ' already exists!');
111        } +        }
112        */ +        */
113 +
114        $e    = explode(' as ', $name); +        $e    = explode(' as ', $name);
115        $name = $e[0]; +        $name = $e[0];
116        $alias = isset($e[1]) ? $e[1] : $name; +        $alias = isset($e[1]) ? $e[1] : $name;
117 +
118        if ( ! isset($options['type'])) { +        if ( ! isset($options['type'])) {
119            throw new Doctrine_Relation_Exception('Relation type not set.'); +            throw new Doctrine_Relation_Exception('Relation type not set.');
120        } +        }
121 +
122        $this->_pending[$alias] = array_merge($options, array('class' => $name, 'alias' => $alias)); +        $this->_pending[$alias] = array_merge($options, array('class' => $name, 'alias' => $alias));
123        /** +        /**
124        $m = Doctrine_Manager::getInstance(); +        $m = Doctrine_Manager::getInstance();
125 +
126        if (isset($options['onDelete'])) { +        if (isset($options['onDelete'])) {
127            $m->addDeleteAction($name, $this->_table->getComponentName(), $options['onDelete']); +            $m->addDeleteAction($name, $this->_table->getComponentName(), $options['onDelete']);
128        } +        }
129        if (isset($options['onUpdate'])) { +        if (isset($options['onUpdate'])) {
130            $m->addUpdateAction($name, $this->_table->getComponentName(), $options['onUpdate']); +            $m->addUpdateAction($name, $this->_table->getComponentName(), $options['onUpdate']);
131        } +        }
132        */ +        */
133 +
134        return $this->_pending[$alias]; +        return $this->_pending[$alias];
135    } +    }
136 +
137    /** +    /**
138     * getRelation +     * getRelation
139     * +     *
140     * @param string $alias      relation alias +     * @param string $alias      relation alias
141     */ +     */
142    public function getRelation($alias, $recursive = true) +    public function getRelation($alias, $recursive = true)
143    { +    {
144        if (isset($this->_relations[$alias])) { +        if (isset($this->_relations[$alias])) {
145            return $this->_relations[$alias]; +            return $this->_relations[$alias];
146        } +        }
147 +
148        if (isset($this->_pending[$alias])) { +        if (isset($this->_pending[$alias])) {
149            $def = $this->_pending[$alias]; +            $def = $this->_pending[$alias];
150            $identifierColumnNames = $this->_table->getIdentifierColumnNames(); +            $identifierColumnNames = $this->_table->getIdentifierColumnNames();
151            $idColumnName = array_pop($identifierColumnNames); +            $idColumnName = array_pop($identifierColumnNames);
152         +        
153            // check if reference class name exists +            // check if reference class name exists
154            // if it does we are dealing with association relation +            // if it does we are dealing with association relation
155            if (isset($def['refClass'])) { +            if (isset($def['refClass'])) {
156                $def = $this->completeAssocDefinition($def); +                $def = $this->completeAssocDefinition($def);
157                $localClasses = array_merge($this->_table->getOption('parents'), array($this->_table->getComponentName())); +                $localClasses = array_merge($this->_table->getOption('parents'), array($this->_table->getComponentName()));
158 +
159                if ( ! isset($this->_pending[$def['refClass']]) &&  +                if ( ! isset($this->_pending[$def['refClass']]) && 
160                     ! isset($this->_relations[$def['refClass']])) { +                     ! isset($this->_relations[$def['refClass']])) {
161 +
162                    $parser = $def['refTable']->getRelationParser(); +                    $parser = $def['refTable']->getRelationParser();
163                    if ( ! $parser->hasRelation($this->_table->getComponentName())) { +                    if ( ! $parser->hasRelation($this->_table->getComponentName())) {
164                        $parser->bind($this->_table->getComponentName(), +                        $parser->bind($this->_table->getComponentName(),
165                                      array('type'    => Doctrine_Relation::ONE, +                                      array('type'    => Doctrine_Relation::ONE,
166                                            'local'   => $def['local'], +                                            'local'   => $def['local'],
167                                            'foreign' => $idColumnName, +                                            'foreign' => $idColumnName,
168                                            'localKey' => true, +                                            'localKey' => true,
169                                            )); +                                            ));
170                    } +                    }
171 +
172                    if ( ! $this->hasRelation($def['refClass'])) { +                    if ( ! $this->hasRelation($def['refClass'])) {
173                        $this->bind($def['refClass'], array('type' => Doctrine_Relation::MANY, +                        $this->bind($def['refClass'], array('type' => Doctrine_Relation::MANY,
174                                                            'foreign' => $def['local'], +                                                            'foreign' => $def['local'],
175                                                            'local'   => $idColumnName)); +                                                            'local'   => $idColumnName));
176                    } +                    }
177                } +                }
178                if (in_array($def['class'], $localClasses)) { +                if (in_array($def['class'], $localClasses)) {
179                    $rel = new Doctrine_Relation_Nest($def); +                    $rel = new Doctrine_Relation_Nest($def);
180                } else { +                } else {
181                    $rel = new Doctrine_Relation_Association($def); +                    $rel = new Doctrine_Relation_Association($def);
182                } +                }
183            } else { +            } else {
184                // simple foreign key relation +                // simple foreign key relation
185                $def = $this->completeDefinition($def); +                $def = $this->completeDefinition($def);
186 +
187                if (isset($def['localKey'])) { +                if (isset($def['localKey'])) {
188                    $rel = new Doctrine_Relation_LocalKey($def); +                    $rel = new Doctrine_Relation_LocalKey($def);
189                } else { +                } else {
190                    $rel = new Doctrine_Relation_ForeignKey($def); +                    $rel = new Doctrine_Relation_ForeignKey($def);
191                } +                }
192            } +            }
193            if (isset($rel)) { +            if (isset($rel)) {
194                // unset pending relation +                // unset pending relation
195                unset($this->_pending[$alias]); +                unset($this->_pending[$alias]);
196 +
197                $this->_relations[$alias] = $rel; +                $this->_relations[$alias] = $rel;
198                return $rel; +                return $rel;
199            } +            }
200        } +        }
201        if ($recursive) { +        if ($recursive) {
202            $this->getRelations(); +            $this->getRelations();
203 +
204            return $this->getRelation($alias, false); +            return $this->getRelation($alias, false);
205        } else { +        } else {
206            throw new Doctrine_Table_Exception('Unknown relation alias ' . $alias); +            throw new Doctrine_Table_Exception('Unknown relation alias ' . $alias);
207        } +        }
208    } +    }
209 +
210    /** +    /**
211     * getRelations +     * getRelations
212     * returns an array containing all relation objects +     * returns an array containing all relation objects
213     * +     *
214     * @return array        an array of Doctrine_Relation objects +     * @return array        an array of Doctrine_Relation objects
215     */ +     */
216    public function getRelations() +    public function getRelations()
217    { +    {
218        foreach ($this->_pending as $k => $v) { +        foreach ($this->_pending as $k => $v) {
219            $this->getRelation($k); +            $this->getRelation($k);
220        } +        }
221 +
222        return $this->_relations; +        return $this->_relations;
223    } +    }
224 +
225    /** +    /**
226     * getImpl +     * getImpl
227     * returns the table class of the concrete implementation for given template +     * returns the table class of the concrete implementation for given template
228     * if the given template is not a template then this method just returns the +     * if the given template is not a template then this method just returns the
229     * table class for the given record +     * table class for the given record
230     * +     *
231     * @param string $template +     * @param string $template
232     */ +     */
233    public function getImpl($template) +    public function getImpl($template)
234    { +    {
235        $conn = $this->_table->getConnection(); +        $conn = $this->_table->getConnection();
236 +
237        if (in_array('Doctrine_Template', class_parents($template))) { +        if (in_array('Doctrine_Template', class_parents($template))) {
238            $impl = $this->_table->getImpl($template); +            $impl = $this->_table->getImpl($template);
239             +            
240            if ($impl === null) { +            if ($impl === null) {
241                throw new Doctrine_Relation_Parser_Exception("Couldn't find concrete implementation for template " . $template); +                throw new Doctrine_Relation_Parser_Exception("Couldn't find concrete implementation for template " . $template);
242            } +            }
243        } else { +        } else {
244            $impl = $template; +            $impl = $template;
245        } +        }
246 +
247        return $conn->getTable($impl); +        return $conn->getTable($impl);
248    } +    }
249 +
250    /** +    /**
251     * Completes the given association definition +     * Completes the given association definition
252     * +     *
253     * @param array $def    definition array to be completed +     * @param array $def    definition array to be completed
254     * @return array        completed definition array +     * @return array        completed definition array
255     */ +     */
256    public function completeAssocDefinition($def)  +    public function completeAssocDefinition($def) 
257    { +    {
258        $conn = $this->_table->getConnection(); +        $conn = $this->_table->getConnection();
259        $def['table'] = $this->getImpl($def['class']); +        $def['table'] = $this->getImpl($def['class']);
260        $def['class'] = $def['table']->getComponentName(); +        $def['class'] = $def['table']->getComponentName();
261        $def['refTable'] = $this->getImpl($def['refClass']); +        $def['refTable'] = $this->getImpl($def['refClass']);
262 +
263        $id = $def['refTable']->getIdentifierColumnNames(); +        $id = $def['refTable']->getIdentifierColumnNames();
264 +
265        if (count($id) > 1) { +        if (count($id) > 1) {
266            if ( ! isset($def['foreign'])) { +            if ( ! isset($def['foreign'])) {
267                // foreign key not set +                // foreign key not set
268                // try to guess the foreign key +                // try to guess the foreign key
269     +    
270                $def['foreign'] = ($def['local'] === $id[0]) ? $id[1] : $id[0]; +                $def['foreign'] = ($def['local'] === $id[0]) ? $id[1] : $id[0];
271            } +            }
272            if ( ! isset($def['local'])) { +            if ( ! isset($def['local'])) {
273                // foreign key not set +                // foreign key not set
274                // try to guess the foreign key +                // try to guess the foreign key
275 +
276                $def['local'] = ($def['foreign'] === $id[0]) ? $id[1] : $id[0]; +                $def['local'] = ($def['foreign'] === $id[0]) ? $id[1] : $id[0];
277            } +            }
278        } else { +        } else {
279 +
280            if ( ! isset($def['foreign'])) { +            if ( ! isset($def['foreign'])) {
281                // foreign key not set +                // foreign key not set
282                // try to guess the foreign key +                // try to guess the foreign key
283     +    
284                $columns = $this->getIdentifiers($def['table']); +                $columns = $this->getIdentifiers($def['table']);
285     +    
286                $def['foreign'] = $columns; +                $def['foreign'] = $columns;
287            } +            }
288            if ( ! isset($def['local'])) { +            if ( ! isset($def['local'])) {
289                // local key not set +                // local key not set
290                // try to guess the local key +                // try to guess the local key
291                $columns = $this->getIdentifiers($this->_table); +                $columns = $this->getIdentifiers($this->_table);
292     +    
293                $def['local'] = $columns; +                $def['local'] = $columns;
294            } +            }
295        } +        }
296        return $def; +        return $def;
297    } +    }
298 +
299    /**  +    /** 
300     * getIdentifiers +     * getIdentifiers
301     * gives a list of identifiers from given table +     * gives a list of identifiers from given table
302     * +     *
303     * the identifiers are in format: +     * the identifiers are in format:
304     * [componentName].[identifier] +     * [componentName].[identifier]
305     * +     *
306     * @param Doctrine_Table $table     table object to retrieve identifiers from +     * @param Doctrine_Table $table     table object to retrieve identifiers from
307     */ +     */
308    public function getIdentifiers(Doctrine_Table $table) +    public function getIdentifiers(Doctrine_Table $table)
309    { +    {
310        $componentNameToLower = strtolower($table->getComponentName()); +        $componentNameToLower = strtolower($table->getComponentName());
311        if (is_array($table->getIdentifier())) { +        if (is_array($table->getIdentifier())) {
312            $columns = array();       +            $columns = array();      
313            foreach ((array) $table->getIdentifierColumnNames() as $identColName) { +            foreach ((array) $table->getIdentifierColumnNames() as $identColName) {
314                $columns[] = $componentNameToLower . '_' . $identColName; +                $columns[] = $componentNameToLower . '_' . $identColName;
315            } +            }
316        } else { +        } else {
317            $columns = $componentNameToLower . '_' . $table->getColumnName( +            $columns = $componentNameToLower . '_' . $table->getColumnName(
318                    $table->getIdentifier()); +                    $table->getIdentifier());
319        } +        }
320 +
321        return $columns; +        return $columns;
322    } +    }
323 +
324    /** +    /**
325     * guessColumns +     * guessColumns
326     * +     *
327     * @param array $classes                    an array of class names +     * @param array $classes                    an array of class names
328     * @param Doctrine_Table $foreignTable      foreign table object +     * @param Doctrine_Table $foreignTable      foreign table object
329     * @return array                            an array of column names +     * @return array                            an array of column names
330     */ +     */
331    public function guessColumns(array $classes, Doctrine_Table $foreignTable) +    public function guessColumns(array $classes, Doctrine_Table $foreignTable)
332    { +    {
333        $conn = $this->_table->getConnection(); +        $conn = $this->_table->getConnection();
334 +
335        foreach ($classes as $class) { +        foreach ($classes as $class) {
336            try { +            try {
337                $table   = $conn->getTable($class); +                $table   = $conn->getTable($class);
338            } catch (Doctrine_Table_Exception $e) { +            } catch (Doctrine_Table_Exception $e) {
339                continue; +                continue;
340            } +            }
341            $columns = $this->getIdentifiers($table); +            $columns = $this->getIdentifiers($table);
342            $found   = true; +            $found   = true;
343 +
344            foreach ((array) $columns as $column) { +            foreach ((array) $columns as $column) {
345                if ( ! $foreignTable->hasColumn($column)) { +                if ( ! $foreignTable->hasColumn($column)) {
346                    $found = false; +                    $found = false;
347                    break; +                    break;
348                } +                }
349            } +            }
350            if ($found) { +            if ($found) {
351                break; +                break;
352            } +            }
353        } +        }
354         +        
355        if ( ! $found) { +        if ( ! $found) {
356            throw new Doctrine_Relation_Exception("Couldn't find columns."); +            throw new Doctrine_Relation_Exception("Couldn't find columns.");
357        } +        }
358 +
359        return $columns; +        return $columns;
360    } +    }
361 +
362    /** +    /**
363     * Completes the given definition +     * Completes the given definition
364     * +     *
365     * @param array $def    definition array to be completed +     * @param array $def    definition array to be completed
366     * @return array        completed definition array +     * @return array        completed definition array
367     * @todo Description: What does it mean to complete a definition? What is done (not how)? +     * @todo Description: What does it mean to complete a definition? What is done (not how)?
368     *       Refactor (too long & nesting level) +     *       Refactor (too long & nesting level)
369     */ +     */
370    public function completeDefinition($def) +    public function completeDefinition($def)
371    { +    {
372        $conn = $this->_table->getConnection(); +        $conn = $this->_table->getConnection();
373        $def['table'] = $this->getImpl($def['class']); +        $def['table'] = $this->getImpl($def['class']);
374        $def['class'] = $def['table']->getComponentName(); +        $def['class'] = $def['table']->getComponentName();
375 +
376        $foreignClasses = array_merge($def['table']->getOption('parents'), array($def['class'])); +        $foreignClasses = array_merge($def['table']->getOption('parents'), array($def['class']));
377        $localClasses   = array_merge($this->_table->getOption('parents'), array($this->_table->getComponentName())); +        $localClasses   = array_merge($this->_table->getOption('parents'), array($this->_table->getComponentName()));
378 +
379        $localIdentifierColumnNames = $this->_table->getIdentifierColumnNames(); +        $localIdentifierColumnNames = $this->_table->getIdentifierColumnNames();
380        $localIdColumnName = array_pop($localIdentifierColumnNames); +        $localIdColumnName = array_pop($localIdentifierColumnNames);
381        $foreignIdentifierColumnNames = $def['table']->getIdentifierColumnNames(); +        $foreignIdentifierColumnNames = $def['table']->getIdentifierColumnNames();
382        $foreignIdColumnName = array_pop($foreignIdentifierColumnNames); +        $foreignIdColumnName = array_pop($foreignIdentifierColumnNames);
383 +
384        if (isset($def['local'])) { +        if (isset($def['local'])) {
385            if ( ! isset($def['foreign'])) { +            if ( ! isset($def['foreign'])) {
386                // local key is set, but foreign key is not +                // local key is set, but foreign key is not
387                // try to guess the foreign key +                // try to guess the foreign key
388 +
389                if ($def['local'] === $localIdColumnName) { +                if ($def['local'] === $localIdColumnName) {
390                    $def['foreign'] = $this->guessColumns($localClasses, $def['table']); +                    $def['foreign'] = $this->guessColumns($localClasses, $def['table']);
391                } else { +                } else {
392                    // the foreign field is likely to be the +                    // the foreign field is likely to be the
393                    // identifier of the foreign class +                    // identifier of the foreign class
394                    $def['foreign'] = $foreignIdColumnName; +                    $def['foreign'] = $foreignIdColumnName;
395                    $def['localKey'] = true; +                    $def['localKey'] = true;
396                } +                }
397            } else { +            } else {
398                if ($def['local'] !== $localIdColumnName &&  +                if ($def['local'] !== $localIdColumnName && 
399                    $def['type'] == Doctrine_Relation::ONE) { +                    $def['type'] == Doctrine_Relation::ONE) {
400                    $def['localKey'] = true; +                    $def['localKey'] = true;
401                } +                }
402            } +            }
403        } else { +        } else {
404            if (isset($def['foreign'])) { +            if (isset($def['foreign'])) {
405                // local key not set, but foreign key is set +                // local key not set, but foreign key is set
406                // try to guess the local key +                // try to guess the local key
407                if ($def['foreign'] === $foreignIdColumnName) { +                if ($def['foreign'] === $foreignIdColumnName) {
408                    $def['localKey'] = true; +                    $def['localKey'] = true;
409                    try { +                    try {
410                        $def['local'] = $this->guessColumns($foreignClasses, $this->_table); +                        $def['local'] = $this->guessColumns($foreignClasses, $this->_table);
411                    } catch (Doctrine_Relation_Exception $e) { +                    } catch (Doctrine_Relation_Exception $e) {
412                        $def['local'] = $localIdColumnName; +                        $def['local'] = $localIdColumnName;
413                    } +                    }
414                } else { +                } else {
415                    $def['local'] = $localIdColumnName; +                    $def['local'] = $localIdColumnName;
416                } +                }
417            } else { +            } else {
418                // neither local or foreign key is being set +                // neither local or foreign key is being set
419                // try to guess both keys +                // try to guess both keys
420 +
421                $conn = $this->_table->getConnection(); +                $conn = $this->_table->getConnection();
422 +
423                // the following loops are needed for covering inheritance +                // the following loops are needed for covering inheritance
424                foreach ($localClasses as $class) { +                foreach ($localClasses as $class) {
425                    $table = $conn->getTable($class); +                    $table = $conn->getTable($class);
426                    $identifierColumnNames = $table->getIdentifierColumnNames(); +                    $identifierColumnNames = $table->getIdentifierColumnNames();
427                    $idColumnName = array_pop($identifierColumnNames); +                    $idColumnName = array_pop($identifierColumnNames);
428                    $column = strtolower($table->getComponentName()) +                    $column = strtolower($table->getComponentName())
429                            . '_' . $idColumnName; +                            . '_' . $idColumnName;
430 +
431                    foreach ($foreignClasses as $class2) { +                    foreach ($foreignClasses as $class2) {
432                        $table2 = $conn->getTable($class2); +                        $table2 = $conn->getTable($class2);
433                        if ($table2->hasColumn($column)) { +                        if ($table2->hasColumn($column)) {
434                            $def['foreign'] = $column; +                            $def['foreign'] = $column;
435                            $def['local'] = $idColumnName; +                            $def['local'] = $idColumnName;
436                            return $def; +                            return $def;
437                        } +                        }
438                    } +                    }
439                } +                }
440 +
441                foreach ($foreignClasses as $class) { +                foreach ($foreignClasses as $class) {
442                    $table  = $conn->getTable($class); +                    $table  = $conn->getTable($class);
443                    $identifierColumnNames = $table->getIdentifierColumnNames(); +                    $identifierColumnNames = $table->getIdentifierColumnNames();
444                    $idColumnName = array_pop($identifierColumnNames); +                    $idColumnName = array_pop($identifierColumnNames);
445                    $column = strtolower($table->getComponentName()) +                    $column = strtolower($table->getComponentName())
446                            . '_' . $idColumnName; +                            . '_' . $idColumnName;
447                 +                
448                    foreach ($localClasses as $class2) { +                    foreach ($localClasses as $class2) {
449                        $table2 = $conn->getTable($class2); +                        $table2 = $conn->getTable($class2);
450                        if ($table2->hasColumn($column)) { +                        if ($table2->hasColumn($column)) {
451                            $def['foreign']  = $idColumnName; +                            $def['foreign']  = $idColumnName;
452                            $def['local']    = $column; +                            $def['local']    = $column;
453                            $def['localKey'] = true; +                            $def['localKey'] = true;
454                            return $def; +                            return $def;
455                        } +                        }
456                    } +                    }
457                } +                }
458 +
459                // auto-add columns and auto-build relation +                // auto-add columns and auto-build relation
460                $columns = array(); +                $columns = array();
461                foreach ((array) $this->_table->getIdentifierColumnNames() as $id) { +                foreach ((array) $this->_table->getIdentifierColumnNames() as $id) {
462                    // ?? should this not be $this->_table->getComponentName() ?? +                    // ?? should this not be $this->_table->getComponentName() ??
463                    $column = strtolower($table->getComponentName()) +                    $column = strtolower($table->getComponentName())
464                            . '_' . $id; +                            . '_' . $id;
465 +
466                    $col = $this->_table->getColumnDefinition($id); +                    $col = $this->_table->getColumnDefinition($id);
467                    $type = $col['type']; +                    $type = $col['type'];
468                    $length = $col['length']; +                    $length = $col['length'];
469 +
470                    unset($col['type']); +                    unset($col['type']);
471                    unset($col['length']); +                    unset($col['length']);
472                    unset($col['autoincrement']); +                    unset($col['autoincrement']);
473                    unset($col['sequence']); +                    unset($col['sequence']);
474                    unset($col['primary']); +                    unset($col['primary']);
475 +
476                    $def['table']->setColumn($column, $type, $length, $col); +                    $def['table']->setColumn($column, $type, $length, $col);
477                     +                    
478                    $columns[] = $column; +                    $columns[] = $column;
479                } +                }
480                if (count($columns) > 1) { +                if (count($columns) > 1) {
481                    $def['foreign'] = $columns; +                    $def['foreign'] = $columns;
482                } else { +                } else {
483                    $def['foreign'] = $columns[0]; +                    $def['foreign'] = $columns[0];
484                } +                }
485                $def['local'] = $localIdColumnName; +                $def['local'] = $localIdColumnName;
486            } +            }
487        } +        }
488        return $def; +        return $def;
489    } +    }
490 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Search.html b/tests_old/coverage/Doctrine_Search.html index 94dbfa17d..a1ecca30b 100644 --- a/tests_old/coverage/Doctrine_Search.html +++ b/tests_old/coverage/Doctrine_Search.html @@ -10,882 +10,882 @@

Coverage for Doctrine_Search

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id$ + *  $Id$
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */         + */        
21Doctrine::autoload('Doctrine_Relation_Exception'); +Doctrine::autoload('Doctrine_Relation_Exception');
22/** +/**
23 * Doctrine_Relation_Parser_Exception + * Doctrine_Relation_Parser_Exception
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Relation + * @subpackage  Relation
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision$ + * @version     $Revision$
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Relation_Parser_Exception extends Doctrine_Relation_Exception +class Doctrine_Relation_Parser_Exception extends Doctrine_Relation_Exception
34 { }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id$ + *  $Id$
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Search + * Doctrine_Search
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Search + * @subpackage  Search
27 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @version     $Revision$ + * @version     $Revision$
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31 * @since       1.0 + * @since       1.0
32 */ + */
33class Doctrine_Search extends Doctrine_Plugin +class Doctrine_Search extends Doctrine_Plugin
34{ +{
35    const INDEX_FILES = 0; +    const INDEX_FILES = 0;
36 +
37    const INDEX_TABLES = 1; +    const INDEX_TABLES = 1;
38 +
39    protected $_options = array('generateFiles' => false, +    protected $_options = array('generateFiles' => false,
40                                'type'          => self::INDEX_TABLES, +                                'type'          => self::INDEX_TABLES,
41                                'className'     => '%CLASS%Index', +                                'className'     => '%CLASS%Index',
42                                'generatePath'  => false, +                                'generatePath'  => false,
43                                'resource'      => null, +                                'resource'      => null,
44                                'batchUpdates'  => false, +                                'batchUpdates'  => false,
45                                'pluginTable'   => false, +                                'pluginTable'   => false,
46                                'fields'        => array(), +                                'fields'        => array(),
47                                'connection'    => null); +                                'connection'    => null);
48                                 +                                
49    protected $_built = false; +    protected $_built = false;
50 +
51     +    
52    /** +    /**
53     * __construct  +     * __construct 
54     *  +     * 
55     * @param array $options  +     * @param array $options 
56     * @return void +     * @return void
57     */ +     */
58    public function __construct(array $options) +    public function __construct(array $options)
59    { +    {
60        $this->_options = array_merge($this->_options, $options); +        $this->_options = array_merge($this->_options, $options);
61         +        
62        if ( ! isset($this->_options['analyzer'])) { +        if ( ! isset($this->_options['analyzer'])) {
63            $this->_options['analyzer'] = new Doctrine_Search_Analyzer_Standard(); +            $this->_options['analyzer'] = new Doctrine_Search_Analyzer_Standard();
64        } +        }
65        if ( ! isset($this->_options['connection'])) { +        if ( ! isset($this->_options['connection'])) {
66            $this->_options['connection'] = Doctrine_Manager::connection(); +            $this->_options['connection'] = Doctrine_Manager::connection();
67        } +        }
68    } +    }
69 +
70 +
71    /** +    /**
72     * search  +     * search 
73     *  +     * 
74     * @param string $query  +     * @param string $query 
75     * @return Doctrine_Collection The collection of search results +     * @return Doctrine_Collection The collection of search results
76     */ +     */
77    public function search($query) +    public function search($query)
78    { +    {
79        $q = new Doctrine_Search_Query($this->_options['pluginTable']); +        $q = new Doctrine_Search_Query($this->_options['pluginTable']);
80         +        
81        $q->query($query); +        $q->query($query);
82         +        
83        return $this->_options['connection']->fetchAll($q->getSql(), $q->getParams());; +        return $this->_options['connection']->fetchAll($q->getSql(), $q->getParams());;
84    } +    }
85     +    
86    /** +    /**
87     * analyze  +     * analyze 
88     *  +     * 
89     * @param string $text  +     * @param string $text 
90     * @return void +     * @return void
91     */ +     */
92    public function analyze($text) +    public function analyze($text)
93    { +    {
94        return $this->_options['analyzer']->analyze($text); +        return $this->_options['analyzer']->analyze($text);
95    } +    }
96 +
97    /** +    /**
98     * updateIndex +     * updateIndex
99     * updates the index +     * updates the index
100     * +     *
101     * @param Doctrine_Record $record +     * @param Doctrine_Record $record
102     * @return integer +     * @return integer
103     */ +     */
104    public function updateIndex(array $data) +    public function updateIndex(array $data)
105    { +    {
106        $this->buildDefinition();  +        $this->buildDefinition(); 
107 +
108        $fields = $this->getOption('fields'); +        $fields = $this->getOption('fields');
109        $class  = $this->getOption('className'); +        $class  = $this->getOption('className');
110        $name   = $this->getOption('resource')->getComponentName(); +        $name   = $this->getOption('resource')->getComponentName();
111        $conn   = $this->getOption('resource')->getConnection(); +        $conn   = $this->getOption('resource')->getConnection();
112        $identifier = $this->_options['resource']->getIdentifier(); +        $identifier = $this->_options['resource']->getIdentifier();
113         +        
114        $q = Doctrine_Query::create()->delete() +        $q = Doctrine_Query::create()->delete()
115                                     ->from($class); +                                     ->from($class);
116        foreach ((array) $identifier as $id) { +        foreach ((array) $identifier as $id) {
117            $q->addWhere($id . ' = ?', array($data[$id])); +            $q->addWhere($id . ' = ?', array($data[$id]));
118        } +        }
119        $q->execute(); +        $q->execute();
120 +
121        if ($this->_options['batchUpdates'] === true) { +        if ($this->_options['batchUpdates'] === true) {
122            $index = new $class();  +            $index = new $class(); 
123 +
124            foreach ((array) $this->_options['resource']->getIdentifier() as $id) { +            foreach ((array) $this->_options['resource']->getIdentifier() as $id) {
125                $index->$id = $data[$id]; +                $index->$id = $data[$id];
126            } +            }
127 +
128            $index->save(); +            $index->save();
129        } else { +        } else {
130            foreach ($fields as $field) { +            foreach ($fields as $field) {
131 +
132                $value = $data[$field]; +                $value = $data[$field];
133 +
134                $terms = $this->analyze($value); +                $terms = $this->analyze($value);
135 +
136                foreach ($terms as $pos => $term) { +                foreach ($terms as $pos => $term) {
137                    $index = new $class(); +                    $index = new $class();
138 +
139                    $index->keyword = $term; +                    $index->keyword = $term;
140                    $index->position = $pos; +                    $index->position = $pos;
141                    $index->field = $field; +                    $index->field = $field;
142                    foreach ((array) $this->_options['resource']->getIdentifier() as $id) { +                    foreach ((array) $this->_options['resource']->getIdentifier() as $id) {
143                        $index->$id = $data[$id]; +                        $index->$id = $data[$id];
144                    } +                    }
145 +
146                    $index->save(); +                    $index->save();
147                } +                }
148            } +            }
149        } +        }
150    } +    }
151 +
152    /** +    /**
153     * readTableData  +     * readTableData 
154     *  +     * 
155     * @param mixed $limit  +     * @param mixed $limit 
156     * @param mixed $offset  +     * @param mixed $offset 
157     * @return Doctrine_Collection The collection of results +     * @return Doctrine_Collection The collection of results
158     */ +     */
159    public function readTableData($limit = null, $offset = null) +    public function readTableData($limit = null, $offset = null)
160    { +    {
161        $this->buildDefinition();  +        $this->buildDefinition(); 
162 +
163        $conn      = $this->_options['resource']->getConnection(); +        $conn      = $this->_options['resource']->getConnection();
164        $tableName = $this->_options['resource']->getTableName(); +        $tableName = $this->_options['resource']->getTableName();
165        $id        = $this->_options['resource']->getIdentifier(); +        $id        = $this->_options['resource']->getIdentifier();
166 +
167        $query = 'SELECT * FROM ' . $conn->quoteIdentifier($tableName) +        $query = 'SELECT * FROM ' . $conn->quoteIdentifier($tableName)
168               . ' WHERE ' . $conn->quoteIdentifier($id) +               . ' WHERE ' . $conn->quoteIdentifier($id)
169               . ' IN (SELECT ' . $conn->quoteIdentifier($id) +               . ' IN (SELECT ' . $conn->quoteIdentifier($id)
170               . ' FROM ' . $conn->quoteIdentifier($this->_options['pluginTable']->getTableName()) +               . ' FROM ' . $conn->quoteIdentifier($this->_options['pluginTable']->getTableName())
171               . ' WHERE keyword IS NULL)'; +               . ' WHERE keyword IS NULL)';
172 +
173        $query = $conn->modifyLimitQuery($query, $limit, $offset); +        $query = $conn->modifyLimitQuery($query, $limit, $offset);
174 +
175        return $conn->fetchAll($query); +        return $conn->fetchAll($query);
176    } +    }
177     +    
178 +
179 +
180    /** +    /**
181     * batchUpdateIndex  +     * batchUpdateIndex 
182     *  +     * 
183     * @param mixed $limit  +     * @param mixed $limit 
184     * @param mixed $offset  +     * @param mixed $offset 
185     * @return void +     * @return void
186     */ +     */
187    public function batchUpdateIndex($limit = null, $offset = null) +    public function batchUpdateIndex($limit = null, $offset = null)
188    { +    {
189        $this->buildDefinition(); +        $this->buildDefinition();
190 +
191        $id        = $this->_options['resource']->getIdentifier(); +        $id        = $this->_options['resource']->getIdentifier();
192        $class     = $this->_options['className']; +        $class     = $this->_options['className'];
193        $fields    = $this->_options['fields']; +        $fields    = $this->_options['fields'];
194        $conn      = $this->_options['connection']; +        $conn      = $this->_options['connection'];
195        try { +        try {
196 +
197            $conn->beginTransaction(); +            $conn->beginTransaction();
198 +
199            $rows = $this->readTableData($limit, $offset); +            $rows = $this->readTableData($limit, $offset);
200 +
201            foreach ($rows as $row) { +            foreach ($rows as $row) {
202                $ids[] = $row[$id]; +                $ids[] = $row[$id];
203            } +            }
204 +
205            $conn->exec('DELETE FROM '  +            $conn->exec('DELETE FROM ' 
206                        . $conn->quoteIdentifier($this->_options['pluginTable']->getTableName()) +                        . $conn->quoteIdentifier($this->_options['pluginTable']->getTableName())
207                        . ' WHERE ' . $conn->quoteIdentifier($id) . ' IN (' . implode(', ', $ids) . ')'); +                        . ' WHERE ' . $conn->quoteIdentifier($id) . ' IN (' . implode(', ', $ids) . ')');
208                         +                        
209            foreach ($rows as $row) { +            foreach ($rows as $row) {
210                foreach ($fields as $field) { +                foreach ($fields as $field) {
211                    $data  = $row[$field]; +                    $data  = $row[$field];
212         +        
213                    $terms = $this->analyze($data); +                    $terms = $this->analyze($data);
214         +        
215                    foreach ($terms as $pos => $term) { +                    foreach ($terms as $pos => $term) {
216                        $index = new $class(); +                        $index = new $class();
217         +        
218                        $index->keyword = $term; +                        $index->keyword = $term;
219                        $index->position = $pos; +                        $index->position = $pos;
220                        $index->field = $field; +                        $index->field = $field;
221                         +                        
222                        foreach ((array) $id as $identifier) { +                        foreach ((array) $id as $identifier) {
223                            $index->$identifier = $row[$identifier]; +                            $index->$identifier = $row[$identifier];
224                        } +                        }
225     +    
226                        $index->save(); +                        $index->save();
227                    } +                    }
228                } +                }
229            } +            }
230 +
231            $conn->commit(); +            $conn->commit();
232        } catch (Doctrine_Exception $e) { +        } catch (Doctrine_Exception $e) {
233            $conn->rollback(); +            $conn->rollback();
234        } +        }
235    } +    }
236 +
237    /** +    /**
238     * buildDefinition  +     * buildDefinition 
239     *  +     * 
240     * @return void +     * @return void
241     */ +     */
242    public function buildDefinition() +    public function buildDefinition()
243    { +    {
244     if ($this->_built) { +     if ($this->_built) {
245            return true; +            return true;
246     } +     }
247        $this->_built = true; +        $this->_built = true;
248 +
249        $componentName = $this->_options['resource']->getComponentName(); +        $componentName = $this->_options['resource']->getComponentName();
250 +
251        // check for placeholders +        // check for placeholders
252        if (strpos($this->_options['className'], '%') !== false) { +        if (strpos($this->_options['className'], '%') !== false) {
253            $this->_options['className'] = str_replace('%CLASS%', $componentName, $this->_options['className']); +            $this->_options['className'] = str_replace('%CLASS%', $componentName, $this->_options['className']);
254        } +        }
255 +
256        $className = $this->getOption('className'); +        $className = $this->getOption('className');
257 +
258        if (class_exists($className)) { +        if (class_exists($className)) {
259            return false; +            return false;
260        } +        }
261 +
262        $columns = array('keyword'  => array('type'    => 'string', +        $columns = array('keyword'  => array('type'    => 'string',
263                                             'length'  => 200, +                                             'length'  => 200,
264                                             'primary' => true, +                                             'primary' => true,
265                                             ), +                                             ),
266                         'field'    => array('type'    => 'string', +                         'field'    => array('type'    => 'string',
267                                             'length'  => 50, +                                             'length'  => 50,
268                                             'primary' => true), +                                             'primary' => true),
269                         'position' => array('type'    => 'integer', +                         'position' => array('type'    => 'integer',
270                                             'length'  => 8, +                                             'length'  => 8,
271                                             'primary' => true, +                                             'primary' => true,
272                                             )); +                                             ));
273 +
274        $id = $this->_options['resource']->getIdentifier(); +        $id = $this->_options['resource']->getIdentifier();
275 +
276        $options = array('className' => $className); +        $options = array('className' => $className);
277 +
278        $fk = $this->generateForeignKeys($this->_options['resource']); +        $fk = $this->generateForeignKeys($this->_options['resource']);
279        $columns += $fk; +        $columns += $fk;
280 +
281        $relations = array(); +        $relations = array();
282        // only generate relations for database based searches +        // only generate relations for database based searches
283        if ( ! $this instanceof Doctrine_Search_File) { +        if ( ! $this instanceof Doctrine_Search_File) {
284            $relations = $this->generateRelation($this->_options['resource'], $fk); +            $relations = $this->generateRelation($this->_options['resource'], $fk);
285        } +        }
286 +
287        $this->generateClass($options, $columns, $relations); +        $this->generateClass($options, $columns, $relations);
288 +
289        $this->_options['pluginTable'] = $this->_options['connection']->getTable($this->_options['className']); +        $this->_options['pluginTable'] = $this->_options['connection']->getTable($this->_options['className']);
290 +
291        return true; +        return true;
292    } +    }
293} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Search_Analyzer_Standard.html b/tests_old/coverage/Doctrine_Search_Analyzer_Standard.html index a1645d186..dd00681a4 100644 --- a/tests_old/coverage/Doctrine_Search_Analyzer_Standard.html +++ b/tests_old/coverage/Doctrine_Search_Analyzer_Standard.html @@ -10,897 +10,897 @@

Coverage for Doctrine_Search_Analyzer_Standard

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id$ + *  $Id$
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Search_Analyzer_Standard + * Doctrine_Search_Analyzer_Standard
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Search + * @subpackage  Search
27 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @version     $Revision$ + * @version     $Revision$
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31 * @since       1.0 + * @since       1.0
32 */ + */
33class Doctrine_Search_Analyzer_Standard implements Doctrine_Search_Analyzer_Interface +class Doctrine_Search_Analyzer_Standard implements Doctrine_Search_Analyzer_Interface
34{ +{
35    protected static $_stopwords = array( +    protected static $_stopwords = array(
36                            '0', +                            '0',
37                            '1', +                            '1',
38                            '2', +                            '2',
39                            '3', +                            '3',
40                            '4', +                            '4',
41                            '5', +                            '5',
42                            '6', +                            '6',
43                            '7', +                            '7',
44                            '8', +                            '8',
45                            '9', +                            '9',
46                            '10', +                            '10',
47                            'a', +                            'a',
48                            'about', +                            'about',
49                            'after', +                            'after',
50                            'all', +                            'all',
51                            'almost', +                            'almost',
52                            'along', +                            'along',
53                            'also', +                            'also',
54                            'although', +                            'although',
55                            'amp', +                            'amp',
56                            'an', +                            'an',
57                            'and', +                            'and',
58                            'another', +                            'another',
59                            'any', +                            'any',
60                            'are', +                            'are',
61                            'area', +                            'area',
62                            'arent', +                            'arent',
63                            'around', +                            'around',
64                            'as', +                            'as',
65                            'at', +                            'at',
66                            'available', +                            'available',
67                            'back', +                            'back',
68                            'be', +                            'be',
69                            'because', +                            'because',
70                            'been', +                            'been',
71                            'before', +                            'before',
72                            'being', +                            'being',
73                            'best', +                            'best',
74                            'better', +                            'better',
75                            'big', +                            'big',
76                            'bit', +                            'bit',
77                            'both', +                            'both',
78                            'but', +                            'but',
79                            'by', +                            'by',
80                            'c', +                            'c',
81                            'came', +                            'came',
82                            'can', +                            'can',
83                            'capable', +                            'capable',
84                            'control', +                            'control',
85                            'could', +                            'could',
86                            'course', +                            'course',
87                            'd', +                            'd',
88                            'dan', +                            'dan',
89                            'day', +                            'day',
90                            'decided', +                            'decided',
91                            'did', +                            'did',
92                            'didn', +                            'didn',
93                            'different', +                            'different',
94                            'div', +                            'div',
95                            'do', +                            'do',
96                            'doesn', +                            'doesn',
97                            'don', +                            'don',
98                            'down', +                            'down',
99                            'drive', +                            'drive',
100                            'e', +                            'e',
101                            'each', +                            'each',
102                            'easily', +                            'easily',
103                            'easy', +                            'easy',
104                            'edition', +                            'edition',
105                            'either', +                            'either',
106                            'end', +                            'end',
107                            'enough', +                            'enough',
108                            'even', +                            'even',
109                            'every', +                            'every',
110                            'example', +                            'example',
111                            'few', +                            'few',
112                            'find', +                            'find',
113                            'first', +                            'first',
114                            'for', +                            'for',
115                            'found', +                            'found',
116                            'from', +                            'from',
117                            'get', +                            'get',
118                            'go', +                            'go',
119                            'going', +                            'going',
120                            'good', +                            'good',
121                            'got', +                            'got',
122                            'gt', +                            'gt',
123                            'had', +                            'had',
124                            'hard', +                            'hard',
125                            'has', +                            'has',
126                            'have', +                            'have',
127                            'he', +                            'he',
128                            'her', +                            'her',
129                            'here', +                            'here',
130                            'how', +                            'how',
131                            'i', +                            'i',
132                            'if', +                            'if',
133                            'in', +                            'in',
134                            'into', +                            'into',
135                            'is', +                            'is',
136                            'isn', +                            'isn',
137                            'it', +                            'it',
138                            'just', +                            'just',
139                            'know', +                            'know',
140                            'last', +                            'last',
141                            'left', +                            'left',
142                            'li', +                            'li',
143                            'like', +                            'like',
144                            'little', +                            'little',
145                            'll', +                            'll',
146                            'long', +                            'long',
147                            'look', +                            'look',
148                            'lot', +                            'lot',
149                            'lt', +                            'lt',
150                            'm', +                            'm',
151                            'made', +                            'made',
152                            'make', +                            'make',
153                            'many', +                            'many',
154                            'mb', +                            'mb',
155                            'me', +                            'me',
156                            'menu', +                            'menu',
157                            'might', +                            'might',
158                            'mm', +                            'mm',
159                            'more', +                            'more',
160                            'most', +                            'most',
161                            'much', +                            'much',
162                            'my', +                            'my',
163                            'name', +                            'name',
164                            'nbsp', +                            'nbsp',
165                            'need', +                            'need',
166                            'new', +                            'new',
167                            'no', +                            'no',
168                            'not', +                            'not',
169                            'now', +                            'now',
170                            'number', +                            'number',
171                            'of', +                            'of',
172                            'off', +                            'off',
173                            'old', +                            'old',
174                            'on', +                            'on',
175                            'one', +                            'one',
176                            'only', +                            'only',
177                            'or', +                            'or',
178                            'original', +                            'original',
179                            'other', +                            'other',
180                            'our', +                            'our',
181                            'out', +                            'out',
182                            'over', +                            'over',
183                            'part', +                            'part',
184                            'place', +                            'place',
185                            'point', +                            'point',
186                            'pretty', +                            'pretty',
187                            'probably', +                            'probably',
188                            'problem', +                            'problem',
189                            'put', +                            'put',
190                            'quite', +                            'quite',
191                            'quot', +                            'quot',
192                            'r', +                            'r',
193                            're', +                            're',
194                            'really', +                            'really',
195                            'results', +                            'results',
196                            'right', +                            'right',
197                            's', +                            's',
198                            'same', +                            'same',
199                            'saw', +                            'saw',
200                            'see', +                            'see',
201                            'set', +                            'set',
202                            'several', +                            'several',
203                            'she', +                            'she',
204                            'sherree', +                            'sherree',
205                            'should', +                            'should',
206                            'since', +                            'since',
207                            'size', +                            'size',
208                            'small', +                            'small',
209                            'so', +                            'so',
210                            'some', +                            'some',
211                            'something', +                            'something',
212                            'special', +                            'special',
213                            'still', +                            'still',
214                            'stuff', +                            'stuff',
215                            'such', +                            'such',
216                            'sure', +                            'sure',
217                            'system', +                            'system',
218                            't', +                            't',
219                            'take', +                            'take',
220                            'than', +                            'than',
221                            'that', +                            'that',
222                            'the', +                            'the',
223                            'their', +                            'their',
224                            'them', +                            'them',
225                            'then', +                            'then',
226                            'there', +                            'there',
227                            'these', +                            'these',
228                            'they', +                            'they',
229                            'thing', +                            'thing',
230                            'things', +                            'things',
231                            'think', +                            'think',
232                            'this', +                            'this',
233                            'those', +                            'those',
234                            'though', +                            'though',
235                            'through', +                            'through',
236                            'time', +                            'time',
237                            'to', +                            'to',
238                            'today', +                            'today',
239                            'together', +                            'together',
240                            'too', +                            'too',
241                            'took', +                            'took',
242                            'two', +                            'two',
243                            'up', +                            'up',
244                            'us', +                            'us',
245                            'use', +                            'use',
246                            'used', +                            'used',
247                            'using', +                            'using',
248                            've', +                            've',
249                            'very', +                            'very',
250                            'want', +                            'want',
251                            'was', +                            'was',
252                            'way', +                            'way',
253                            'we', +                            'we',
254                            'well', +                            'well',
255                            'went', +                            'went',
256                            'were', +                            'were',
257                            'what', +                            'what',
258                            'when', +                            'when',
259                            'where', +                            'where',
260                            'which', +                            'which',
261                            'while', +                            'while',
262                            'white', +                            'white',
263                            'who', +                            'who',
264                            'will', +                            'will',
265                            'with', +                            'with',
266                            'would', +                            'would',
267                            'yet', +                            'yet',
268                            'you', +                            'you',
269                            'your', +                            'your',
270                            'yours' +                            'yours'
271                            ); +                            );
272 +
273    public function analyze($text) +    public function analyze($text)
274    { +    {
275     $text = preg_replace('/[\'`´"]/', '', $text); +     $text = preg_replace('/[\'`´"]/', '', $text);
276        $text = preg_replace('/[^A-Za-z0-9]/', ' ', $text); +        $text = preg_replace('/[^A-Za-z0-9]/', ' ', $text);
277        $text = str_replace('  ', ' ', $text); +        $text = str_replace('  ', ' ', $text);
278 +
279        $terms = explode(' ', $text); +        $terms = explode(' ', $text);
280         +        
281        $ret = array(); +        $ret = array();
282        if ( ! empty($terms)) { +        if ( ! empty($terms)) {
283            foreach ($terms as $i => $term) { +            foreach ($terms as $i => $term) {
284                if (empty($term)) { +                if (empty($term)) {
285                    continue; +                    continue;
286                } +                }
287                $lower = strtolower(trim($term)); +                $lower = strtolower(trim($term));
288 +
289                if (in_array($lower, self::$_stopwords)) { +                if (in_array($lower, self::$_stopwords)) {
290                    continue; +                    continue;
291                } +                }
292 +
293                $ret[$i] = $lower; +                $ret[$i] = $lower;
294            } +            }
295        } +        }
296        return $ret; +        return $ret;
297    } +    }
298} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Search_Exception.html b/tests_old/coverage/Doctrine_Search_Exception.html index af4b90476..4d71ad685 100644 --- a/tests_old/coverage/Doctrine_Search_Exception.html +++ b/tests_old/coverage/Doctrine_Search_Exception.html @@ -10,103 +10,103 @@

Coverage for Doctrine_Search_Exception

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Search_File.html b/tests_old/coverage/Doctrine_Search_File.html index fe64ece47..2403f0173 100755 --- a/tests_old/coverage/Doctrine_Search_File.html +++ b/tests_old/coverage/Doctrine_Search_File.html @@ -10,207 +10,207 @@

Coverage for Doctrine_Search_File

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id$ + *  $Id$
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Exception'); +Doctrine::autoload('Doctrine_Exception');
22/** +/**
23 * Doctrine_Search_Exception + * Doctrine_Search_Exception
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Search + * @subpackage  Search
27 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @version     $Revision$ + * @version     $Revision$
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31 * @since       1.0 + * @since       1.0
32 */ + */
33class Doctrine_Search_Exception extends Doctrine_Exception +class Doctrine_Search_Exception extends Doctrine_Exception
34 { }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id$ + *  $Id$
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Search + * Doctrine_Search
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Search + * @subpackage  Search
27 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @version     $Revision$ + * @version     $Revision$
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31 * @since       1.0 + * @since       1.0
32 */ + */
33class Doctrine_Search_File extends Doctrine_Search +class Doctrine_Search_File extends Doctrine_Search
34{ +{
35    public function __construct(array $options = array()) +    public function __construct(array $options = array())
36    { +    {
37        parent::__construct($options); +        parent::__construct($options);
38 +
39        if ( ! isset($this->_options['resource'])) { +        if ( ! isset($this->_options['resource'])) {
40            $table = new Doctrine_Table('File', Doctrine_Manager::connection()); +            $table = new Doctrine_Table('File', Doctrine_Manager::connection());
41             +            
42            $table->setColumn('url', 'string', 255, array('primary' => true)); +            $table->setColumn('url', 'string', 255, array('primary' => true));
43 +
44            $this->_options['resource'] = $table; +            $this->_options['resource'] = $table;
45        } +        }
46         +        
47        if (empty($this->_options['fields'])) { +        if (empty($this->_options['fields'])) {
48            $this->_options['fields'] = array('url', 'content'); +            $this->_options['fields'] = array('url', 'content');
49        } +        }
50         +        
51        $this->buildDefinition(); +        $this->buildDefinition();
52    } +    }
53     +    
54    public function indexDirectory($dir) +    public function indexDirectory($dir)
55    { +    {
56        $it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir), +        $it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir),
57                                                RecursiveIteratorIterator::LEAVES_ONLY); +                                                RecursiveIteratorIterator::LEAVES_ONLY);
58                                                 +                                                
59        foreach ($it as $file) { +        foreach ($it as $file) {
60            if (strpos($file, DIRECTORY_SEPARATOR . '.svn') !== false) { +            if (strpos($file, DIRECTORY_SEPARATOR . '.svn') !== false) {
61                continue;                                                           +                continue;                                                          
62            } +            }
63 +
64            $this->updateIndex(array('url' => $file->getPathName(), +            $this->updateIndex(array('url' => $file->getPathName(),
65                                     'content' => file_get_contents($file))); +                                     'content' => file_get_contents($file)));
66        } +        }
67    } +    }
68} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Search_Listener.html b/tests_old/coverage/Doctrine_Search_Listener.html index 1e2efba7d..9b68520ca 100644 --- a/tests_old/coverage/Doctrine_Search_Listener.html +++ b/tests_old/coverage/Doctrine_Search_Listener.html @@ -10,171 +10,171 @@

Coverage for Doctrine_Search_Listener

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id$ + *  $Id$
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Search_Listener + * Doctrine_Search_Listener
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Search + * @subpackage  Search
27 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @version     $Revision$ + * @version     $Revision$
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31 * @since       1.0 + * @since       1.0
32 */ + */
33class Doctrine_Search_Listener extends Doctrine_Record_Listener  +class Doctrine_Search_Listener extends Doctrine_Record_Listener 
34{ +{
35    protected $_search; +    protected $_search;
36 +
37    public function __construct(Doctrine_Search $search) +    public function __construct(Doctrine_Search $search)
38    { +    {
39        $this->_search = $search; +        $this->_search = $search;
40    } +    }
41 +
42    public function preUpdate(Doctrine_Event $event) +    public function preUpdate(Doctrine_Event $event)
43    { +    {
44    } +    }
45 +
46    public function postUpdate(Doctrine_Event $event) +    public function postUpdate(Doctrine_Event $event)
47    { +    {
48 +
49    } +    }
50    public function postInsert(Doctrine_Event $event) +    public function postInsert(Doctrine_Event $event)
51    { +    {
52        $record = $event->getInvoker(); +        $record = $event->getInvoker();
53         +        
54        $this->_search->updateIndex($record->toArray()); +        $this->_search->updateIndex($record->toArray());
55    } +    }
56} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Search_Query.html b/tests_old/coverage/Doctrine_Search_Query.html index c70db453c..119ba67af 100644 --- a/tests_old/coverage/Doctrine_Search_Query.html +++ b/tests_old/coverage/Doctrine_Search_Query.html @@ -10,708 +10,708 @@

Coverage for Doctrine_Search_Query

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: Hook.php 1939 2007-07-05 23:47:48Z zYne $ + *  $Id: Hook.php 1939 2007-07-05 23:47:48Z zYne $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Search_Query + * Doctrine_Search_Query
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Search + * @subpackage  Search
27 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @version     $Revision$ + * @version     $Revision$
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31 * @since       1.0 + * @since       1.0
32 */ + */
33class Doctrine_Search_Query +class Doctrine_Search_Query
34{ +{
35 +
36    /** +    /**
37     * @var Doctrine_Table $_table          the index table +     * @var Doctrine_Table $_table          the index table
38     */ +     */
39    protected $_table = array(); +    protected $_table = array();
40     +    
41    protected $_sql = ''; +    protected $_sql = '';
42     +    
43    protected $_params = array(); +    protected $_params = array();
44     +    
45    protected $_words = array(); +    protected $_words = array();
46     +    
47    protected $_tokenizer; +    protected $_tokenizer;
48 +
49    protected $_condition; +    protected $_condition;
50 +
51    /** +    /**
52     * @param Doctrine_Table $_table        the index table +     * @param Doctrine_Table $_table        the index table
53     */ +     */
54    public function __construct($table) +    public function __construct($table)
55    { +    {
56        if (is_string($table)) { +        if (is_string($table)) {
57           $table = Doctrine_Manager::table($table); +           $table = Doctrine_Manager::table($table);
58        } else { +        } else {
59            if ( ! $table instanceof Doctrine_Table) { +            if ( ! $table instanceof Doctrine_Table) {
60                throw new Doctrine_Search_Exception('Invalid argument type. Expected instance of Doctrine_Table.'); +                throw new Doctrine_Search_Exception('Invalid argument type. Expected instance of Doctrine_Table.');
61            } +            }
62        } +        }
63 +
64        $this->_tokenizer = new Doctrine_Query_Tokenizer(); +        $this->_tokenizer = new Doctrine_Query_Tokenizer();
65        $this->_table = $table; +        $this->_table = $table;
66 +
67        $foreignId = current(array_diff($this->_table->getColumnNames(), array('keyword', 'field', 'position'))); +        $foreignId = current(array_diff($this->_table->getColumnNames(), array('keyword', 'field', 'position')));
68 +
69        $this->_condition = $foreignId . ' %s (SELECT ' . $foreignId . ' FROM ' . $this->_table->getTableName() . ' WHERE '; +        $this->_condition = $foreignId . ' %s (SELECT ' . $foreignId . ' FROM ' . $this->_table->getTableName() . ' WHERE ';
70    } +    }
71 +
72 +
73    public function query($text) +    public function query($text)
74    { +    {
75        $text = trim($text); +        $text = trim($text);
76 +
77        $foreignId = current(array_diff($this->_table->getColumnNames(), array('keyword', 'field', 'position'))); +        $foreignId = current(array_diff($this->_table->getColumnNames(), array('keyword', 'field', 'position')));
78 +
79        $weighted = false; +        $weighted = false;
80        if (strpos($text, '^') === false) { +        if (strpos($text, '^') === false) {
81            $select = 'SELECT COUNT(keyword) AS relevance, ' . $foreignId; +            $select = 'SELECT COUNT(keyword) AS relevance, ' . $foreignId;
82            $from = 'FROM ' . $this->_table->getTableName(); +            $from = 'FROM ' . $this->_table->getTableName();
83        } else { +        } else {
84            // organize terms according weights +            // organize terms according weights
85            $weighted = true; +            $weighted = true;
86 +
87            $select = 'SELECT SUM(sub_relevance) AS relevance, ' . $foreignId; +            $select = 'SELECT SUM(sub_relevance) AS relevance, ' . $foreignId;
88            $from = 'FROM ' ; +            $from = 'FROM ' ;
89        } +        }
90         +        
91        $where = 'WHERE '; +        $where = 'WHERE ';
92        $where .= $this->parseClause($text); +        $where .= $this->parseClause($text);
93 +
94        $groupby = 'GROUP BY ' . $foreignId; +        $groupby = 'GROUP BY ' . $foreignId;
95        $orderby = 'ORDER BY relevance DESC'; +        $orderby = 'ORDER BY relevance DESC';
96 +
97        $this->_sql = $select . ' ' . $from . ' ' . $where . ' ' . $groupby . ' ' . $orderby; +        $this->_sql = $select . ' ' . $from . ' ' . $where . ' ' . $groupby . ' ' . $orderby;
98    } +    }
99 +
100    public function parseClause($originalClause, $recursive = false) +    public function parseClause($originalClause, $recursive = false)
101    { +    {
102        $clause = $this->_tokenizer->bracketTrim($originalClause); +        $clause = $this->_tokenizer->bracketTrim($originalClause);
103         +        
104        $brackets = false; +        $brackets = false;
105 +
106        if ($clause !== $originalClause) { +        if ($clause !== $originalClause) {
107            $brackets = true; +            $brackets = true;
108        } +        }
109 +
110        $foreignId = current(array_diff($this->_table->getColumnNames(), array('keyword', 'field', 'position'))); +        $foreignId = current(array_diff($this->_table->getColumnNames(), array('keyword', 'field', 'position')));
111         +        
112        $terms = $this->_tokenizer->sqlExplode($clause, ' OR ', '(', ')'); +        $terms = $this->_tokenizer->sqlExplode($clause, ' OR ', '(', ')');
113 +
114        $ret = array(); +        $ret = array();
115 +
116        if (count($terms) > 1) { +        if (count($terms) > 1) {
117            $leavesOnly = true; +            $leavesOnly = true;
118 +
119            foreach ($terms as $k => $term) { +            foreach ($terms as $k => $term) {
120                if ($this->isExpression($term)) { +                if ($this->isExpression($term)) {
121                    $ret[$k] = $this->parseClause($term, true); +                    $ret[$k] = $this->parseClause($term, true);
122                    $leavesOnly = false; +                    $leavesOnly = false;
123                } else { +                } else {
124                    $ret[$k] = $this->parseTerm($term); +                    $ret[$k] = $this->parseTerm($term);
125                } +                }
126            } +            }
127 +
128            $return = implode(' OR ', $ret); +            $return = implode(' OR ', $ret);
129 +
130            if ($leavesOnly && $recursive) { +            if ($leavesOnly && $recursive) {
131                $return = sprintf($this->_condition, 'IN') . $return . ')'; +                $return = sprintf($this->_condition, 'IN') . $return . ')';
132                $brackets = false; +                $brackets = false;
133            } +            }
134        } else { +        } else {
135            $terms = $this->_tokenizer->sqlExplode($clause, ' ', '(', ')'); +            $terms = $this->_tokenizer->sqlExplode($clause, ' ', '(', ')');
136             +            
137            if (count($terms) === 1 && ! $recursive) { +            if (count($terms) === 1 && ! $recursive) {
138                $return = $this->parseTerm($clause); +                $return = $this->parseTerm($clause);
139            } else { +            } else {
140                foreach ($terms as $k => $term) { +                foreach ($terms as $k => $term) {
141                    $term = trim($term); +                    $term = trim($term);
142     +    
143                    if ($term === 'AND') { +                    if ($term === 'AND') {
144                        continue; +                        continue;
145                    } +                    }
146     +    
147                    if (substr($term, 0, 1) === '-') { +                    if (substr($term, 0, 1) === '-') {
148                        $operator = 'NOT IN'; +                        $operator = 'NOT IN';
149                        $term = substr($term, 1); +                        $term = substr($term, 1);
150                    } else { +                    } else {
151                        $operator = 'IN'; +                        $operator = 'IN';
152                    } +                    }
153     +    
154                    if ($this->isExpression($term)) { +                    if ($this->isExpression($term)) {
155                        $ret[$k] = $this->parseClause($term, true); +                        $ret[$k] = $this->parseClause($term, true);
156                    } else { +                    } else {
157                        $ret[$k] = sprintf($this->_condition, $operator) . $this->parseTerm($term) . ')'; +                        $ret[$k] = sprintf($this->_condition, $operator) . $this->parseTerm($term) . ')';
158                    } +                    }
159                } +                }
160                $return = implode(' AND ', $ret); +                $return = implode(' AND ', $ret);
161            } +            }
162        } +        }
163 +
164        if ($brackets) { +        if ($brackets) {
165            return '(' . $return . ')'; +            return '(' . $return . ')';
166        } else { +        } else {
167            return $return; +            return $return;
168        } +        }
169    } +    }
170    public function isExpression($term) +    public function isExpression($term)
171    { +    {
172        if (strpos($term, '(') !== false) { +        if (strpos($term, '(') !== false) {
173            return true; +            return true;
174        } else { +        } else {
175            $terms = $this->_tokenizer->quoteExplode($term); +            $terms = $this->_tokenizer->quoteExplode($term);
176             +            
177            return (count($terms) > 1); +            return (count($terms) > 1);
178        } +        }
179    } +    }
180 +
181    public function parseTerm($term) +    public function parseTerm($term)
182    { +    {
183        $negation = false; +        $negation = false;
184 +
185        if (strpos($term, "'") === false) { +        if (strpos($term, "'") === false) {
186            $where = $this->parseWord($term); +            $where = $this->parseWord($term);
187        } else { +        } else {
188            $term = trim($term, "' "); +            $term = trim($term, "' ");
189 +
190            $terms = $this->_tokenizer->quoteExplode($term); +            $terms = $this->_tokenizer->quoteExplode($term);
191            $where = $this->parseWord($terms[0]); +            $where = $this->parseWord($terms[0]);
192 +
193            foreach ($terms as $k => $word) { +            foreach ($terms as $k => $word) {
194                if ($k === 0) { +                if ($k === 0) {
195                    continue; +                    continue;
196                } +                }
197                $where .= ' AND (position + ' . $k . ') = (SELECT position FROM ' . $this->_table->getTableName() . ' WHERE ' . $this->parseWord($word) . ')'; +                $where .= ' AND (position + ' . $k . ') = (SELECT position FROM ' . $this->_table->getTableName() . ' WHERE ' . $this->parseWord($word) . ')';
198            } +            }
199        } +        }
200        return $where; +        return $where;
201    } +    }
202    public function parseWord($word) +    public function parseWord($word)
203    { +    {
204        $this->_words[] = str_replace('*', '', $word); +        $this->_words[] = str_replace('*', '', $word);
205 +
206        if (strpos($word, '?') !== false || +        if (strpos($word, '?') !== false ||
207            strpos($word, '*') !== false) { +            strpos($word, '*') !== false) {
208 +
209            $word = str_replace('*', '%', $word); +            $word = str_replace('*', '%', $word);
210 +
211            $where = 'keyword LIKE ?'; +            $where = 'keyword LIKE ?';
212 +
213            $params = array($word); +            $params = array($word);
214        } else { +        } else {
215            $where = 'keyword = ?'; +            $where = 'keyword = ?';
216        } +        }
217 +
218        $this->_params[] = $word; +        $this->_params[] = $word;
219 +
220        return $where; +        return $where;
221    } +    }
222 +
223    public function getWords() +    public function getWords()
224    { +    {
225        return $this->_words; +        return $this->_words;
226    } +    }
227    public function getParams() +    public function getParams()
228    { +    {
229        return $this->_params; +        return $this->_params;
230    } +    }
231    public function getSql() +    public function getSql()
232    { +    {
233        return $this->_sql; +        return $this->_sql;
234    } +    }
235} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Sequence.html b/tests_old/coverage/Doctrine_Sequence.html index 7f75269ca..ce61dc486 100644 --- a/tests_old/coverage/Doctrine_Sequence.html +++ b/tests_old/coverage/Doctrine_Sequence.html @@ -10,223 +10,223 @@

Coverage for Doctrine_Sequence

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Sequence_Firebird.html b/tests_old/coverage/Doctrine_Sequence_Firebird.html index 8872da946..6887aa055 100644 --- a/tests_old/coverage/Doctrine_Sequence_Firebird.html +++ b/tests_old/coverage/Doctrine_Sequence_Firebird.html @@ -10,322 +10,322 @@

Coverage for Doctrine_Sequence_Firebird

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Sequence.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Sequence.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Connection_Module'); +Doctrine::autoload('Doctrine_Connection_Module');
22/** +/**
23 * Doctrine_Sequence + * Doctrine_Sequence
24 * The base class for sequence handling drivers. + * The base class for sequence handling drivers.
25 * + *
26 * @package     Doctrine + * @package     Doctrine
27 * @subpackage  Sequence + * @subpackage  Sequence
28 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
29 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31 * @since       1.0 + * @since       1.0
32 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
33 */ + */
34class Doctrine_Sequence extends Doctrine_Connection_Module +class Doctrine_Sequence extends Doctrine_Connection_Module
35{ +{
36    /** +    /**
37     * Returns the next free id of a sequence +     * Returns the next free id of a sequence
38     * +     *
39     * @param string $seqName   name of the sequence +     * @param string $seqName   name of the sequence
40     * @param bool              when true missing sequences are automatic created +     * @param bool              when true missing sequences are automatic created
41     * +     *
42     * @return integer          next id in the given sequence +     * @return integer          next id in the given sequence
43     */ +     */
44    public function nextId($seqName, $ondemand = true) +    public function nextId($seqName, $ondemand = true)
45    { +    {
46        throw new Doctrine_Sequence_Exception('method not implemented'); +        throw new Doctrine_Sequence_Exception('method not implemented');
47    } +    }
48 +
49    /** +    /**
50     * Returns the autoincrement ID if supported or $id or fetches the current +     * Returns the autoincrement ID if supported or $id or fetches the current
51     * ID in a sequence called: $table.(empty($field) ? '' : '_'.$field) +     * ID in a sequence called: $table.(empty($field) ? '' : '_'.$field)
52     * +     *
53     * @param   string  name of the table into which a new row was inserted +     * @param   string  name of the table into which a new row was inserted
54     * @param   string  name of the field into which a new row was inserted +     * @param   string  name of the field into which a new row was inserted
55     */ +     */
56    public function lastInsertId($table = null, $field = null) +    public function lastInsertId($table = null, $field = null)
57    { +    {
58        throw new Doctrine_Sequence_Exception('method not implemented'); +        throw new Doctrine_Sequence_Exception('method not implemented');
59    } +    }
60 +
61    /** +    /**
62     * Returns the current id of a sequence +     * Returns the current id of a sequence
63     * +     *
64     * @param string $seqName   name of the sequence +     * @param string $seqName   name of the sequence
65     * +     *
66     * @return integer          current id in the given sequence +     * @return integer          current id in the given sequence
67     */ +     */
68    public function currId($seqName) +    public function currId($seqName)
69    { +    {
70        $this->warnings[] = 'database does not support getting current +        $this->warnings[] = 'database does not support getting current
71            sequence value, the sequence value was incremented'; +            sequence value, the sequence value was incremented';
72        return $this->nextId($seqName); +        return $this->nextId($seqName);
73    } +    }
74 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Sequence_Mssql.html b/tests_old/coverage/Doctrine_Sequence_Mssql.html index 03f9393be..4bc2ba18b 100644 --- a/tests_old/coverage/Doctrine_Sequence_Mssql.html +++ b/tests_old/coverage/Doctrine_Sequence_Mssql.html @@ -10,472 +10,472 @@

Coverage for Doctrine_Sequence_Mssql

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Firebird.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Firebird.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Sequence'); +Doctrine::autoload('Doctrine_Sequence');
22/** +/**
23 * Doctrine_Sequence_Firebird + * Doctrine_Sequence_Firebird
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Sequence + * @subpackage  Sequence
27 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30 * @since       1.0 + * @since       1.0
31 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
32 */ + */
33class Doctrine_Sequence_Firebird extends Doctrine_Sequence +class Doctrine_Sequence_Firebird extends Doctrine_Sequence
34{ +{
35    /** +    /**
36     * Returns the next free id of a sequence +     * Returns the next free id of a sequence
37     * +     *
38     * @param string $seqName   name of the sequence +     * @param string $seqName   name of the sequence
39     * @param bool              when true missing sequences are automatic created +     * @param bool              when true missing sequences are automatic created
40     * +     *
41     * @return integer          next id in the given sequence +     * @return integer          next id in the given sequence
42     */ +     */
43    public function nextID($seqName, $onDemand = true) +    public function nextID($seqName, $onDemand = true)
44    { +    {
45        $sequenceName = $this->conn->quoteIdentifier($this->conn->formatter->getSequenceName($seqName), true); +        $sequenceName = $this->conn->quoteIdentifier($this->conn->formatter->getSequenceName($seqName), true);
46 +
47        $query = 'SELECT GEN_ID(' . $sequenceName . ', 1) as the_value FROM RDB$DATABASE'; +        $query = 'SELECT GEN_ID(' . $sequenceName . ', 1) as the_value FROM RDB$DATABASE';
48        try { +        try {
49         +        
50            $result = $this->conn->fetchOne($query); +            $result = $this->conn->fetchOne($query);
51 +
52        } catch(Doctrine_Connection_Exception $e) { +        } catch(Doctrine_Connection_Exception $e) {
53            if ($onDemand && $e->getPortableCode() == Doctrine::ERR_NOSUCHTABLE) { +            if ($onDemand && $e->getPortableCode() == Doctrine::ERR_NOSUCHTABLE) {
54                // Since we are creating the sequence on demand +                // Since we are creating the sequence on demand
55                // we know the first id = 1 so initialize the +                // we know the first id = 1 so initialize the
56                // sequence at 2 +                // sequence at 2
57                try { +                try {
58                    $result = $this->conn->export->createSequence($seqName, 2); +                    $result = $this->conn->export->createSequence($seqName, 2);
59                } catch(Doctrine_Exception $e) { +                } catch(Doctrine_Exception $e) {
60                    throw new Doctrine_Sequence_Exception('on demand sequence ' . $seqName . ' could not be created'); +                    throw new Doctrine_Sequence_Exception('on demand sequence ' . $seqName . ' could not be created');
61                } +                }
62                // First ID of a newly created sequence is 1 +                // First ID of a newly created sequence is 1
63                // return 1; +                // return 1;
64                // BUT generators are not always reset, so return the actual value +                // BUT generators are not always reset, so return the actual value
65                return $this->currID($seqName); +                return $this->currID($seqName);
66            } +            }
67            throw $e; +            throw $e;
68        } +        }
69        return $result; +        return $result;
70    } +    }
71 +
72    /** +    /**
73     * Returns the autoincrement ID if supported or $id or fetches the current +     * Returns the autoincrement ID if supported or $id or fetches the current
74     * ID in a sequence called: $table.(empty($field) ? '' : '_'.$field) +     * ID in a sequence called: $table.(empty($field) ? '' : '_'.$field)
75     * +     *
76     * @param   string  name of the table into which a new row was inserted +     * @param   string  name of the table into which a new row was inserted
77     * @param   string  name of the field into which a new row was inserted +     * @param   string  name of the field into which a new row was inserted
78     */ +     */
79    public function lastInsertId($table = null, $field = null) +    public function lastInsertId($table = null, $field = null)
80    { +    {
81        return $this->conn->getDbh()->lastInsertId(); +        return $this->conn->getDbh()->lastInsertId();
82    } +    }
83 +
84    /** +    /**
85     * Returns the current id of a sequence +     * Returns the current id of a sequence
86     * +     *
87     * @param string $seqName   name of the sequence +     * @param string $seqName   name of the sequence
88     * +     *
89     * @return integer          current id in the given sequence +     * @return integer          current id in the given sequence
90     */ +     */
91    public function currId($seqName) +    public function currId($seqName)
92    { +    {
93        $sequenceName = $this->conn->quoteIdentifier($this->conn->formatter->getSequenceName($seqName), true); +        $sequenceName = $this->conn->quoteIdentifier($this->conn->formatter->getSequenceName($seqName), true);
94         +        
95 +
96        $query = 'SELECT GEN_ID(' . $sequenceName . ', 0) as the_value FROM RDB$DATABASE'; +        $query = 'SELECT GEN_ID(' . $sequenceName . ', 0) as the_value FROM RDB$DATABASE';
97        try { +        try {
98            $value = $this->conn->fetchOne($query); +            $value = $this->conn->fetchOne($query);
99        } catch(Doctrine_Connection_Exception $e) { +        } catch(Doctrine_Connection_Exception $e) {
100            throw new Doctrine_Sequence_Exception('Unable to select from ' . $seqName); +            throw new Doctrine_Sequence_Exception('Unable to select from ' . $seqName);
101        } +        }
102        if ( ! is_numeric($value)) { +        if ( ! is_numeric($value)) {
103            throw new Doctrine_Sequence_Exception('could not find value in sequence table'); +            throw new Doctrine_Sequence_Exception('could not find value in sequence table');
104        } +        }
105        return $value; +        return $value;
106    } +    }
107 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Sequence_Mysql.html b/tests_old/coverage/Doctrine_Sequence_Mysql.html index df0fad22c..4ea2071c3 100644 --- a/tests_old/coverage/Doctrine_Sequence_Mysql.html +++ b/tests_old/coverage/Doctrine_Sequence_Mysql.html @@ -10,337 +10,337 @@

Coverage for Doctrine_Sequence_Mysql

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Mssql.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Mssql.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Sequence'); +Doctrine::autoload('Doctrine_Sequence');
22/** +/**
23 * Doctrine_Sequence_Mssql + * Doctrine_Sequence_Mssql
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Sequence + * @subpackage  Sequence
27 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30 * @since       1.0 + * @since       1.0
31 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
32 */ + */
33class Doctrine_Sequence_Mssql extends Doctrine_Sequence +class Doctrine_Sequence_Mssql extends Doctrine_Sequence
34{ +{
35    /** +    /**
36     * Returns the next free id of a sequence +     * Returns the next free id of a sequence
37     * +     *
38     * @param string $seqName   name of the sequence +     * @param string $seqName   name of the sequence
39     * @param bool              when true missing sequences are automatic created +     * @param bool              when true missing sequences are automatic created
40     * +     *
41     * @return integer          next id in the given sequence +     * @return integer          next id in the given sequence
42     */ +     */
43    public function nextId($seqName, $onDemand = true) +    public function nextId($seqName, $onDemand = true)
44    { +    {
45        $sequenceName = $this->conn->quoteIdentifier($this->conn->formatter->getSequenceName($seqName), true); +        $sequenceName = $this->conn->quoteIdentifier($this->conn->formatter->getSequenceName($seqName), true);
46        $seqcolName   = $this->conn->quoteIdentifier($this->conn->getAttribute(Doctrine::ATTR_SEQCOL_NAME), true); +        $seqcolName   = $this->conn->quoteIdentifier($this->conn->getAttribute(Doctrine::ATTR_SEQCOL_NAME), true);
47 +
48 +
49        if ($this->checkSequence($sequenceName)) { +        if ($this->checkSequence($sequenceName)) {
50            $query = 'SET IDENTITY_INSERT ' . $sequenceName . ' OFF ' +            $query = 'SET IDENTITY_INSERT ' . $sequenceName . ' OFF '
51                   . 'INSERT INTO ' . $sequenceName . ' DEFAULT VALUES'; +                   . 'INSERT INTO ' . $sequenceName . ' DEFAULT VALUES';
52        } else { +        } else {
53            $query = 'INSERT INTO ' . $sequenceName . ' (' . $seqcolName . ') VALUES (0)'; +            $query = 'INSERT INTO ' . $sequenceName . ' (' . $seqcolName . ') VALUES (0)';
54        } +        }
55         +        
56        try { +        try {
57 +
58            $this->conn->exec($query); +            $this->conn->exec($query);
59 +
60        } catch(Doctrine_Connection_Exception $e) { +        } catch(Doctrine_Connection_Exception $e) {
61            if ($onDemand && $e->getPortableCode() == Doctrine::ERR_NOSUCHTABLE) { +            if ($onDemand && $e->getPortableCode() == Doctrine::ERR_NOSUCHTABLE) {
62                // Since we are creating the sequence on demand +                // Since we are creating the sequence on demand
63                // we know the first id = 1 so initialize the +                // we know the first id = 1 so initialize the
64                // sequence at 2 +                // sequence at 2
65                try { +                try {
66                    $result = $this->conn->export->createSequence($seqName, 2); +                    $result = $this->conn->export->createSequence($seqName, 2);
67                } catch(Doctrine_Exception $e) { +                } catch(Doctrine_Exception $e) {
68                    throw new Doctrine_Sequence_Exception('on demand sequence ' . $seqName . ' could not be created'); +                    throw new Doctrine_Sequence_Exception('on demand sequence ' . $seqName . ' could not be created');
69                } +                }
70                 +                
71                /** +                /**
72                 * This could actually be a table that starts at 18.. oh well.. +                 * This could actually be a table that starts at 18.. oh well..
73                 * we will keep the fallback to return 1 in case we skip this.. which +                 * we will keep the fallback to return 1 in case we skip this.. which
74                 * should really not happen.. otherwise the returned values is biased. +                 * should really not happen.. otherwise the returned values is biased.
75                 */ +                 */
76                if ($this->checkSequence($seqName)) { +                if ($this->checkSequence($seqName)) {
77                    return $this->lastInsertId($seqName); +                    return $this->lastInsertId($seqName);
78                } +                }
79                 +                
80                return 1; +                return 1;
81            } +            }
82            throw $e; +            throw $e;
83        } +        }
84         +        
85        $value = $this->lastInsertId($sequenceName); +        $value = $this->lastInsertId($sequenceName);
86 +
87        if (is_numeric($value)) { +        if (is_numeric($value)) {
88            $query = 'DELETE FROM ' . $sequenceName . ' WHERE ' . $seqcolName . ' < ' . $value; +            $query = 'DELETE FROM ' . $sequenceName . ' WHERE ' . $seqcolName . ' < ' . $value;
89             +            
90            try { +            try {
91                $this->conn->exec($query); +                $this->conn->exec($query);
92            } catch (Doctrine_Connection_Exception $e) { +            } catch (Doctrine_Connection_Exception $e) {
93                throw new Doctrine_Sequence_Exception('Could not delete previous sequence from ' . $sequenceName .  +                throw new Doctrine_Sequence_Exception('Could not delete previous sequence from ' . $sequenceName . 
94                                                      ' at ' . __FILE__ . ' in ' . __FUNCTION__ . ' with the message: ' . +                                                      ' at ' . __FILE__ . ' in ' . __FUNCTION__ . ' with the message: ' .
95                                                      $e->getMessage()); +                                                      $e->getMessage());
96            } +            }
97        } +        }
98        return $value; +        return $value;
99    } +    }
100 +
101    /** +    /**
102     * Checks if there's a sequence that exists. +     * Checks if there's a sequence that exists.
103     * +     *
104     * @param  string $seqName     The sequence name to verify. +     * @param  string $seqName     The sequence name to verify.
105     * @return bool   $tableExists The value if the table exists or not +     * @return bool   $tableExists The value if the table exists or not
106     * @access private +     * @access private
107     */ +     */
108    public function checkSequence($seqName) +    public function checkSequence($seqName)
109    { +    {
110        $query = 'SELECT COUNT(1) FROM ' . $seqName; +        $query = 'SELECT COUNT(1) FROM ' . $seqName;
111        try { +        try {
112            $this->conn->execute($query); +            $this->conn->execute($query);
113        } catch (Doctrine_Connection_Exception $e) { +        } catch (Doctrine_Connection_Exception $e) {
114            if ($e->getPortableCode() == Doctrine::ERR_NOSUCHTABLE) { +            if ($e->getPortableCode() == Doctrine::ERR_NOSUCHTABLE) {
115                return false; +                return false;
116            } +            }
117        } +        }
118        return true; +        return true;
119    } +    }
120 +
121    /** +    /**
122     * Returns the autoincrement ID if supported or $id or fetches the current +     * Returns the autoincrement ID if supported or $id or fetches the current
123     * ID in a sequence called: $table.(empty($field) ? '' : '_'.$field) +     * ID in a sequence called: $table.(empty($field) ? '' : '_'.$field)
124     * +     *
125     * @param   string  name of the table into which a new row was inserted +     * @param   string  name of the table into which a new row was inserted
126     * @param   string  name of the field into which a new row was inserted +     * @param   string  name of the field into which a new row was inserted
127     */ +     */
128    public function lastInsertId($table = null, $field = null) +    public function lastInsertId($table = null, $field = null)
129    { +    {
130        $serverInfo = $this->conn->getServerVersion(); +        $serverInfo = $this->conn->getServerVersion();
131        if (is_array($serverInfo) +        if (is_array($serverInfo)
132            && ! is_null($serverInfo['major']) +            && ! is_null($serverInfo['major'])
133            && $serverInfo['major'] >= 8) { +            && $serverInfo['major'] >= 8) {
134 +
135            $query = 'SELECT SCOPE_IDENTITY()'; +            $query = 'SELECT SCOPE_IDENTITY()';
136 +
137        } else { +        } else {
138            $query = 'SELECT @@IDENTITY'; +            $query = 'SELECT @@IDENTITY';
139        } +        }
140 +
141        return $this->conn->fetchOne($query); +        return $this->conn->fetchOne($query);
142    } +    }
143 +
144    /** +    /**
145     * Returns the current id of a sequence +     * Returns the current id of a sequence
146     * +     *
147     * @param string $seqName   name of the sequence +     * @param string $seqName   name of the sequence
148     * +     *
149     * @return integer          current id in the given sequence +     * @return integer          current id in the given sequence
150     */ +     */
151    public function currId($seqName) +    public function currId($seqName)
152    { +    {
153        $this->warnings[] = 'database does not support getting current +        $this->warnings[] = 'database does not support getting current
154            sequence value, the sequence value was incremented'; +            sequence value, the sequence value was incremented';
155        return $this->nextId($seqName); +        return $this->nextId($seqName);
156    } +    }
157 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Sequence_Oracle.html b/tests_old/coverage/Doctrine_Sequence_Oracle.html index b861e4f20..f67c3eef3 100644 --- a/tests_old/coverage/Doctrine_Sequence_Oracle.html +++ b/tests_old/coverage/Doctrine_Sequence_Oracle.html @@ -10,289 +10,289 @@

Coverage for Doctrine_Sequence_Oracle

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Mysql.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Mysql.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Sequence'); +Doctrine::autoload('Doctrine_Sequence');
22/** +/**
23 * Doctrine_Sequence_Mysql + * Doctrine_Sequence_Mysql
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Sequence + * @subpackage  Sequence
27 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30 * @since       1.0 + * @since       1.0
31 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
32 */ + */
33class Doctrine_Sequence_Mysql extends Doctrine_Sequence +class Doctrine_Sequence_Mysql extends Doctrine_Sequence
34{ +{
35    /** +    /**
36     * Returns the next free id of a sequence +     * Returns the next free id of a sequence
37     * +     *
38     * @param string $seqName   name of the sequence +     * @param string $seqName   name of the sequence
39     * @param bool              when true missing sequences are automatic created +     * @param bool              when true missing sequences are automatic created
40     * +     *
41     * @return integer          next id in the given sequence +     * @return integer          next id in the given sequence
42     */ +     */
43    public function nextId($seqName, $onDemand = true) +    public function nextId($seqName, $onDemand = true)
44    { +    {
45        $sequenceName  = $this->conn->quoteIdentifier($this->conn->formatter->getSequenceName($seqName), true); +        $sequenceName  = $this->conn->quoteIdentifier($this->conn->formatter->getSequenceName($seqName), true);
46        $seqcolName    = $this->conn->quoteIdentifier($this->conn->getAttribute(Doctrine::ATTR_SEQCOL_NAME), true); +        $seqcolName    = $this->conn->quoteIdentifier($this->conn->getAttribute(Doctrine::ATTR_SEQCOL_NAME), true);
47        $query         = 'INSERT INTO ' . $sequenceName . ' (' . $seqcolName . ') VALUES (NULL)'; +        $query         = 'INSERT INTO ' . $sequenceName . ' (' . $seqcolName . ') VALUES (NULL)';
48         +        
49        try { +        try {
50 +
51            $this->conn->exec($query); +            $this->conn->exec($query);
52 +
53        } catch(Doctrine_Connection_Exception $e) { +        } catch(Doctrine_Connection_Exception $e) {
54            if ($onDemand && $e->getPortableCode() == Doctrine::ERR_NOSUCHTABLE) { +            if ($onDemand && $e->getPortableCode() == Doctrine::ERR_NOSUCHTABLE) {
55                // Since we are creating the sequence on demand +                // Since we are creating the sequence on demand
56                // we know the first id = 1 so initialize the +                // we know the first id = 1 so initialize the
57                // sequence at 2 +                // sequence at 2
58                try { +                try {
59                    $result = $this->conn->export->createSequence($seqName, 2); +                    $result = $this->conn->export->createSequence($seqName, 2);
60                } catch(Doctrine_Exception $e) { +                } catch(Doctrine_Exception $e) {
61                    throw new Doctrine_Sequence_Exception('on demand sequence ' . $seqName . ' could not be created'); +                    throw new Doctrine_Sequence_Exception('on demand sequence ' . $seqName . ' could not be created');
62                } +                }
63                // First ID of a newly created sequence is 1 +                // First ID of a newly created sequence is 1
64                return 1; +                return 1;
65            } +            }
66            throw $e; +            throw $e;
67        } +        }
68 +
69        $value = $this->lastInsertId(); +        $value = $this->lastInsertId();
70 +
71        if (is_numeric($value)) { +        if (is_numeric($value)) {
72            $query = 'DELETE FROM ' . $sequenceName . ' WHERE ' . $seqcolName . ' < ' . $value; +            $query = 'DELETE FROM ' . $sequenceName . ' WHERE ' . $seqcolName . ' < ' . $value;
73            $this->conn->exec($query); +            $this->conn->exec($query);
74            /** +            /**
75            TODO: is the following needed ? +            TODO: is the following needed ?
76            if (PEAR::isError($result)) { +            if (PEAR::isError($result)) {
77                $this->warnings[] = 'nextID: could not delete previous sequence table values from '.$seq_name; +                $this->warnings[] = 'nextID: could not delete previous sequence table values from '.$seq_name;
78            } +            }
79            */ +            */
80        } +        }
81        return $value; +        return $value;
82    } +    }
83 +
84    /** +    /**
85     * Returns the autoincrement ID if supported or $id or fetches the current +     * Returns the autoincrement ID if supported or $id or fetches the current
86     * ID in a sequence called: $table.(empty($field) ? '' : '_'.$field) +     * ID in a sequence called: $table.(empty($field) ? '' : '_'.$field)
87     * +     *
88     * @param string  name of the table into which a new row was inserted +     * @param string  name of the table into which a new row was inserted
89     * @param string  name of the field into which a new row was inserted +     * @param string  name of the field into which a new row was inserted
90     * @return integer|boolean +     * @return integer|boolean
91     */ +     */
92    public function lastInsertId($table = null, $field = null) +    public function lastInsertId($table = null, $field = null)
93    { +    {
94        return $this->conn->getDbh()->lastInsertId(); +        return $this->conn->getDbh()->lastInsertId();
95    } +    }
96 +
97    /** +    /**
98     * Returns the current id of a sequence +     * Returns the current id of a sequence
99     * +     *
100     * @param string $seqName   name of the sequence +     * @param string $seqName   name of the sequence
101     * +     *
102     * @return integer          current id in the given sequence +     * @return integer          current id in the given sequence
103     */ +     */
104    public function currId($seqName) +    public function currId($seqName)
105    { +    {
106        $sequenceName   = $this->conn->quoteIdentifier($this->conn->formatter->getSequenceName($seqName), true); +        $sequenceName   = $this->conn->quoteIdentifier($this->conn->formatter->getSequenceName($seqName), true);
107        $seqcolName     = $this->conn->quoteIdentifier($this->conn->getAttribute(Doctrine::ATTR_SEQCOL_NAME), true); +        $seqcolName     = $this->conn->quoteIdentifier($this->conn->getAttribute(Doctrine::ATTR_SEQCOL_NAME), true);
108        $query          = 'SELECT MAX(' . $seqcolName . ') FROM ' . $sequenceName; +        $query          = 'SELECT MAX(' . $seqcolName . ') FROM ' . $sequenceName;
109 +
110        return (int) $this->conn->fetchOne($query); +        return (int) $this->conn->fetchOne($query);
111    } +    }
112 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Sequence_Pgsql.html b/tests_old/coverage/Doctrine_Sequence_Pgsql.html index 5ed879c70..9aa6d34ca 100644 --- a/tests_old/coverage/Doctrine_Sequence_Pgsql.html +++ b/tests_old/coverage/Doctrine_Sequence_Pgsql.html @@ -10,283 +10,283 @@

Coverage for Doctrine_Sequence_Pgsql

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Oracle.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Oracle.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Sequence'); +Doctrine::autoload('Doctrine_Sequence');
22/** +/**
23 * Doctrine_Sequence_Oracle + * Doctrine_Sequence_Oracle
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Sequence + * @subpackage  Sequence
27 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30 * @since       1.0 + * @since       1.0
31 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
32 */ + */
33class Doctrine_Sequence_Oracle extends Doctrine_Sequence +class Doctrine_Sequence_Oracle extends Doctrine_Sequence
34{ +{
35    /** +    /**
36     * Returns the next free id of a sequence +     * Returns the next free id of a sequence
37     * +     *
38     * @param string $seqName   name of the sequence +     * @param string $seqName   name of the sequence
39     * @param bool onDemand     when true missing sequences are automatic created +     * @param bool onDemand     when true missing sequences are automatic created
40     * +     *
41     * @return integer          next id in the given sequence +     * @return integer          next id in the given sequence
42     */ +     */
43    public function nextID($seqName, $onDemand = true) +    public function nextID($seqName, $onDemand = true)
44    { +    {
45        $sequenceName = $this->conn->quoteIdentifier($this->conn->formatter->getSequenceName($seqName), true); +        $sequenceName = $this->conn->quoteIdentifier($this->conn->formatter->getSequenceName($seqName), true);
46        $query        = 'SELECT ' . $sequenceName . '.nextval FROM DUAL'; +        $query        = 'SELECT ' . $sequenceName . '.nextval FROM DUAL';
47 +
48        try { +        try {
49            $result = $this->conn->fetchOne($query); +            $result = $this->conn->fetchOne($query);
50        } catch(Doctrine_Connection_Exception $e) { +        } catch(Doctrine_Connection_Exception $e) {
51            if ($onDemand && $e->getPortableCode() == Doctrine::ERR_NOSUCHTABLE) { +            if ($onDemand && $e->getPortableCode() == Doctrine::ERR_NOSUCHTABLE) {
52 +
53                try { +                try {
54                    $result = $this->conn->export->createSequence($seqName); +                    $result = $this->conn->export->createSequence($seqName);
55                } catch(Doctrine_Exception $e) { +                } catch(Doctrine_Exception $e) {
56                    throw new Doctrine_Sequence_Exception('on demand sequence ' . $seqName . ' could not be created'); +                    throw new Doctrine_Sequence_Exception('on demand sequence ' . $seqName . ' could not be created');
57                } +                }
58                return $this->nextId($seqName, false); +                return $this->nextId($seqName, false);
59            } +            }
60            throw $e; +            throw $e;
61        } +        }
62        return $result; +        return $result;
63    } +    }
64 +
65    /** +    /**
66     * Returns the autoincrement ID if supported or $id or fetches the current +     * Returns the autoincrement ID if supported or $id or fetches the current
67     * ID in a sequence called: $table.(empty($field) ? '' : '_'.$field) +     * ID in a sequence called: $table.(empty($field) ? '' : '_'.$field)
68     * +     *
69     * @param   string  name of the table into which a new row was inserted +     * @param   string  name of the table into which a new row was inserted
70     * @param   string  name of the field into which a new row was inserted +     * @param   string  name of the field into which a new row was inserted
71     */ +     */
72    public function lastInsertID($table = null, $field = null) +    public function lastInsertID($table = null, $field = null)
73    { +    {
74        $seqName = $table . (empty($field) ? '' : '_'.$field); +        $seqName = $table . (empty($field) ? '' : '_'.$field);
75        $sequenceName =  $this->conn->quoteIdentifier($this->conn->formatter->getSequenceName($seqName), true); +        $sequenceName =  $this->conn->quoteIdentifier($this->conn->formatter->getSequenceName($seqName), true);
76 +
77        return $this->conn->fetchOne('SELECT ' . $sequenceName . '.currval'); +        return $this->conn->fetchOne('SELECT ' . $sequenceName . '.currval');
78    } +    }
79 +
80    /** +    /**
81     * Returns the current id of a sequence +     * Returns the current id of a sequence
82     * +     *
83     * @param string $seqName   name of the sequence +     * @param string $seqName   name of the sequence
84     * +     *
85     * @return integer          current id in the given sequence +     * @return integer          current id in the given sequence
86     */ +     */
87    public function currID($seqName) +    public function currID($seqName)
88    { +    {
89        $sequenceName = $this->conn->quoteIdentifier($this->conn->formatter->getSequenceName($seqName), true); +        $sequenceName = $this->conn->quoteIdentifier($this->conn->formatter->getSequenceName($seqName), true);
90        $query   = 'SELECT (last_number-1) FROM user_sequences'; +        $query   = 'SELECT (last_number-1) FROM user_sequences';
91        $query  .= ' WHERE sequence_name=' . $this->conn->quote($sequenceName, 'text'); +        $query  .= ' WHERE sequence_name=' . $this->conn->quote($sequenceName, 'text');
92        $query  .= ' OR sequence_name=' . $this->conn->quote(strtoupper($sequenceName), 'text'); +        $query  .= ' OR sequence_name=' . $this->conn->quote(strtoupper($sequenceName), 'text');
93 +
94        return $this->conn->fetchOne($query); +        return $this->conn->fetchOne($query);
95    } +    }
96 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Sequence_Sqlite.html b/tests_old/coverage/Doctrine_Sequence_Sqlite.html index b04552585..20d47de9c 100644 --- a/tests_old/coverage/Doctrine_Sequence_Sqlite.html +++ b/tests_old/coverage/Doctrine_Sequence_Sqlite.html @@ -10,343 +10,343 @@

Coverage for Doctrine_Sequence_Sqlite

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Pgsql.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Pgsql.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Sequence'); +Doctrine::autoload('Doctrine_Sequence');
22/** +/**
23 * Doctrine_Sequence_Pgsql + * Doctrine_Sequence_Pgsql
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Sequence + * @subpackage  Sequence
27 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30 * @since       1.0 + * @since       1.0
31 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
32 */ + */
33class Doctrine_Sequence_Pgsql extends Doctrine_Sequence +class Doctrine_Sequence_Pgsql extends Doctrine_Sequence
34{ +{
35    /** +    /**
36     * Returns the next free id of a sequence +     * Returns the next free id of a sequence
37     * +     *
38     * @param string $seqName   name of the sequence +     * @param string $seqName   name of the sequence
39     * @param bool onDemand     when true missing sequences are automatic created +     * @param bool onDemand     when true missing sequences are automatic created
40     * +     *
41     * @return integer          next id in the given sequence +     * @return integer          next id in the given sequence
42     */ +     */
43    public function nextId($seqName, $onDemand = true) +    public function nextId($seqName, $onDemand = true)
44    { +    {
45        $sequenceName = $this->conn->quoteIdentifier($this->conn->formatter->getSequenceName($seqName), true); +        $sequenceName = $this->conn->quoteIdentifier($this->conn->formatter->getSequenceName($seqName), true);
46 +
47        $query = "SELECT NEXTVAL('" . $sequenceName . "')"; +        $query = "SELECT NEXTVAL('" . $sequenceName . "')";
48        try { +        try {
49            $result = (int) $this->conn->fetchOne($query); +            $result = (int) $this->conn->fetchOne($query);
50        } catch(Doctrine_Connection_Exception $e) { +        } catch(Doctrine_Connection_Exception $e) {
51            if ($onDemand && $e->getPortableCode() == Doctrine::ERR_NOSUCHTABLE) { +            if ($onDemand && $e->getPortableCode() == Doctrine::ERR_NOSUCHTABLE) {
52 +
53                try { +                try {
54                    $result = $this->conn->export->createSequence($seqName); +                    $result = $this->conn->export->createSequence($seqName);
55                } catch(Doctrine_Exception $e) { +                } catch(Doctrine_Exception $e) {
56                    throw new Doctrine_Sequence_Exception('on demand sequence ' . $seqName . ' could not be created'); +                    throw new Doctrine_Sequence_Exception('on demand sequence ' . $seqName . ' could not be created');
57                } +                }
58                return $this->nextId($seqName, false); +                return $this->nextId($seqName, false);
59            } +            }
60        } +        }
61        return $result; +        return $result;
62    } +    }
63 +
64    /** +    /**
65     * lastInsertId +     * lastInsertId
66     * +     *
67     * Returns the autoincrement ID if supported or $id or fetches the current +     * Returns the autoincrement ID if supported or $id or fetches the current
68     * ID in a sequence called: $table.(empty($field) ? '' : '_'.$field) +     * ID in a sequence called: $table.(empty($field) ? '' : '_'.$field)
69     * +     *
70     * @param   string  name of the table into which a new row was inserted +     * @param   string  name of the table into which a new row was inserted
71     * @param   string  name of the field into which a new row was inserted +     * @param   string  name of the field into which a new row was inserted
72     * @return integer      the autoincremented id +     * @return integer      the autoincremented id
73     */ +     */
74    public function lastInsertId($table = null, $field = null) +    public function lastInsertId($table = null, $field = null)
75    { +    {
76        $seqName = $table . (empty($field) ? '' : '_' . $field); +        $seqName = $table . (empty($field) ? '' : '_' . $field);
77        $sequenceName = $this->conn->quoteIdentifier($this->conn->formatter->getSequenceName($seqName), true); +        $sequenceName = $this->conn->quoteIdentifier($this->conn->formatter->getSequenceName($seqName), true);
78 +
79        return (int) $this->conn->fetchOne("SELECT CURRVAL('" . $sequenceName . "')"); +        return (int) $this->conn->fetchOne("SELECT CURRVAL('" . $sequenceName . "')");
80    } +    }
81 +
82    /** +    /**
83     * Returns the current id of a sequence +     * Returns the current id of a sequence
84     * +     *
85     * @param string $seqName   name of the sequence +     * @param string $seqName   name of the sequence
86     * +     *
87     * @return integer          current id in the given sequence +     * @return integer          current id in the given sequence
88     */ +     */
89    public function currId($seqName) +    public function currId($seqName)
90    { +    {
91        $sequenceName = $this->conn->quoteIdentifier($this->conn->formatter->getSequenceName($seqName), true); +        $sequenceName = $this->conn->quoteIdentifier($this->conn->formatter->getSequenceName($seqName), true);
92        return (int) $this->conn->fetchOne('SELECT last_value FROM ' . $sequenceName); +        return (int) $this->conn->fetchOne('SELECT last_value FROM ' . $sequenceName);
93    } +    }
94 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Table.html b/tests_old/coverage/Doctrine_Table.html index 40766a5cc..66e9b5784 100644 --- a/tests_old/coverage/Doctrine_Table.html +++ b/tests_old/coverage/Doctrine_Table.html @@ -64,7 +64,7 @@ - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: Sqlite.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Sqlite.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Sequence'); +Doctrine::autoload('Doctrine_Sequence');
22/** +/**
23 * Doctrine_Sequence_Sqlite + * Doctrine_Sequence_Sqlite
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Sequence + * @subpackage  Sequence
27 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30 * @since       1.0 + * @since       1.0
31 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
32 */ + */
33class Doctrine_Sequence_Sqlite extends Doctrine_Sequence +class Doctrine_Sequence_Sqlite extends Doctrine_Sequence
34{ +{
35    /** +    /**
36     * Returns the next free id of a sequence +     * Returns the next free id of a sequence
37     * +     *
38     * @param string $seqName   name of the sequence +     * @param string $seqName   name of the sequence
39     * @param bool $onDemand    when true missing sequences are automatic created +     * @param bool $onDemand    when true missing sequences are automatic created
40     * +     *
41     * @return integer          next id in the given sequence +     * @return integer          next id in the given sequence
42     */ +     */
43    public function nextId($seqName, $onDemand = true) +    public function nextId($seqName, $onDemand = true)
44    { +    {
45        $sequenceName = $this->conn->quoteIdentifier($this->conn->formatter->getSequenceName($seqName), true); +        $sequenceName = $this->conn->quoteIdentifier($this->conn->formatter->getSequenceName($seqName), true);
46        $seqcolName   = $this->conn->quoteIdentifier($this->conn->getAttribute(Doctrine::ATTR_SEQCOL_NAME), true); +        $seqcolName   = $this->conn->quoteIdentifier($this->conn->getAttribute(Doctrine::ATTR_SEQCOL_NAME), true);
47 +
48        $query        = 'INSERT INTO ' . $sequenceName . ' (' . $seqcolName . ') VALUES (NULL)'; +        $query        = 'INSERT INTO ' . $sequenceName . ' (' . $seqcolName . ') VALUES (NULL)';
49 +
50        try { +        try {
51 +
52            $this->conn->exec($query); +            $this->conn->exec($query);
53 +
54        } catch(Doctrine_Connection_Exception $e) { +        } catch(Doctrine_Connection_Exception $e) {
55            if ($onDemand && $e->getPortableCode() == Doctrine::ERR_NOSUCHTABLE) { +            if ($onDemand && $e->getPortableCode() == Doctrine::ERR_NOSUCHTABLE) {
56                // Since we are creating the sequence on demand +                // Since we are creating the sequence on demand
57                // we know the first id = 1 so initialize the +                // we know the first id = 1 so initialize the
58                // sequence at 2 +                // sequence at 2
59 +
60                try { +                try {
61                    $result = $this->conn->export->createSequence($seqName, 2); +                    $result = $this->conn->export->createSequence($seqName, 2);
62                } catch(Doctrine_Exception $e) { +                } catch(Doctrine_Exception $e) {
63                    throw new Doctrine_Sequence_Exception('on demand sequence ' . $seqName . ' could not be created'); +                    throw new Doctrine_Sequence_Exception('on demand sequence ' . $seqName . ' could not be created');
64                } +                }
65                // First ID of a newly created sequence is 1 +                // First ID of a newly created sequence is 1
66                return 1; +                return 1;
67            } +            }
68            throw $e; +            throw $e;
69        } +        }
70 +
71        $value = $this->conn->getDbh()->lastInsertId(); +        $value = $this->conn->getDbh()->lastInsertId();
72 +
73        if (is_numeric($value)) { +        if (is_numeric($value)) {
74            $query = 'DELETE FROM ' . $sequenceName . ' WHERE ' . $seqcolName . ' < ' . $value; +            $query = 'DELETE FROM ' . $sequenceName . ' WHERE ' . $seqcolName . ' < ' . $value;
75             +            
76            $this->conn->exec($query); +            $this->conn->exec($query);
77            /** +            /**
78            TODO: is the following needed ? +            TODO: is the following needed ?
79            $this->warnings[] = 'nextID: could not delete previous sequence table values from '.$seq_name; +            $this->warnings[] = 'nextID: could not delete previous sequence table values from '.$seq_name;
80            */ +            */
81        } +        }
82        return $value; +        return $value;
83    } +    }
84 +
85    /** +    /**
86     * Returns the autoincrement ID if supported or $id or fetches the current +     * Returns the autoincrement ID if supported or $id or fetches the current
87     * ID in a sequence called: $table.(empty($field) ? '' : '_'.$field) +     * ID in a sequence called: $table.(empty($field) ? '' : '_'.$field)
88     * +     *
89     * @param   string  name of the table into which a new row was inserted +     * @param   string  name of the table into which a new row was inserted
90     * @param   string  name of the field into which a new row was inserted +     * @param   string  name of the field into which a new row was inserted
91     * @return integer|boolean +     * @return integer|boolean
92     */ +     */
93    public function lastInsertId($table = null, $field = null) +    public function lastInsertId($table = null, $field = null)
94    { +    {
95        return $this->conn->getDbh()->lastInsertId(); +        return $this->conn->getDbh()->lastInsertId();
96    } +    }
97 +
98    /** +    /**
99     * Returns the current id of a sequence +     * Returns the current id of a sequence
100     * +     *
101     * @param string $seqName   name of the sequence +     * @param string $seqName   name of the sequence
102     * +     *
103     * @return integer          current id in the given sequence +     * @return integer          current id in the given sequence
104     */ +     */
105    public function currId($seqName) +    public function currId($seqName)
106    { +    {
107        $sequenceName = $this->conn->quoteIdentifier($this->conn->formatter->getSequenceName($seqName), true); +        $sequenceName = $this->conn->quoteIdentifier($this->conn->formatter->getSequenceName($seqName), true);
108        $seqcolName   = $this->conn->quoteIdentifier($this->conn->getAttribute(Doctrine::ATTR_SEQCOL_NAME), true); +        $seqcolName   = $this->conn->quoteIdentifier($this->conn->getAttribute(Doctrine::ATTR_SEQCOL_NAME), true);
109 +
110        $query        = 'SELECT MAX(' . $seqcolName . ') FROM ' . $sequenceName; +        $query        = 'SELECT MAX(' . $seqcolName . ') FROM ' . $sequenceName;
111 +
112        return (int) $this->conn->fetchOne($query); +        return (int) $this->conn->fetchOne($query);
113    } +    }
114 }
 * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -103,7 +103,7 @@  * @version     $Revision: 3206 $
32 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
33  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Table_Exception.html b/tests_old/coverage/Doctrine_Table_Exception.html index 30bea6337..df6b35428 100644 --- a/tests_old/coverage/Doctrine_Table_Exception.html +++ b/tests_old/coverage/Doctrine_Table_Exception.html @@ -10,124 +10,124 @@

Coverage for Doctrine_Table_Exception

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Table_Repository.html b/tests_old/coverage/Doctrine_Table_Repository.html index dd2fab9d2..4dbec9dd3 100644 --- a/tests_old/coverage/Doctrine_Table_Repository.html +++ b/tests_old/coverage/Doctrine_Table_Repository.html @@ -10,490 +10,490 @@

Coverage for Doctrine_Table_Repository

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Exception.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $ + *  $Id: Exception.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Exception'); +Doctrine::autoload('Doctrine_Exception');
22/** +/**
23 * thrown when user tries to initialize a new instance of Doctrine_Table, + * thrown when user tries to initialize a new instance of Doctrine_Table,
24 * while there already exists an instance of that table + * while there already exists an instance of that table
25 * + *
26 * @package     Doctrine + * @package     Doctrine
27 * @subpackage  Table + * @subpackage  Table
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30 * @since       1.0 + * @since       1.0
31 * @version     $Revision: 2702 $ + * @version     $Revision: 2702 $
32 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
33 */ + */
34class Doctrine_Table_Exception extends Doctrine_Exception +class Doctrine_Table_Exception extends Doctrine_Exception
35{ +{
36    public function __construct($message = "Couldn't initialize table. One instance of this +    public function __construct($message = "Couldn't initialize table. One instance of this
37                            table already exists. Always use Doctrine_Session::getTable(\$name) +                            table already exists. Always use Doctrine_Session::getTable(\$name)
38                            to get on instance of a Doctrine_Table.") { +                            to get on instance of a Doctrine_Table.") {
39        parent::__construct($message); +        parent::__construct($message);
40    } +    }
41 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Template.html b/tests_old/coverage/Doctrine_Template.html index 4d2a1567e..349426085 100644 --- a/tests_old/coverage/Doctrine_Template.html +++ b/tests_old/coverage/Doctrine_Template.html @@ -10,468 +10,468 @@

Coverage for Doctrine_Template

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Repository.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Repository.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Repository + * Doctrine_Repository
24 * each record is added into Doctrine_Repository at the same time they are created, + * each record is added into Doctrine_Repository at the same time they are created,
25 * loaded from the database or retrieved from the cache + * loaded from the database or retrieved from the cache
26 * + *
27 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
28 * @package     Doctrine + * @package     Doctrine
29 * @subpackage  Table + * @subpackage  Table
30 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
31 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
32 * @since       1.0 + * @since       1.0
33 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
34 */ + */
35class Doctrine_Table_Repository implements Countable, IteratorAggregate +class Doctrine_Table_Repository implements Countable, IteratorAggregate
36{ +{
37    /** +    /**
38     * @var object Doctrine_Table $table +     * @var object Doctrine_Table $table
39     */ +     */
40    private $table; +    private $table;
41 +
42    /** +    /**
43     * @var array $registry +     * @var array $registry
44     * an array of all records +     * an array of all records
45     * keys representing record object identifiers +     * keys representing record object identifiers
46     */ +     */
47    private $registry = array(); +    private $registry = array();
48 +
49    /** +    /**
50     * constructor +     * constructor
51     * +     *
52     * @param Doctrine_Table $table +     * @param Doctrine_Table $table
53     */ +     */
54    public function __construct(Doctrine_Table $table) +    public function __construct(Doctrine_Table $table)
55    { +    {
56        $this->table = $table; +        $this->table = $table;
57    } +    }
58 +
59    /** +    /**
60     * getTable +     * getTable
61     * +     *
62     * @return object Doctrine_Table +     * @return object Doctrine_Table
63     */ +     */
64    public function getTable() +    public function getTable()
65    { +    {
66        return $this->table; +        return $this->table;
67    } +    }
68 +
69    /** +    /**
70     * add +     * add
71     * +     *
72     * @param Doctrine_Record $record       record to be added into registry +     * @param Doctrine_Record $record       record to be added into registry
73     * @return boolean +     * @return boolean
74     */ +     */
75    public function add(Doctrine_Record $record) +    public function add(Doctrine_Record $record)
76    { +    {
77        $oid = $record->getOID(); +        $oid = $record->getOID();
78 +
79        if (isset($this->registry[$oid])) { +        if (isset($this->registry[$oid])) {
80            return false; +            return false;
81        } +        }
82        $this->registry[$oid] = $record; +        $this->registry[$oid] = $record;
83 +
84        return true; +        return true;
85    } +    }
86 +
87    /** +    /**
88     * get +     * get
89     * @param integer $oid +     * @param integer $oid
90     * @throws Doctrine_Table_Repository_Exception +     * @throws Doctrine_Table_Repository_Exception
91     */ +     */
92    public function get($oid) +    public function get($oid)
93    { +    {
94        if ( ! isset($this->registry[$oid])) { +        if ( ! isset($this->registry[$oid])) {
95            throw new Doctrine_Table_Repository_Exception("Unknown object identifier"); +            throw new Doctrine_Table_Repository_Exception("Unknown object identifier");
96        } +        }
97        return $this->registry[$oid]; +        return $this->registry[$oid];
98    } +    }
99 +
100    /** +    /**
101     * count +     * count
102     * Doctrine_Registry implements interface Countable +     * Doctrine_Registry implements interface Countable
103     * @return integer                      the number of records this registry has +     * @return integer                      the number of records this registry has
104     */ +     */
105    public function count() +    public function count()
106    { +    {
107        return count($this->registry); +        return count($this->registry);
108    } +    }
109 +
110    /** +    /**
111     * @param integer $oid                  object identifier +     * @param integer $oid                  object identifier
112     * @return boolean                      whether ot not the operation was successful +     * @return boolean                      whether ot not the operation was successful
113     */ +     */
114    public function evict($oid) +    public function evict($oid)
115    { +    {
116        if ( ! isset($this->registry[$oid])) { +        if ( ! isset($this->registry[$oid])) {
117            return false; +            return false;
118        } +        }
119        unset($this->registry[$oid]); +        unset($this->registry[$oid]);
120        return true; +        return true;
121    } +    }
122 +
123    /** +    /**
124     * @return integer                      number of records evicted +     * @return integer                      number of records evicted
125     */ +     */
126    public function evictAll() +    public function evictAll()
127    { +    {
128        $evicted = 0; +        $evicted = 0;
129        foreach ($this->registry as $oid=>$record) { +        foreach ($this->registry as $oid=>$record) {
130            if ($this->evict($oid)) { +            if ($this->evict($oid)) {
131                $evicted++; +                $evicted++;
132            } +            }
133        } +        }
134        return $evicted; +        return $evicted;
135    } +    }
136 +
137    /** +    /**
138     * getIterator +     * getIterator
139     * @return ArrayIterator +     * @return ArrayIterator
140     */ +     */
141    public function getIterator() +    public function getIterator()
142    { +    {
143        return new ArrayIterator($this->registry); +        return new ArrayIterator($this->registry);
144    } +    }
145 +
146    /** +    /**
147     * contains +     * contains
148     * @param integer $oid                  object identifier +     * @param integer $oid                  object identifier
149     */ +     */
150    public function contains($oid) +    public function contains($oid)
151    { +    {
152        return isset($this->registry[$oid]); +        return isset($this->registry[$oid]);
153    } +    }
154 +
155    /** +    /**
156     * loadAll +     * loadAll
157     * @return void +     * @return void
158     */ +     */
159    public function loadAll() +    public function loadAll()
160    { +    {
161        $this->table->findAll(); +        $this->table->findAll();
162    } +    }
163 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id$ + *  $Id$
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Record_Abstract'); +Doctrine::autoload('Doctrine_Record_Abstract');
22/** +/**
23 * Doctrine_Template + * Doctrine_Template
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Template + * @subpackage  Template
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision$ + * @version     $Revision$
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Template extends Doctrine_Record_Abstract +class Doctrine_Template extends Doctrine_Record_Abstract
34{ +{
35    /** +    /**
36     * @param Doctrine_Record $_invoker     the record that invoked the last delegated call +     * @param Doctrine_Record $_invoker     the record that invoked the last delegated call
37     */ +     */
38    protected $_invoker; +    protected $_invoker;
39     +    
40     +    
41    protected $_plugin; +    protected $_plugin;
42 +
43    /** +    /**
44     * setTable +     * setTable
45     * +     *
46     * @param Doctrine_Table $_table        the table object this Template belongs to +     * @param Doctrine_Table $_table        the table object this Template belongs to
47     */ +     */
48    public function setTable(Doctrine_Table $table) +    public function setTable(Doctrine_Table $table)
49    { +    {
50        $this->_table = $table; +        $this->_table = $table;
51    } +    }
52 +
53    /** +    /**
54     * getTable +     * getTable
55     * returns the associated table object +     * returns the associated table object
56     * +     *
57     * @return Doctrine_Table               the associated table object +     * @return Doctrine_Table               the associated table object
58     */ +     */
59    public function getTable() +    public function getTable()
60    { +    {
61        return $this->_table; +        return $this->_table;
62    } +    }
63 +
64    /** +    /**
65     * setInvoker +     * setInvoker
66     * +     *
67     * sets the last used invoker +     * sets the last used invoker
68     * +     *
69     * @param Doctrine_Record $invoker      the record that invoked the last delegated call +     * @param Doctrine_Record $invoker      the record that invoked the last delegated call
70     * @return Doctrine_Template            this object +     * @return Doctrine_Template            this object
71     */ +     */
72    public function setInvoker(Doctrine_Record $invoker) +    public function setInvoker(Doctrine_Record $invoker)
73    { +    {
74        $this->_invoker = $invoker; +        $this->_invoker = $invoker;
75    } +    }
76 +
77    /** +    /**
78     * setInvoker +     * setInvoker
79     * returns the last used invoker +     * returns the last used invoker
80     * +     *
81     * @return Doctrine_Record              the record that invoked the last delegated call +     * @return Doctrine_Record              the record that invoked the last delegated call
82     */ +     */
83    public function getInvoker() +    public function getInvoker()
84    { +    {
85        return $this->_invoker; +        return $this->_invoker;
86    } +    }
87 +
88    /** +    /**
89     * addChild  +     * addChild 
90     * +     *
91     * Adds a plugin as a child to this plugin +     * Adds a plugin as a child to this plugin
92     *  +     * 
93     * @param Doctrine_Template $template  +     * @param Doctrine_Template $template 
94     * @return Doctrine_Template. Chainable. +     * @return Doctrine_Template. Chainable.
95     */ +     */
96    public function addChild(Doctrine_Template $template) +    public function addChild(Doctrine_Template $template)
97    { +    {
98        $this->_plugin->addChild($template); +        $this->_plugin->addChild($template);
99         +        
100        return $this; +        return $this;
101    } +    }
102 +
103 +
104    /** +    /**
105     * getPlugin  +     * getPlugin 
106     *  +     * 
107     * @return void +     * @return void
108     */ +     */
109    public function getPlugin() +    public function getPlugin()
110    { +    {
111        return $this->_plugin; +        return $this->_plugin;
112    } +    }
113 +
114    /** +    /**
115     * get  +     * get 
116     *  +     * 
117     * @param mixed $name  +     * @param mixed $name 
118     * @return void +     * @return void
119     */ +     */
120    public function get($name)  +    public function get($name) 
121    { +    {
122        throw new Doctrine_Exception("Templates doesn't support accessors."); +        throw new Doctrine_Exception("Templates doesn't support accessors.");
123    } +    }
124 +
125    /** +    /**
126     * set  +     * set 
127     *  +     * 
128     * @param mixed $name  +     * @param mixed $name 
129     * @param mixed $value  +     * @param mixed $value 
130     * @return void +     * @return void
131     */ +     */
132    public function set($name, $value) +    public function set($name, $value)
133    { +    {
134        throw new Doctrine_Exception("Templates doesn't support accessors."); +        throw new Doctrine_Exception("Templates doesn't support accessors.");
135    } +    }
136    /** +    /**
137     * setUp  +     * setUp 
138     *  +     * 
139     * @return void +     * @return void
140     */ +     */
141    public function setUp() +    public function setUp()
142    { +    {
143 +
144    } +    }
145 +
146    /** +    /**
147     * setTableDefinition  +     * setTableDefinition 
148     *  +     * 
149     * @return void +     * @return void
150     */ +     */
151    public function setTableDefinition() +    public function setTableDefinition()
152    { +    {
153 +
154    } +    }
155} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Template_I18n.html b/tests_old/coverage/Doctrine_Template_I18n.html index faf0ba1b2..ddfbaa4ac 100644 --- a/tests_old/coverage/Doctrine_Template_I18n.html +++ b/tests_old/coverage/Doctrine_Template_I18n.html @@ -10,219 +10,219 @@

Coverage for Doctrine_Template_I18n

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id$ + *  $Id$
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Template_I18n + * Doctrine_Template_I18n
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Template + * @subpackage  Template
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision$ + * @version     $Revision$
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Template_I18n extends Doctrine_Template +class Doctrine_Template_I18n extends Doctrine_Template
34{ +{
35    /** +    /**
36     * __construct +     * __construct
37     * +     *
38     * @param string $array  +     * @param string $array 
39     * @return void +     * @return void
40     */ +     */
41    public function __construct(array $options = array()) +    public function __construct(array $options = array())
42    { +    {
43        $this->_plugin = new Doctrine_I18n($options); +        $this->_plugin = new Doctrine_I18n($options);
44    } +    }
45    /** +    /**
46     * setUp +     * setUp
47     * +     *
48     * @return void +     * @return void
49     */ +     */
50    public function setUp() +    public function setUp()
51    { +    {
52        $name = $this->_table->getComponentName(); +        $name = $this->_table->getComponentName();
53 +
54        $this->_plugin->buildPluginDefinition($this->_table); +        $this->_plugin->buildPluginDefinition($this->_table);
55 +
56        $className = $this->_plugin->getOption('className'); +        $className = $this->_plugin->getOption('className');
57 +
58        $id = $this->_table->getIdentifier(); +        $id = $this->_table->getIdentifier();
59 +
60        $this->hasMany($className . ' as Translation', array('local' => $id, 'foreign' => $id)); +        $this->hasMany($className . ' as Translation', array('local' => $id, 'foreign' => $id));
61    } +    }
62     +    
63    /** +    /**
64     * getI18n +     * getI18n
65     * +     *
66     * @return void +     * @return void
67     */ +     */
68    public function getI18n() +    public function getI18n()
69    { +    {
70        return $this->_plugin; +        return $this->_plugin;
71    } +    }
72} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Template_Listener_Timestampable.html b/tests_old/coverage/Doctrine_Template_Listener_Timestampable.html index 7c1ddeb0b..751c498b0 100644 --- a/tests_old/coverage/Doctrine_Template_Listener_Timestampable.html +++ b/tests_old/coverage/Doctrine_Template_Listener_Timestampable.html @@ -64,7 +64,7 @@
 * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -91,7 +91,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Template_NestedSet.html b/tests_old/coverage/Doctrine_Template_NestedSet.html index b16de8ecb..c8c055190 100644 --- a/tests_old/coverage/Doctrine_Template_NestedSet.html +++ b/tests_old/coverage/Doctrine_Template_NestedSet.html @@ -64,7 +64,7 @@  * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -91,7 +91,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Template_Searchable.html b/tests_old/coverage/Doctrine_Template_Searchable.html index 0560738da..60eecf710 100644 --- a/tests_old/coverage/Doctrine_Template_Searchable.html +++ b/tests_old/coverage/Doctrine_Template_Searchable.html @@ -10,204 +10,204 @@

Coverage for Doctrine_Template_Searchable

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id$ + *  $Id$
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Template_Searchable + * Doctrine_Template_Searchable
24 * + *
25 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
26 * @package     Doctrine + * @package     Doctrine
27 * @subpackage  Template + * @subpackage  Template
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @version     $Revision$ + * @version     $Revision$
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31 * @since       1.0 + * @since       1.0
32 */ + */
33class Doctrine_Template_Searchable extends Doctrine_Template +class Doctrine_Template_Searchable extends Doctrine_Template
34{      +{     
35    public function __construct(array $options) +    public function __construct(array $options)
36    { +    {
37        $this->_plugin = new Doctrine_Search($options);  +        $this->_plugin = new Doctrine_Search($options); 
38    } +    }
39     +    
40    public function getPlugin() +    public function getPlugin()
41    { +    {
42        return $this->_plugin; +        return $this->_plugin;
43    } +    }
44 +
45    public function setUp() +    public function setUp()
46    { +    {
47        $id = $this->_table->getIdentifier(); +        $id = $this->_table->getIdentifier();
48        $name = $this->_table->getComponentName(); +        $name = $this->_table->getComponentName();
49        $className = $this->_plugin->getOption('className'); +        $className = $this->_plugin->getOption('className');
50 +
51        if (strpos($className, '%CLASS%') !== false) { +        if (strpos($className, '%CLASS%') !== false) {
52            $this->_plugin->setOption('className', str_replace('%CLASS%', $name, $className)); +            $this->_plugin->setOption('className', str_replace('%CLASS%', $name, $className));
53            $className = $this->_plugin->getOption('className'); +            $className = $this->_plugin->getOption('className');
54        } +        }
55        $this->_plugin->setOption('resource', $this->_table); +        $this->_plugin->setOption('resource', $this->_table);
56        $this->_plugin->buildDefinition(); +        $this->_plugin->buildDefinition();
57 +
58        $this->hasMany($className, array('local' => $id, 'foreign' => $id)); +        $this->hasMany($className, array('local' => $id, 'foreign' => $id));
59 +
60        $this->addListener(new Doctrine_Search_Listener($this->_plugin)); +        $this->addListener(new Doctrine_Search_Listener($this->_plugin));
61    } +    }
62 +
63    public function batchUpdateIndex($limit = null, $offset = null) +    public function batchUpdateIndex($limit = null, $offset = null)
64    { +    {
65        $this->_plugin->batchUpdateIndex($limit, $offset); +        $this->_plugin->batchUpdateIndex($limit, $offset);
66    } +    }
67} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Template_Sluggable.html b/tests_old/coverage/Doctrine_Template_Sluggable.html index c2e4c259a..95b421d9f 100644 --- a/tests_old/coverage/Doctrine_Template_Sluggable.html +++ b/tests_old/coverage/Doctrine_Template_Sluggable.html @@ -64,7 +64,7 @@
 * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -97,7 +97,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Template_Timestampable.html b/tests_old/coverage/Doctrine_Template_Timestampable.html index 7b9dceec7..24a4045e1 100644 --- a/tests_old/coverage/Doctrine_Template_Timestampable.html +++ b/tests_old/coverage/Doctrine_Template_Timestampable.html @@ -64,7 +64,7 @@  * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -97,7 +97,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Template_Versionable.html b/tests_old/coverage/Doctrine_Template_Versionable.html index b1a19f7aa..8d2357283 100644 --- a/tests_old/coverage/Doctrine_Template_Versionable.html +++ b/tests_old/coverage/Doctrine_Template_Versionable.html @@ -10,159 +10,159 @@

Coverage for Doctrine_Template_Versionable

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id$ + *  $Id$
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Template_Versionable + * Doctrine_Template_Versionable
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Template + * @subpackage  Template
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision$ + * @version     $Revision$
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Template_Versionable extends Doctrine_Template +class Doctrine_Template_Versionable extends Doctrine_Template
34{ +{
35    public function __construct(array $options) +    public function __construct(array $options)
36    { +    {
37        $this->_plugin = new Doctrine_AuditLog($options); +        $this->_plugin = new Doctrine_AuditLog($options);
38    } +    }
39    public function setUp() +    public function setUp()
40    { +    {
41        $this->_plugin->buildPluginDefinition($this->_table); +        $this->_plugin->buildPluginDefinition($this->_table);
42 +
43        $this->hasColumn('version', 'integer', 8); +        $this->hasColumn('version', 'integer', 8);
44 +
45        $this->addListener(new Doctrine_AuditLog_Listener($this->_plugin)); +        $this->addListener(new Doctrine_AuditLog_Listener($this->_plugin));
46    } +    }
47    public function getAuditLog() +    public function getAuditLog()
48    { +    {
49        return $this->_plugin; +        return $this->_plugin;
50    } +    }
51 +
52} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Tokenizer.html b/tests_old/coverage/Doctrine_Tokenizer.html index f218fec02..e4ce1432e 100644 --- a/tests_old/coverage/Doctrine_Tokenizer.html +++ b/tests_old/coverage/Doctrine_Tokenizer.html @@ -10,942 +10,942 @@

Coverage for Doctrine_Tokenizer

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: From.php 1080 2007-02-10 18:17:08Z romanb $ + *  $Id: From.php 1080 2007-02-10 18:17:08Z romanb $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Tokenizer + * Doctrine_Tokenizer
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Tokenizer + * @subpackage  Tokenizer
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 1080 $ + * @version     $Revision: 1080 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Tokenizer  +class Doctrine_Tokenizer 
34{ +{
35    /** +    /**
36     * trims brackets +     * trims brackets
37     * +     *
38     * @param string $str +     * @param string $str
39     * @param string $e1        the first bracket, usually '(' +     * @param string $e1        the first bracket, usually '('
40     * @param string $e2        the second bracket, usually ')' +     * @param string $e2        the second bracket, usually ')'
41     */ +     */
42    public static function bracketTrim($str, $e1 = '(', $e2 = ')') +    public static function bracketTrim($str, $e1 = '(', $e2 = ')')
43    { +    {
44        if (substr($str, 0, 1) === $e1 && substr($str, -1) === $e2) { +        if (substr($str, 0, 1) === $e1 && substr($str, -1) === $e2) {
45            return substr($str, 1, -1); +            return substr($str, 1, -1);
46        } else { +        } else {
47            return $str; +            return $str;
48        } +        }
49    } +    }
50 +
51    /** +    /**
52     * bracketExplode +     * bracketExplode
53     * +     *
54     * example: +     * example:
55     * +     *
56     * parameters: +     * parameters:
57     *      $str = (age < 20 AND age > 18) AND email LIKE 'John@example.com' +     *      $str = (age < 20 AND age > 18) AND email LIKE 'John@example.com'
58     *      $d = ' AND ' +     *      $d = ' AND '
59     *      $e1 = '(' +     *      $e1 = '('
60     *      $e2 = ')' +     *      $e2 = ')'
61     * +     *
62     * would return an array: +     * would return an array:
63     *      array("(age < 20 AND age > 18)", +     *      array("(age < 20 AND age > 18)",
64     *            "email LIKE 'John@example.com'") +     *            "email LIKE 'John@example.com'")
65     * +     *
66     * @param string $str +     * @param string $str
67     * @param string $d         the delimeter which explodes the string +     * @param string $d         the delimeter which explodes the string
68     * @param string $e1        the first bracket, usually '(' +     * @param string $e1        the first bracket, usually '('
69     * @param string $e2        the second bracket, usually ')' +     * @param string $e2        the second bracket, usually ')'
70     * +     *
71     */ +     */
72    public static function bracketExplode($str, $d = ' ', $e1 = '(', $e2 = ')') +    public static function bracketExplode($str, $d = ' ', $e1 = '(', $e2 = ')')
73    { +    {
74        if (is_array($d)) { +        if (is_array($d)) {
75            $a = preg_split('/('.implode('|', $d).')/', $str); +            $a = preg_split('/('.implode('|', $d).')/', $str);
76            $d = stripslashes($d[0]); +            $d = stripslashes($d[0]);
77        } else { +        } else {
78            $a = explode($d, $str); +            $a = explode($d, $str);
79        } +        }
80 +
81        $i = 0; +        $i = 0;
82        $term = array(); +        $term = array();
83        foreach($a as $key=>$val) { +        foreach($a as $key=>$val) {
84            if (empty($term[$i])) { +            if (empty($term[$i])) {
85                $term[$i] = trim($val); +                $term[$i] = trim($val);
86                $s1 = substr_count($term[$i], $e1); +                $s1 = substr_count($term[$i], $e1);
87                $s2 = substr_count($term[$i], $e2); +                $s2 = substr_count($term[$i], $e2);
88                 +                
89                if ($s1 == $s2) { +                if ($s1 == $s2) {
90                    $i++; +                    $i++;
91                } +                }
92            } else { +            } else {
93                $term[$i] .= $d . trim($val); +                $term[$i] .= $d . trim($val);
94                $c1 = substr_count($term[$i], $e1); +                $c1 = substr_count($term[$i], $e1);
95                $c2 = substr_count($term[$i], $e2); +                $c2 = substr_count($term[$i], $e2);
96                 +                
97                if ($c1 == $c2) {  +                if ($c1 == $c2) { 
98                    $i++; +                    $i++;
99                } +                }
100            } +            }
101        } +        }
102        return $term; +        return $term;
103    } +    }
104 +
105    /** +    /**
106     * quoteExplode +     * quoteExplode
107     * +     *
108     * example: +     * example:
109     * +     *
110     * parameters: +     * parameters:
111     *      $str = email LIKE 'John@example.com' +     *      $str = email LIKE 'John@example.com'
112     *      $d = ' AND ' +     *      $d = ' AND '
113     * +     *
114     * would return an array: +     * would return an array:
115     *      array("email", "LIKE", "'John@example.com'") +     *      array("email", "LIKE", "'John@example.com'")
116     * +     *
117     * @param string $str +     * @param string $str
118     * @param string $d         the delimeter which explodes the string +     * @param string $d         the delimeter which explodes the string
119     */ +     */
120    public static function quoteExplode($str, $d = ' ') +    public static function quoteExplode($str, $d = ' ')
121    { +    {
122        if (is_array($d)) { +        if (is_array($d)) {
123            $a = preg_split('/('.implode('|', $d).')/', $str); +            $a = preg_split('/('.implode('|', $d).')/', $str);
124            $d = stripslashes($d[0]); +            $d = stripslashes($d[0]);
125        } else { +        } else {
126            $a = explode($d, $str); +            $a = explode($d, $str);
127        } +        }
128 +
129        $i = 0; +        $i = 0;
130        $term = array(); +        $term = array();
131        foreach ($a as $key => $val) { +        foreach ($a as $key => $val) {
132            if (empty($term[$i])) { +            if (empty($term[$i])) {
133                $term[$i] = trim($val); +                $term[$i] = trim($val);
134 +
135                if ( ! (substr_count($term[$i], "'") & 1)) { +                if ( ! (substr_count($term[$i], "'") & 1)) {
136                    $i++; +                    $i++;
137                } +                }
138            } else { +            } else {
139                $term[$i] .= $d . trim($val); +                $term[$i] .= $d . trim($val);
140 +
141                if ( ! (substr_count($term[$i], "'") & 1)) { +                if ( ! (substr_count($term[$i], "'") & 1)) {
142                    $i++; +                    $i++;
143                } +                }
144            } +            }
145        } +        }
146        return $term; +        return $term;
147    } +    }
148 +
149    /** +    /**
150     * sqlExplode +     * sqlExplode
151     * +     *
152     * explodes a string into array using custom brackets and +     * explodes a string into array using custom brackets and
153     * quote delimeters +     * quote delimeters
154     * +     *
155     * +     *
156     * example: +     * example:
157     * +     *
158     * parameters: +     * parameters:
159     *      $str = "(age < 20 AND age > 18) AND name LIKE 'John Doe'" +     *      $str = "(age < 20 AND age > 18) AND name LIKE 'John Doe'"
160     *      $d   = ' ' +     *      $d   = ' '
161     *      $e1  = '(' +     *      $e1  = '('
162     *      $e2  = ')' +     *      $e2  = ')'
163     * +     *
164     * would return an array: +     * would return an array:
165     *      array('(age < 20 AND age > 18)', +     *      array('(age < 20 AND age > 18)',
166     *            'name', +     *            'name',
167     *            'LIKE', +     *            'LIKE',
168     *            'John Doe') +     *            'John Doe')
169     * +     *
170     * @param string $str +     * @param string $str
171     * @param string $d         the delimeter which explodes the string +     * @param string $d         the delimeter which explodes the string
172     * @param string $e1        the first bracket, usually '(' +     * @param string $e1        the first bracket, usually '('
173     * @param string $e2        the second bracket, usually ')' +     * @param string $e2        the second bracket, usually ')'
174     * +     *
175     * @return array +     * @return array
176     */ +     */
177    public static function sqlExplode($str, $d = ' ', $e1 = '(', $e2 = ')') +    public static function sqlExplode($str, $d = ' ', $e1 = '(', $e2 = ')')
178    { +    {
179        if ($d == ' ') { +        if ($d == ' ') {
180            $d = array(' ', '\s'); +            $d = array(' ', '\s');
181        } +        }
182        if (is_array($d)) { +        if (is_array($d)) {
183            $d = array_map('preg_quote', $d); +            $d = array_map('preg_quote', $d);
184 +
185            if (in_array(' ', $d)) { +            if (in_array(' ', $d)) {
186                $d[] = '\s'; +                $d[] = '\s';
187            } +            }
188 +
189            $split = '§(' . implode('|', $d) . ')§'; +            $split = '§(' . implode('|', $d) . ')§';
190 +
191            $str = preg_split($split, $str); +            $str = preg_split($split, $str);
192            $d = stripslashes($d[0]); +            $d = stripslashes($d[0]);
193        } else { +        } else {
194            $str = explode($d, $str); +            $str = explode($d, $str);
195        } +        }
196 +
197        $i = 0; +        $i = 0;
198        $term = array(); +        $term = array();
199 +
200        foreach ($str as $key => $val) { +        foreach ($str as $key => $val) {
201            if (empty($term[$i])) { +            if (empty($term[$i])) {
202                $term[$i] = trim($val); +                $term[$i] = trim($val);
203 +
204                $s1 = substr_count($term[$i], $e1); +                $s1 = substr_count($term[$i], $e1);
205                $s2 = substr_count($term[$i], $e2); +                $s2 = substr_count($term[$i], $e2);
206 +
207                if (strpos($term[$i], '(') !== false) { +                if (strpos($term[$i], '(') !== false) {
208                    if ($s1 == $s2) { +                    if ($s1 == $s2) {
209                        $i++; +                        $i++;
210                    } +                    }
211                } else { +                } else {
212                    if ( ! (substr_count($term[$i], "'") & 1) && +                    if ( ! (substr_count($term[$i], "'") & 1) &&
213                         ! (substr_count($term[$i], "\"") & 1)) { +                         ! (substr_count($term[$i], "\"") & 1)) {
214                        $i++; +                        $i++;
215                    } +                    }
216                } +                }
217            } else { +            } else {
218                $term[$i] .= $d . trim($val); +                $term[$i] .= $d . trim($val);
219                $c1 = substr_count($term[$i], $e1); +                $c1 = substr_count($term[$i], $e1);
220                $c2 = substr_count($term[$i], $e2); +                $c2 = substr_count($term[$i], $e2);
221 +
222                if (strpos($term[$i], '(') !== false) { +                if (strpos($term[$i], '(') !== false) {
223                    if ($c1 == $c2) { +                    if ($c1 == $c2) {
224                        $i++; +                        $i++;
225                    } +                    }
226                } else { +                } else {
227                    if ( ! (substr_count($term[$i], "'") & 1) && +                    if ( ! (substr_count($term[$i], "'") & 1) &&
228                         ! (substr_count($term[$i], "\"") & 1)) { +                         ! (substr_count($term[$i], "\"") & 1)) {
229                        $i++; +                        $i++;
230                    } +                    }
231                } +                }
232            } +            }
233        } +        }
234        return $term; +        return $term;
235    } +    }
236 +
237    /** +    /**
238     * clauseExplode +     * clauseExplode
239     * +     *
240     * explodes a string into array using custom brackets and +     * explodes a string into array using custom brackets and
241     * quote delimeters +     * quote delimeters
242     * +     *
243     * +     *
244     * example: +     * example:
245     * +     *
246     * parameters: +     * parameters:
247     *      $str = "(age < 20 AND age > 18) AND name LIKE 'John Doe'" +     *      $str = "(age < 20 AND age > 18) AND name LIKE 'John Doe'"
248     *      $d   = ' ' +     *      $d   = ' '
249     *      $e1  = '(' +     *      $e1  = '('
250     *      $e2  = ')' +     *      $e2  = ')'
251     * +     *
252     * would return an array: +     * would return an array:
253     *      array('(age < 20 AND age > 18)', +     *      array('(age < 20 AND age > 18)',
254     *            'name', +     *            'name',
255     *            'LIKE', +     *            'LIKE',
256     *            'John Doe') +     *            'John Doe')
257     * +     *
258     * @param string $str +     * @param string $str
259     * @param string $d         the delimeter which explodes the string +     * @param string $d         the delimeter which explodes the string
260     * @param string $e1        the first bracket, usually '(' +     * @param string $e1        the first bracket, usually '('
261     * @param string $e2        the second bracket, usually ')' +     * @param string $e2        the second bracket, usually ')'
262     * +     *
263     * @return array +     * @return array
264     */ +     */
265    public static function clauseExplode($str, array $d, $e1 = '(', $e2 = ')') +    public static function clauseExplode($str, array $d, $e1 = '(', $e2 = ')')
266    { +    {
267        if (is_array($d)) { +        if (is_array($d)) {
268            $d = array_map('preg_quote', $d); +            $d = array_map('preg_quote', $d);
269 +
270            if (in_array(' ', $d)) { +            if (in_array(' ', $d)) {
271                $d[] = '\s'; +                $d[] = '\s';
272            } +            }
273 +
274            $split = '§(' . implode('|', $d) . ')§'; +            $split = '§(' . implode('|', $d) . ')§';
275 +
276            $str = preg_split($split, $str, -1, PREG_SPLIT_DELIM_CAPTURE); +            $str = preg_split($split, $str, -1, PREG_SPLIT_DELIM_CAPTURE);
277        } +        }
278 +
279        $i = 0; +        $i = 0;
280        $term = array(); +        $term = array();
281 +
282        foreach ($str as $key => $val) { +        foreach ($str as $key => $val) {
283            if ($key & 1) { +            if ($key & 1) {
284                if (isset($term[($i - 1)]) && ! is_array($term[($i - 1)])) { +                if (isset($term[($i - 1)]) && ! is_array($term[($i - 1)])) {
285                    $term[($i - 1)] = array($term[($i - 1)], $val); +                    $term[($i - 1)] = array($term[($i - 1)], $val);
286                } +                }
287                continue; +                continue;
288            } +            }
289            if (empty($term[$i])) { +            if (empty($term[$i])) {
290                $term[$i] = $val; +                $term[$i] = $val;
291            } else { +            } else {
292                $term[$i] .= $str[($key - 1)] . $val; +                $term[$i] .= $str[($key - 1)] . $val;
293            } +            }
294 +
295            $c1 = substr_count($term[$i], $e1); +            $c1 = substr_count($term[$i], $e1);
296            $c2 = substr_count($term[$i], $e2); +            $c2 = substr_count($term[$i], $e2);
297 +
298            if (strpos($term[$i], '(') !== false) { +            if (strpos($term[$i], '(') !== false) {
299                if ($c1 == $c2) { +                if ($c1 == $c2) {
300                    $i++; +                    $i++;
301                } +                }
302            } else { +            } else {
303                if ( ! (substr_count($term[$i], "'") & 1) && +                if ( ! (substr_count($term[$i], "'") & 1) &&
304                     ! (substr_count($term[$i], "\"") & 1)) { +                     ! (substr_count($term[$i], "\"") & 1)) {
305                    $i++; +                    $i++;
306                } +                }
307            } +            }
308        } +        }
309        $term[$i - 1] = array($term[$i - 1], ''); +        $term[$i - 1] = array($term[$i - 1], '');
310 +
311        return $term; +        return $term;
312    } +    }
313} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Transaction.html b/tests_old/coverage/Doctrine_Transaction.html index 6c82d1908..2e1eb9e71 100644 --- a/tests_old/coverage/Doctrine_Transaction.html +++ b/tests_old/coverage/Doctrine_Transaction.html @@ -10,1362 +10,1362 @@

Coverage for Doctrine_Transaction

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: Transaction.php 3184 2007-11-18 16:42:33Z romanb $ + *  $Id: Transaction.php 3184 2007-11-18 16:42:33Z romanb $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Connection_Module'); +Doctrine::autoload('Doctrine_Connection_Module');
22/** +/**
23 * Doctrine_Transaction + * Doctrine_Transaction
24 * Handles transaction savepoint and isolation abstraction + * Handles transaction savepoint and isolation abstraction
25 * + *
26 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
27 * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library) + * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @package     Doctrine + * @package     Doctrine
30 * @subpackage  Transaction + * @subpackage  Transaction
31 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
32 * @since       1.0 + * @since       1.0
33 * @version     $Revision: 3184 $ + * @version     $Revision: 3184 $
34 */ + */
35class Doctrine_Transaction extends Doctrine_Connection_Module +class Doctrine_Transaction extends Doctrine_Connection_Module
36{ +{
37    /** +    /**
38     * Doctrine_Transaction is in sleep state when it has no active transactions +     * Doctrine_Transaction is in sleep state when it has no active transactions
39     */ +     */
40    const STATE_SLEEP       = 0; +    const STATE_SLEEP       = 0;
41 +
42    /** +    /**
43     * Doctrine_Transaction is in active state when it has one active transaction +     * Doctrine_Transaction is in active state when it has one active transaction
44     */ +     */
45    const STATE_ACTIVE      = 1; +    const STATE_ACTIVE      = 1;
46 +
47    /** +    /**
48     * Doctrine_Transaction is in busy state when it has multiple active transactions +     * Doctrine_Transaction is in busy state when it has multiple active transactions
49     */ +     */
50    const STATE_BUSY        = 2; +    const STATE_BUSY        = 2;
51 +
52    /** +    /**
53     * @var integer $transactionLevel      the nesting level of transactions, used by transaction methods +     * @var integer $transactionLevel      the nesting level of transactions, used by transaction methods
54     */ +     */
55    protected $transactionLevel  = 0; +    protected $transactionLevel  = 0;
56 +
57    /** +    /**
58     * @var array $invalid                  an array containing all invalid records within this transaction +     * @var array $invalid                  an array containing all invalid records within this transaction
59     * @todo What about a more verbose name? $invalidRecords? +     * @todo What about a more verbose name? $invalidRecords?
60     */ +     */
61    protected $invalid          = array(); +    protected $invalid          = array();
62 +
63    /** +    /**
64     * @var array $savepoints               an array containing all savepoints +     * @var array $savepoints               an array containing all savepoints
65     */ +     */
66    protected $savePoints       = array(); +    protected $savePoints       = array();
67 +
68    /** +    /**
69     * @var array $_collections             an array of Doctrine_Collection objects that were affected during the Transaction +     * @var array $_collections             an array of Doctrine_Collection objects that were affected during the Transaction
70     */ +     */
71    protected $_collections     = array(); +    protected $_collections     = array();
72 +
73    /** +    /**
74     * addCollection +     * addCollection
75     * adds a collection in the internal array of collections +     * adds a collection in the internal array of collections
76     * +     *
77     * at the end of each commit this array is looped over and +     * at the end of each commit this array is looped over and
78     * of every collection Doctrine then takes a snapshot in order +     * of every collection Doctrine then takes a snapshot in order
79     * to keep the collections up to date with the database +     * to keep the collections up to date with the database
80     * +     *
81     * @param Doctrine_Collection $coll     a collection to be added +     * @param Doctrine_Collection $coll     a collection to be added
82     * @return Doctrine_Transaction         this object +     * @return Doctrine_Transaction         this object
83     */ +     */
84    public function addCollection(Doctrine_Collection $coll) +    public function addCollection(Doctrine_Collection $coll)
85    { +    {
86        $this->_collections[] = $coll; +        $this->_collections[] = $coll;
87 +
88        return $this; +        return $this;
89    } +    }
90 +
91    /** +    /**
92     * getState +     * getState
93     * returns the state of this connection +     * returns the state of this connection
94     * +     *
95     * @see Doctrine_Connection_Transaction::STATE_* constants +     * @see Doctrine_Connection_Transaction::STATE_* constants
96     * @return integer          the connection state +     * @return integer          the connection state
97     */ +     */
98    public function getState() +    public function getState()
99    { +    {
100        switch ($this->transactionLevel) { +        switch ($this->transactionLevel) {
101            case 0: +            case 0:
102                return Doctrine_Transaction::STATE_SLEEP; +                return Doctrine_Transaction::STATE_SLEEP;
103                break; +                break;
104            case 1: +            case 1:
105                return Doctrine_Transaction::STATE_ACTIVE; +                return Doctrine_Transaction::STATE_ACTIVE;
106                break; +                break;
107            default: +            default:
108                return Doctrine_Transaction::STATE_BUSY; +                return Doctrine_Transaction::STATE_BUSY;
109        } +        }
110    } +    }
111 +
112    /** +    /**
113     * addInvalid +     * addInvalid
114     * adds record into invalid records list +     * adds record into invalid records list
115     * +     *
116     * @param Doctrine_Record $record +     * @param Doctrine_Record $record
117     * @return boolean        false if record already existed in invalid records list, +     * @return boolean        false if record already existed in invalid records list,
118     *                        otherwise true +     *                        otherwise true
119     */ +     */
120    public function addInvalid(Doctrine_Record $record) +    public function addInvalid(Doctrine_Record $record)
121    { +    {
122        if (in_array($record, $this->invalid, true)) { +        if (in_array($record, $this->invalid, true)) {
123            return false; +            return false;
124        } +        }
125        $this->invalid[] = $record; +        $this->invalid[] = $record;
126        return true; +        return true;
127    } +    }
128 +
129 +
130   /** +   /**
131    * Return the invalid records +    * Return the invalid records
132    * +    *
133    * @return array An array of invalid records +    * @return array An array of invalid records
134    */  +    */ 
135    public function getInvalid(){ +    public function getInvalid(){
136        return $this->invalid; +        return $this->invalid;
137    } +    }
138 +
139    /** +    /**
140     * getTransactionLevel +     * getTransactionLevel
141     * get the current transaction nesting level +     * get the current transaction nesting level
142     * +     *
143     * @return integer +     * @return integer
144     */ +     */
145    public function getTransactionLevel() +    public function getTransactionLevel()
146    { +    {
147        return $this->transactionLevel; +        return $this->transactionLevel;
148    } +    }
149 +
150    /** +    /**
151     * getTransactionLevel +     * getTransactionLevel
152     * set the current transaction nesting level +     * set the current transaction nesting level
153     * +     *
154     * @return Doctrine_Transaction     this object +     * @return Doctrine_Transaction     this object
155     */ +     */
156    public function setTransactionLevel($level) +    public function setTransactionLevel($level)
157    { +    {
158        $this->transactionLevel = $level; +        $this->transactionLevel = $level;
159 +
160        return $this; +        return $this;
161    } +    }
162 +
163    /** +    /**
164     * beginTransaction +     * beginTransaction
165     * Start a transaction or set a savepoint. +     * Start a transaction or set a savepoint.
166     * +     *
167     * if trying to set a savepoint and there is no active transaction +     * if trying to set a savepoint and there is no active transaction
168     * a new transaction is being started +     * a new transaction is being started
169     * +     *
170     * Listeners: onPreTransactionBegin, onTransactionBegin +     * Listeners: onPreTransactionBegin, onTransactionBegin
171     * +     *
172     * @param string $savepoint                 name of a savepoint to set +     * @param string $savepoint                 name of a savepoint to set
173     * @throws Doctrine_Transaction_Exception   if the transaction fails at database level      +     * @throws Doctrine_Transaction_Exception   if the transaction fails at database level     
174     * @return integer                          current transaction nesting level +     * @return integer                          current transaction nesting level
175     */ +     */
176    public function beginTransaction($savepoint = null) +    public function beginTransaction($savepoint = null)
177    { +    {
178        $this->conn->connect(); +        $this->conn->connect();
179         +        
180        $listener = $this->conn->getAttribute(Doctrine::ATTR_LISTENER); +        $listener = $this->conn->getAttribute(Doctrine::ATTR_LISTENER);
181 +
182        if ( ! is_null($savepoint)) { +        if ( ! is_null($savepoint)) {
183            $this->savePoints[] = $savepoint; +            $this->savePoints[] = $savepoint;
184 +
185            $event = new Doctrine_Event($this, Doctrine_Event::SAVEPOINT_CREATE); +            $event = new Doctrine_Event($this, Doctrine_Event::SAVEPOINT_CREATE);
186 +
187            $listener->preSavepointCreate($event); +            $listener->preSavepointCreate($event);
188 +
189            if ( ! $event->skipOperation) { +            if ( ! $event->skipOperation) {
190                $this->createSavePoint($savepoint); +                $this->createSavePoint($savepoint);
191            } +            }
192 +
193            $listener->postSavepointCreate($event); +            $listener->postSavepointCreate($event);
194        } else { +        } else {
195            if ($this->transactionLevel == 0) { +            if ($this->transactionLevel == 0) {
196                $event = new Doctrine_Event($this, Doctrine_Event::TX_BEGIN); +                $event = new Doctrine_Event($this, Doctrine_Event::TX_BEGIN);
197 +
198                $listener->preTransactionBegin($event); +                $listener->preTransactionBegin($event);
199 +
200                if ( ! $event->skipOperation) { +                if ( ! $event->skipOperation) {
201                    try { +                    try {
202                        $this->conn->getDbh()->beginTransaction(); +                        $this->conn->getDbh()->beginTransaction();
203                    } catch(Exception $e) { +                    } catch(Exception $e) {
204                        throw new Doctrine_Transaction_Exception($e->getMessage()); +                        throw new Doctrine_Transaction_Exception($e->getMessage());
205                    } +                    }
206                } +                }
207                $listener->postTransactionBegin($event); +                $listener->postTransactionBegin($event);
208            } +            }
209        } +        }
210 +
211        $level = ++$this->transactionLevel; +        $level = ++$this->transactionLevel;
212 +
213        return $level; +        return $level;
214    } +    }
215 +
216    /** +    /**
217     * commit +     * commit
218     * Commit the database changes done during a transaction that is in +     * Commit the database changes done during a transaction that is in
219     * progress or release a savepoint. This function may only be called when +     * progress or release a savepoint. This function may only be called when
220     * auto-committing is disabled, otherwise it will fail. +     * auto-committing is disabled, otherwise it will fail.
221     * +     *
222     * Listeners: preTransactionCommit, postTransactionCommit +     * Listeners: preTransactionCommit, postTransactionCommit
223     * +     *
224     * @param string $savepoint                 name of a savepoint to release +     * @param string $savepoint                 name of a savepoint to release
225     * @throws Doctrine_Transaction_Exception   if the transaction fails at database level +     * @throws Doctrine_Transaction_Exception   if the transaction fails at database level
226     * @throws Doctrine_Validator_Exception     if the transaction fails due to record validations +     * @throws Doctrine_Validator_Exception     if the transaction fails due to record validations
227     * @return boolean                          false if commit couldn't be performed, true otherwise +     * @return boolean                          false if commit couldn't be performed, true otherwise
228     */ +     */
229    public function commit($savepoint = null) +    public function commit($savepoint = null)
230    { +    {
231        $this->conn->connect(); +        $this->conn->connect();
232 +
233        if ($this->transactionLevel == 0) { +        if ($this->transactionLevel == 0) {
234            return false; +            return false;
235        } +        }
236 +
237        $listener = $this->conn->getAttribute(Doctrine::ATTR_LISTENER); +        $listener = $this->conn->getAttribute(Doctrine::ATTR_LISTENER);
238 +
239        if ( ! is_null($savepoint)) { +        if ( ! is_null($savepoint)) {
240            $this->transactionLevel -= $this->removeSavePoints($savepoint); +            $this->transactionLevel -= $this->removeSavePoints($savepoint);
241 +
242            $event = new Doctrine_Event($this, Doctrine_Event::SAVEPOINT_COMMIT); +            $event = new Doctrine_Event($this, Doctrine_Event::SAVEPOINT_COMMIT);
243 +
244            $listener->preSavepointCommit($event); +            $listener->preSavepointCommit($event);
245 +
246            if ( ! $event->skipOperation) { +            if ( ! $event->skipOperation) {
247                $this->releaseSavePoint($savepoint); +                $this->releaseSavePoint($savepoint);
248            } +            }
249 +
250            $listener->postSavepointCommit($event); +            $listener->postSavepointCommit($event);
251        } else {             +        } else {            
252            if ($this->transactionLevel == 1) { +            if ($this->transactionLevel == 1) {
253                if ( ! empty($this->invalid)) { +                if ( ! empty($this->invalid)) {
254                    $this->rollback(); +                    $this->rollback();
255                    $tmp = $this->invalid; +                    $tmp = $this->invalid;
256                    $this->invalid = array(); +                    $this->invalid = array();
257                    throw new Doctrine_Validator_Exception($tmp); +                    throw new Doctrine_Validator_Exception($tmp);
258                } +                }
259                // take snapshots of all collections used within this transaction +                // take snapshots of all collections used within this transaction
260                foreach ($this->_collections as $coll) { +                foreach ($this->_collections as $coll) {
261                    $coll->takeSnapshot(); +                    $coll->takeSnapshot();
262                } +                }
263                $this->_collections = array(); +                $this->_collections = array();
264                 +                
265                $event = new Doctrine_Event($this, Doctrine_Event::TX_COMMIT); +                $event = new Doctrine_Event($this, Doctrine_Event::TX_COMMIT);
266             +            
267                $listener->preTransactionCommit($event); +                $listener->preTransactionCommit($event);
268                if ( ! $event->skipOperation) { +                if ( ! $event->skipOperation) {
269                    $this->conn->getDbh()->commit(); +                    $this->conn->getDbh()->commit();
270                } +                }
271                $listener->postTransactionCommit($event); +                $listener->postTransactionCommit($event);
272 +
273            } +            }
274             +            
275            $this->transactionLevel--; +            $this->transactionLevel--;
276        } +        }
277 +
278        return true; +        return true;
279    } +    }
280 +
281    /** +    /**
282     * rollback +     * rollback
283     * Cancel any database changes done during a transaction or since a specific +     * Cancel any database changes done during a transaction or since a specific
284     * savepoint that is in progress. This function may only be called when +     * savepoint that is in progress. This function may only be called when
285     * auto-committing is disabled, otherwise it will fail. Therefore, a new +     * auto-committing is disabled, otherwise it will fail. Therefore, a new
286     * transaction is implicitly started after canceling the pending changes. +     * transaction is implicitly started after canceling the pending changes.
287     * +     *
288     * this method can be listened with onPreTransactionRollback and onTransactionRollback +     * this method can be listened with onPreTransactionRollback and onTransactionRollback
289     * eventlistener methods +     * eventlistener methods
290     * +     *
291     * @param string $savepoint                 name of a savepoint to rollback to    +     * @param string $savepoint                 name of a savepoint to rollback to   
292     * @throws Doctrine_Transaction_Exception   if the rollback operation fails at database level +     * @throws Doctrine_Transaction_Exception   if the rollback operation fails at database level
293     * @return boolean                          false if rollback couldn't be performed, true otherwise +     * @return boolean                          false if rollback couldn't be performed, true otherwise
294     * @todo Shouldnt this method only commit a rollback if the transactionLevel is 1 +     * @todo Shouldnt this method only commit a rollback if the transactionLevel is 1
295     *       (STATE_ACTIVE)? Explanation: Otherwise a rollback that is triggered from inside doctrine +     *       (STATE_ACTIVE)? Explanation: Otherwise a rollback that is triggered from inside doctrine
296     *       in an (emulated) nested transaction would lead to a complete database level +     *       in an (emulated) nested transaction would lead to a complete database level
297     *       rollback even though the client code did not yet want to do that. +     *       rollback even though the client code did not yet want to do that.
298     *       In other words: if the user starts a transaction doctrine shouldnt roll it back. +     *       In other words: if the user starts a transaction doctrine shouldnt roll it back.
299     *       Doctrine should only roll back transactions started by doctrine. Thoughts? +     *       Doctrine should only roll back transactions started by doctrine. Thoughts?
300     */ +     */
301    public function rollback($savepoint = null) +    public function rollback($savepoint = null)
302    { +    {
303        $this->conn->connect(); +        $this->conn->connect();
304        $currentState = $this->getState(); +        $currentState = $this->getState();
305         +        
306        if ($currentState != self::STATE_ACTIVE && $currentState != self::STATE_BUSY) { +        if ($currentState != self::STATE_ACTIVE && $currentState != self::STATE_BUSY) {
307            return false; +            return false;
308        } +        }
309 +
310        $listener = $this->conn->getAttribute(Doctrine::ATTR_LISTENER); +        $listener = $this->conn->getAttribute(Doctrine::ATTR_LISTENER);
311 +
312        if ( ! is_null($savepoint)) { +        if ( ! is_null($savepoint)) {
313            $this->transactionLevel -= $this->removeSavePoints($savepoint); +            $this->transactionLevel -= $this->removeSavePoints($savepoint);
314 +
315            $event = new Doctrine_Event($this, Doctrine_Event::SAVEPOINT_ROLLBACK); +            $event = new Doctrine_Event($this, Doctrine_Event::SAVEPOINT_ROLLBACK);
316 +
317            $listener->preSavepointRollback($event); +            $listener->preSavepointRollback($event);
318             +            
319            if ( ! $event->skipOperation) { +            if ( ! $event->skipOperation) {
320                $this->rollbackSavePoint($savepoint); +                $this->rollbackSavePoint($savepoint);
321            } +            }
322 +
323            $listener->postSavepointRollback($event); +            $listener->postSavepointRollback($event);
324        } else { +        } else {
325            $event = new Doctrine_Event($this, Doctrine_Event::TX_ROLLBACK); +            $event = new Doctrine_Event($this, Doctrine_Event::TX_ROLLBACK);
326     +    
327            $listener->preTransactionRollback($event); +            $listener->preTransactionRollback($event);
328             +            
329            if ( ! $event->skipOperation) { +            if ( ! $event->skipOperation) {
330                $this->transactionLevel = 0; +                $this->transactionLevel = 0;
331                try { +                try {
332                    $this->conn->getDbh()->rollback(); +                    $this->conn->getDbh()->rollback();
333                } catch (Exception $e) { +                } catch (Exception $e) {
334                    throw new Doctrine_Transaction_Exception($e->getMessage()); +                    throw new Doctrine_Transaction_Exception($e->getMessage());
335                } +                }
336            } +            }
337 +
338            $listener->postTransactionRollback($event); +            $listener->postTransactionRollback($event);
339        } +        }
340 +
341        return true; +        return true;
342    } +    }
343 +
344    /** +    /**
345     * releaseSavePoint +     * releaseSavePoint
346     * creates a new savepoint +     * creates a new savepoint
347     * +     *
348     * @param string $savepoint     name of a savepoint to create +     * @param string $savepoint     name of a savepoint to create
349     * @return void +     * @return void
350     */ +     */
351    protected function createSavePoint($savepoint) +    protected function createSavePoint($savepoint)
352    { +    {
353        throw new Doctrine_Transaction_Exception('Savepoints not supported by this driver.'); +        throw new Doctrine_Transaction_Exception('Savepoints not supported by this driver.');
354    } +    }
355 +
356    /** +    /**
357     * releaseSavePoint +     * releaseSavePoint
358     * releases given savepoint +     * releases given savepoint
359     * +     *
360     * @param string $savepoint     name of a savepoint to release +     * @param string $savepoint     name of a savepoint to release
361     * @return void +     * @return void
362     */ +     */
363    protected function releaseSavePoint($savepoint) +    protected function releaseSavePoint($savepoint)
364    { +    {
365        throw new Doctrine_Transaction_Exception('Savepoints not supported by this driver.'); +        throw new Doctrine_Transaction_Exception('Savepoints not supported by this driver.');
366    } +    }
367 +
368    /** +    /**
369     * rollbackSavePoint +     * rollbackSavePoint
370     * releases given savepoint +     * releases given savepoint
371     * +     *
372     * @param string $savepoint     name of a savepoint to rollback to +     * @param string $savepoint     name of a savepoint to rollback to
373     * @return void +     * @return void
374     */ +     */
375    protected function rollbackSavePoint($savepoint) +    protected function rollbackSavePoint($savepoint)
376    { +    {
377        throw new Doctrine_Transaction_Exception('Savepoints not supported by this driver.'); +        throw new Doctrine_Transaction_Exception('Savepoints not supported by this driver.');
378    } +    }
379 +
380    /** +    /**
381     * removeSavePoints +     * removeSavePoints
382     * removes a savepoint from the internal savePoints array of this transaction object +     * removes a savepoint from the internal savePoints array of this transaction object
383     * and all its children savepoints +     * and all its children savepoints
384     * +     *
385     * @param sring $savepoint      name of the savepoint to remove +     * @param sring $savepoint      name of the savepoint to remove
386     * @return integer              removed savepoints +     * @return integer              removed savepoints
387     */ +     */
388    private function removeSavePoints($savepoint) +    private function removeSavePoints($savepoint)
389    { +    {
390        $this->savePoints = array_values($this->savePoints); +        $this->savePoints = array_values($this->savePoints);
391 +
392        $found = false; +        $found = false;
393        $i = 0; +        $i = 0;
394 +
395        foreach ($this->savePoints as $key => $sp) { +        foreach ($this->savePoints as $key => $sp) {
396            if ( ! $found) { +            if ( ! $found) {
397                if ($sp === $savepoint) { +                if ($sp === $savepoint) {
398                    $found = true; +                    $found = true;
399                } +                }
400            } +            }
401            if ($found) { +            if ($found) {
402                $i++; +                $i++;
403                unset($this->savePoints[$key]); +                unset($this->savePoints[$key]);
404            } +            }
405        } +        }
406 +
407        return $i; +        return $i;
408    } +    }
409 +
410    /** +    /**
411     * setIsolation +     * setIsolation
412     * +     *
413     * Set the transacton isolation level. +     * Set the transacton isolation level.
414     * (implemented by the connection drivers) +     * (implemented by the connection drivers)
415     * +     *
416     * example: +     * example:
417     * +     *
418     * <code> +     * <code>
419     * $tx->setIsolation('READ UNCOMMITTED'); +     * $tx->setIsolation('READ UNCOMMITTED');
420     * </code> +     * </code>
421     * +     *
422     * @param   string  standard isolation level +     * @param   string  standard isolation level
423     *                  READ UNCOMMITTED (allows dirty reads) +     *                  READ UNCOMMITTED (allows dirty reads)
424     *                  READ COMMITTED (prevents dirty reads) +     *                  READ COMMITTED (prevents dirty reads)
425     *                  REPEATABLE READ (prevents nonrepeatable reads) +     *                  REPEATABLE READ (prevents nonrepeatable reads)
426     *                  SERIALIZABLE (prevents phantom reads) +     *                  SERIALIZABLE (prevents phantom reads)
427     * +     *
428     * @throws Doctrine_Transaction_Exception           if the feature is not supported by the driver +     * @throws Doctrine_Transaction_Exception           if the feature is not supported by the driver
429     * @throws PDOException                             if something fails at the PDO level +     * @throws PDOException                             if something fails at the PDO level
430     * @return void +     * @return void
431     */ +     */
432    public function setIsolation($isolation) +    public function setIsolation($isolation)
433    { +    {
434        throw new Doctrine_Transaction_Exception('Transaction isolation levels not supported by this driver.'); +        throw new Doctrine_Transaction_Exception('Transaction isolation levels not supported by this driver.');
435    } +    }
436 +
437    /** +    /**
438     * getTransactionIsolation +     * getTransactionIsolation
439     * +     *
440     * fetches the current session transaction isolation level +     * fetches the current session transaction isolation level
441     * +     *
442     * note: some drivers may support setting the transaction isolation level +     * note: some drivers may support setting the transaction isolation level
443     * but not fetching it +     * but not fetching it
444     * +     *
445     * @throws Doctrine_Transaction_Exception           if the feature is not supported by the driver +     * @throws Doctrine_Transaction_Exception           if the feature is not supported by the driver
446     * @throws PDOException                             if something fails at the PDO level +     * @throws PDOException                             if something fails at the PDO level
447     * @return string                                   returns the current session transaction isolation level +     * @return string                                   returns the current session transaction isolation level
448     */ +     */
449    public function getIsolation() +    public function getIsolation()
450    { +    {
451        throw new Doctrine_Transaction_Exception('Fetching transaction isolation level not supported by this driver.'); +        throw new Doctrine_Transaction_Exception('Fetching transaction isolation level not supported by this driver.');
452    } +    }
453} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Transaction_Exception.html b/tests_old/coverage/Doctrine_Transaction_Exception.html index 14110f9b9..899cf8d20 100644 --- a/tests_old/coverage/Doctrine_Transaction_Exception.html +++ b/tests_old/coverage/Doctrine_Transaction_Exception.html @@ -10,103 +10,103 @@

Coverage for Doctrine_Transaction_Exception

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Transaction_Firebird.html b/tests_old/coverage/Doctrine_Transaction_Firebird.html index 311cfd8a0..83f203783 100644 --- a/tests_old/coverage/Doctrine_Transaction_Firebird.html +++ b/tests_old/coverage/Doctrine_Transaction_Firebird.html @@ -10,421 +10,421 @@

Coverage for Doctrine_Transaction_Firebird

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Exception.php 2703 2007-10-03 21:47:55Z Jonathan.Wage $ + *  $Id: Exception.php 2703 2007-10-03 21:47:55Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Exception'); +Doctrine::autoload('Doctrine_Exception');
22/** +/**
23 * Doctrine_Transaction_Exception + * Doctrine_Transaction_Exception
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Transaction + * @subpackage  Transaction
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 2703 $ + * @version     $Revision: 2703 $
31 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
32 */ + */
33class Doctrine_Transaction_Exception extends Doctrine_Exception +class Doctrine_Transaction_Exception extends Doctrine_Exception
34 { }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Transaction_Mock.html b/tests_old/coverage/Doctrine_Transaction_Mock.html index e185e36c3..56b381951 100644 --- a/tests_old/coverage/Doctrine_Transaction_Mock.html +++ b/tests_old/coverage/Doctrine_Transaction_Mock.html @@ -10,109 +10,109 @@

Coverage for Doctrine_Transaction_Mock

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Firebird.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Firebird.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Transaction'); +Doctrine::autoload('Doctrine_Transaction');
22/** +/**
23 * + *
24 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
25 * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library) + * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
26 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
27 * @package     Doctrine + * @package     Doctrine
28 * @subpackage  Transaction + * @subpackage  Transaction
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30 * @since       1.0 + * @since       1.0
31 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
32 */ + */
33class Doctrine_Transaction_Firebird extends Doctrine_Transaction +class Doctrine_Transaction_Firebird extends Doctrine_Transaction
34{ +{
35    /** +    /**
36     * createSavepoint +     * createSavepoint
37     * creates a new savepoint +     * creates a new savepoint
38     * +     *
39     * @param string $savepoint     name of a savepoint to set +     * @param string $savepoint     name of a savepoint to set
40     * @return void +     * @return void
41     */ +     */
42    protected function createSavePoint($savepoint) +    protected function createSavePoint($savepoint)
43    { +    {
44        $query = 'SAVEPOINT ' . $savepoint; +        $query = 'SAVEPOINT ' . $savepoint;
45 +
46        return $this->conn->execute($query); +        return $this->conn->execute($query);
47    } +    }
48 +
49    /** +    /**
50     * releaseSavePoint +     * releaseSavePoint
51     * releases given savepoint +     * releases given savepoint
52     * +     *
53     * @param string $savepoint     name of a savepoint to release +     * @param string $savepoint     name of a savepoint to release
54     * @return void +     * @return void
55     */ +     */
56    protected function releaseSavePoint($savepoint) +    protected function releaseSavePoint($savepoint)
57    { +    {
58        $query = 'RELEASE SAVEPOINT ' . $savepoint; +        $query = 'RELEASE SAVEPOINT ' . $savepoint;
59 +
60        return $this->conn->execute($query); +        return $this->conn->execute($query);
61    } +    }
62 +
63    /** +    /**
64     * rollbackSavePoint +     * rollbackSavePoint
65     * releases given savepoint +     * releases given savepoint
66     * +     *
67     * @param string $savepoint     name of a savepoint to rollback to +     * @param string $savepoint     name of a savepoint to rollback to
68     * @return void +     * @return void
69     */ +     */
70    protected function rollbackSavePoint($savepoint) +    protected function rollbackSavePoint($savepoint)
71    { +    {
72        $query = 'ROLLBACK TO SAVEPOINT '.$savepoint; +        $query = 'ROLLBACK TO SAVEPOINT '.$savepoint;
73 +
74        return $this->conn->execute($query); +        return $this->conn->execute($query);
75    } +    }
76 +
77    /** +    /**
78     * Set the transacton isolation level. +     * Set the transacton isolation level.
79     * +     *
80     * @param   string  standard isolation level (SQL-92) +     * @param   string  standard isolation level (SQL-92)
81     *                  READ UNCOMMITTED (allows dirty reads) +     *                  READ UNCOMMITTED (allows dirty reads)
82     *                  READ COMMITTED (prevents dirty reads) +     *                  READ COMMITTED (prevents dirty reads)
83     *                  REPEATABLE READ (prevents nonrepeatable reads) +     *                  REPEATABLE READ (prevents nonrepeatable reads)
84     *                  SERIALIZABLE (prevents phantom reads) +     *                  SERIALIZABLE (prevents phantom reads)
85     * +     *
86     * @param   array some transaction options: +     * @param   array some transaction options:
87     *                  'wait' => 'WAIT' | 'NO WAIT' +     *                  'wait' => 'WAIT' | 'NO WAIT'
88     *                  'rw'   => 'READ WRITE' | 'READ ONLY' +     *                  'rw'   => 'READ WRITE' | 'READ ONLY'
89     * +     *
90     * @throws PDOException                         if something fails at the PDO level +     * @throws PDOException                         if something fails at the PDO level
91     * @throws Doctrine_Transaction_Exception       if using unknown isolation level or unknown wait option +     * @throws Doctrine_Transaction_Exception       if using unknown isolation level or unknown wait option
92     * @return void +     * @return void
93     */ +     */
94    public function setIsolation($isolation, $options = array()) { +    public function setIsolation($isolation, $options = array()) {
95        switch ($isolation) { +        switch ($isolation) {
96            case 'READ UNCOMMITTED': +            case 'READ UNCOMMITTED':
97                $nativeIsolation = 'READ COMMITTED RECORD_VERSION'; +                $nativeIsolation = 'READ COMMITTED RECORD_VERSION';
98                break; +                break;
99            case 'READ COMMITTED': +            case 'READ COMMITTED':
100                $nativeIsolation = 'READ COMMITTED NO RECORD_VERSION'; +                $nativeIsolation = 'READ COMMITTED NO RECORD_VERSION';
101                break; +                break;
102            case 'REPEATABLE READ': +            case 'REPEATABLE READ':
103                $nativeIsolation = 'SNAPSHOT'; +                $nativeIsolation = 'SNAPSHOT';
104                break; +                break;
105            case 'SERIALIZABLE': +            case 'SERIALIZABLE':
106                $nativeIsolation = 'SNAPSHOT TABLE STABILITY'; +                $nativeIsolation = 'SNAPSHOT TABLE STABILITY';
107                break; +                break;
108            default: +            default:
109                throw new Doctrine_Transaction_Exception('isolation level is not supported: ' . $isolation); +                throw new Doctrine_Transaction_Exception('isolation level is not supported: ' . $isolation);
110        } +        }
111 +
112        $rw = $wait = ''; +        $rw = $wait = '';
113 +
114        if (isset($options['wait'])) { +        if (isset($options['wait'])) {
115            switch ($options['wait']) { +            switch ($options['wait']) {
116                case 'WAIT': +                case 'WAIT':
117                case 'NO WAIT': +                case 'NO WAIT':
118                    $wait = ' ' . $options['wait']; +                    $wait = ' ' . $options['wait'];
119                break; +                break;
120                default: +                default:
121                    throw new Doctrine_Transaction_Exception('wait option is not supported: ' . $options['wait']); +                    throw new Doctrine_Transaction_Exception('wait option is not supported: ' . $options['wait']);
122            } +            }
123        } +        }
124 +
125        if (isset($options['rw'])) { +        if (isset($options['rw'])) {
126            switch ($options['rw']) { +            switch ($options['rw']) {
127                case 'READ ONLY': +                case 'READ ONLY':
128                case 'READ WRITE': +                case 'READ WRITE':
129                    $rw = ' ' . $options['rw']; +                    $rw = ' ' . $options['rw'];
130                    break; +                    break;
131                default: +                default:
132                    throw new Doctrine_Transaction_Exception('wait option is not supported: ' . $options['rw']); +                    throw new Doctrine_Transaction_Exception('wait option is not supported: ' . $options['rw']);
133            } +            }
134        } +        }
135 +
136        $query = 'SET TRANSACTION' . $rw . $wait .' ISOLATION LEVEL ' . $nativeIsolation; +        $query = 'SET TRANSACTION' . $rw . $wait .' ISOLATION LEVEL ' . $nativeIsolation;
137 +
138        $this->conn->execute($query); +        $this->conn->execute($query);
139    } +    }
140 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Transaction_Mssql.html b/tests_old/coverage/Doctrine_Transaction_Mssql.html index 3dd4c60ef..037f32fa9 100644 --- a/tests_old/coverage/Doctrine_Transaction_Mssql.html +++ b/tests_old/coverage/Doctrine_Transaction_Mssql.html @@ -10,205 +10,205 @@

Coverage for Doctrine_Transaction_Mssql

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id$ + *  $Id$
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Transaction'); +Doctrine::autoload('Doctrine_Transaction');
22/** +/**
23 * Doctrine_Transaction_Mock + * Doctrine_Transaction_Mock
24 * This class is used for testing purposes + * This class is used for testing purposes
25 * + *
26 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
27 * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library) + * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @package     Doctrine + * @package     Doctrine
30 * @subpackage  Transaction + * @subpackage  Transaction
31 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
32 * @since       1.0 + * @since       1.0
33 * @version     $Revision$ + * @version     $Revision$
34 */ + */
35class Doctrine_Transaction_Mock extends Doctrine_Transaction +class Doctrine_Transaction_Mock extends Doctrine_Transaction
36 { }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Transaction_Mysql.html b/tests_old/coverage/Doctrine_Transaction_Mysql.html index b949c5d76..ec763756f 100644 --- a/tests_old/coverage/Doctrine_Transaction_Mysql.html +++ b/tests_old/coverage/Doctrine_Transaction_Mysql.html @@ -10,349 +10,349 @@

Coverage for Doctrine_Transaction_Mysql

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Mssql.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $ + *  $Id: Mssql.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Transaction'); +Doctrine::autoload('Doctrine_Transaction');
22/** +/**
23 * + *
24 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
25 * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library) + * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
26 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
27 * @package     Doctrine + * @package     Doctrine
28 * @subpackage  Transaction + * @subpackage  Transaction
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30 * @since       1.0 + * @since       1.0
31 * @version     $Revision: 2702 $ + * @version     $Revision: 2702 $
32 */ + */
33class Doctrine_Transaction_Mssql extends Doctrine_Transaction +class Doctrine_Transaction_Mssql extends Doctrine_Transaction
34{ +{
35    /** +    /**
36     * Set the transacton isolation level. +     * Set the transacton isolation level.
37     * +     *
38     * @param   string  standard isolation level (SQL-92) +     * @param   string  standard isolation level (SQL-92)
39     *      portable modes: +     *      portable modes:
40     *                  READ UNCOMMITTED (allows dirty reads) +     *                  READ UNCOMMITTED (allows dirty reads)
41     *                  READ COMMITTED (prevents dirty reads) +     *                  READ COMMITTED (prevents dirty reads)
42     *                  REPEATABLE READ (prevents nonrepeatable reads) +     *                  REPEATABLE READ (prevents nonrepeatable reads)
43     *                  SERIALIZABLE (prevents phantom reads) +     *                  SERIALIZABLE (prevents phantom reads)
44     *      mssql specific modes: +     *      mssql specific modes:
45     *                  SNAPSHOT +     *                  SNAPSHOT
46     * +     *
47     * @link http://msdn2.microsoft.com/en-us/library/ms173763.aspx +     * @link http://msdn2.microsoft.com/en-us/library/ms173763.aspx
48     * @throws PDOException                         if something fails at the PDO level +     * @throws PDOException                         if something fails at the PDO level
49     * @throws Doctrine_Transaction_Exception       if using unknown isolation level or unknown wait option +     * @throws Doctrine_Transaction_Exception       if using unknown isolation level or unknown wait option
50     * @return void +     * @return void
51     */ +     */
52    public function setIsolation($isolation, $options = array()) { +    public function setIsolation($isolation, $options = array()) {
53        switch ($isolation) { +        switch ($isolation) {
54            case 'READ UNCOMMITTED': +            case 'READ UNCOMMITTED':
55            case 'READ COMMITTED': +            case 'READ COMMITTED':
56            case 'REPEATABLE READ': +            case 'REPEATABLE READ':
57            case 'SERIALIZABLE': +            case 'SERIALIZABLE':
58            case 'SNAPSHOT': +            case 'SNAPSHOT':
59                break; +                break;
60            default: +            default:
61                throw new Doctrine_Transaction_Exception('isolation level is not supported: ' . $isolation); +                throw new Doctrine_Transaction_Exception('isolation level is not supported: ' . $isolation);
62        } +        }
63 +
64        $query = 'SET TRANSACTION ISOLATION LEVEL ' . $isolation; +        $query = 'SET TRANSACTION ISOLATION LEVEL ' . $isolation;
65 +
66        $this->conn->execute($query); +        $this->conn->execute($query);
67    } +    }
68 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Transaction_Oracle.html b/tests_old/coverage/Doctrine_Transaction_Oracle.html index 7902b4fa7..e0b28ca77 100644 --- a/tests_old/coverage/Doctrine_Transaction_Oracle.html +++ b/tests_old/coverage/Doctrine_Transaction_Oracle.html @@ -10,319 +10,319 @@

Coverage for Doctrine_Transaction_Oracle

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Mysql.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Mysql.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Transaction'); +Doctrine::autoload('Doctrine_Transaction');
22/** +/**
23 * + *
24 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
25 * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library) + * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
26 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
27 * @package     Doctrine + * @package     Doctrine
28 * @subpackage  Transaction + * @subpackage  Transaction
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30 * @since       1.0 + * @since       1.0
31 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
32 */ + */
33class Doctrine_Transaction_Mysql extends Doctrine_Transaction +class Doctrine_Transaction_Mysql extends Doctrine_Transaction
34{ +{
35    /** +    /**
36     * createSavepoint +     * createSavepoint
37     * creates a new savepoint +     * creates a new savepoint
38     * +     *
39     * @param string $savepoint     name of a savepoint to set +     * @param string $savepoint     name of a savepoint to set
40     * @return void +     * @return void
41     */ +     */
42    protected function createSavePoint($savepoint) +    protected function createSavePoint($savepoint)
43    { +    {
44        $query = 'SAVEPOINT ' . $savepoint; +        $query = 'SAVEPOINT ' . $savepoint;
45 +
46        return $this->conn->execute($query); +        return $this->conn->execute($query);
47    } +    }
48 +
49    /** +    /**
50     * releaseSavePoint +     * releaseSavePoint
51     * releases given savepoint +     * releases given savepoint
52     * +     *
53     * @param string $savepoint     name of a savepoint to release +     * @param string $savepoint     name of a savepoint to release
54     * @return void +     * @return void
55     */ +     */
56    protected function releaseSavePoint($savepoint) +    protected function releaseSavePoint($savepoint)
57    { +    {
58        $query = 'RELEASE SAVEPOINT ' . $savepoint; +        $query = 'RELEASE SAVEPOINT ' . $savepoint;
59 +
60        return $this->conn->execute($query); +        return $this->conn->execute($query);
61    } +    }
62 +
63    /** +    /**
64     * rollbackSavePoint +     * rollbackSavePoint
65     * releases given savepoint +     * releases given savepoint
66     * +     *
67     * @param string $savepoint     name of a savepoint to rollback to +     * @param string $savepoint     name of a savepoint to rollback to
68     * @return void +     * @return void
69     */ +     */
70    protected function rollbackSavePoint($savepoint) +    protected function rollbackSavePoint($savepoint)
71    { +    {
72        $query = 'ROLLBACK TO SAVEPOINT ' . $savepoint; +        $query = 'ROLLBACK TO SAVEPOINT ' . $savepoint;
73 +
74        return $this->conn->execute($query); +        return $this->conn->execute($query);
75    } +    }
76 +
77    /** +    /**
78     * Set the transacton isolation level. +     * Set the transacton isolation level.
79     * +     *
80     * @param   string  standard isolation level +     * @param   string  standard isolation level
81     *                  READ UNCOMMITTED (allows dirty reads) +     *                  READ UNCOMMITTED (allows dirty reads)
82     *                  READ COMMITTED (prevents dirty reads) +     *                  READ COMMITTED (prevents dirty reads)
83     *                  REPEATABLE READ (prevents nonrepeatable reads) +     *                  REPEATABLE READ (prevents nonrepeatable reads)
84     *                  SERIALIZABLE (prevents phantom reads) +     *                  SERIALIZABLE (prevents phantom reads)
85     * +     *
86     * @throws Doctrine_Transaction_Exception           if using unknown isolation level +     * @throws Doctrine_Transaction_Exception           if using unknown isolation level
87     * @throws PDOException                             if something fails at the PDO level +     * @throws PDOException                             if something fails at the PDO level
88     * @return void +     * @return void
89     */ +     */
90    public function setIsolation($isolation) +    public function setIsolation($isolation)
91    { +    {
92        switch ($isolation) { +        switch ($isolation) {
93            case 'READ UNCOMMITTED': +            case 'READ UNCOMMITTED':
94            case 'READ COMMITTED': +            case 'READ COMMITTED':
95            case 'REPEATABLE READ': +            case 'REPEATABLE READ':
96            case 'SERIALIZABLE': +            case 'SERIALIZABLE':
97                break; +                break;
98            default: +            default:
99                throw new Doctrine_Transaction_Exception('Isolation level ' . $isolation . ' is not supported.'); +                throw new Doctrine_Transaction_Exception('Isolation level ' . $isolation . ' is not supported.');
100        } +        }
101 +
102        $query = 'SET SESSION TRANSACTION ISOLATION LEVEL ' . $isolation; +        $query = 'SET SESSION TRANSACTION ISOLATION LEVEL ' . $isolation;
103 +
104        return $this->conn->execute($query); +        return $this->conn->execute($query);
105    } +    }
106 +
107    /** +    /**
108     * getTransactionIsolation +     * getTransactionIsolation
109     * +     *
110     * @return string               returns the current session transaction isolation level +     * @return string               returns the current session transaction isolation level
111     */ +     */
112    public function getIsolation() +    public function getIsolation()
113    { +    {
114        return $this->conn->fetchOne('SELECT @@tx_isolation'); +        return $this->conn->fetchOne('SELECT @@tx_isolation');
115    } +    }
116 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Transaction_Pgsql.html b/tests_old/coverage/Doctrine_Transaction_Pgsql.html index 67d82fcf8..d849a1b9c 100644 --- a/tests_old/coverage/Doctrine_Transaction_Pgsql.html +++ b/tests_old/coverage/Doctrine_Transaction_Pgsql.html @@ -10,316 +10,316 @@

Coverage for Doctrine_Transaction_Pgsql

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Oracle.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Oracle.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Transaction'); +Doctrine::autoload('Doctrine_Transaction');
22/** +/**
23 * + *
24 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
25 * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library) + * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
26 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
27 * @package     Doctrine + * @package     Doctrine
28 * @subpackage  Transaction + * @subpackage  Transaction
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30 * @since       1.0 + * @since       1.0
31 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
32 */ + */
33class Doctrine_Transaction_Oracle extends Doctrine_Transaction +class Doctrine_Transaction_Oracle extends Doctrine_Transaction
34{ +{
35    /** +    /**
36     * createSavepoint +     * createSavepoint
37     * creates a new savepoint +     * creates a new savepoint
38     * +     *
39     * @param string $savepoint     name of a savepoint to set +     * @param string $savepoint     name of a savepoint to set
40     * @return void +     * @return void
41     */ +     */
42    protected function createSavePoint($savepoint) +    protected function createSavePoint($savepoint)
43    { +    {
44        $query = 'SAVEPOINT ' . $savepoint; +        $query = 'SAVEPOINT ' . $savepoint;
45 +
46        return $this->conn->execute($query); +        return $this->conn->execute($query);
47    } +    }
48 +
49    /** +    /**
50     * releaseSavePoint +     * releaseSavePoint
51     * releases given savepoint +     * releases given savepoint
52     * +     *
53     * @param string $savepoint     name of a savepoint to release +     * @param string $savepoint     name of a savepoint to release
54     * @return void +     * @return void
55     */ +     */
56    protected function releaseSavePoint($savepoint) +    protected function releaseSavePoint($savepoint)
57    { +    {
58        // oracle doesn't support manual releasing of savepoints +        // oracle doesn't support manual releasing of savepoints
59        return true; +        return true;
60    } +    }
61 +
62    /** +    /**
63     * rollbackSavePoint +     * rollbackSavePoint
64     * releases given savepoint +     * releases given savepoint
65     * +     *
66     * @param string $savepoint     name of a savepoint to rollback to +     * @param string $savepoint     name of a savepoint to rollback to
67     * @return void +     * @return void
68     */ +     */
69    protected function rollbackSavePoint($savepoint) +    protected function rollbackSavePoint($savepoint)
70    { +    {
71        $query = 'ROLLBACK TO SAVEPOINT ' . $savepoint; +        $query = 'ROLLBACK TO SAVEPOINT ' . $savepoint;
72 +
73        return $this->conn->execute($query); +        return $this->conn->execute($query);
74    } +    }
75 +
76    /** +    /**
77     * Set the transacton isolation level. +     * Set the transacton isolation level.
78     * +     *
79     * @param   string  standard isolation level +     * @param   string  standard isolation level
80     *                  READ UNCOMMITTED (allows dirty reads) +     *                  READ UNCOMMITTED (allows dirty reads)
81     *                  READ COMMITTED (prevents dirty reads) +     *                  READ COMMITTED (prevents dirty reads)
82     *                  REPEATABLE READ (prevents nonrepeatable reads) +     *                  REPEATABLE READ (prevents nonrepeatable reads)
83     *                  SERIALIZABLE (prevents phantom reads) +     *                  SERIALIZABLE (prevents phantom reads)
84     * @throws PDOException                         if something fails at the PDO level +     * @throws PDOException                         if something fails at the PDO level
85     * @throws Doctrine_Transaction_Exception       if using unknown isolation level +     * @throws Doctrine_Transaction_Exception       if using unknown isolation level
86     * @return void +     * @return void
87     */ +     */
88    public function setIsolation($isolation) +    public function setIsolation($isolation)
89    { +    {
90        switch ($isolation) { +        switch ($isolation) {
91            case 'READ UNCOMMITTED': +            case 'READ UNCOMMITTED':
92                $isolation = 'READ COMMITTED'; +                $isolation = 'READ COMMITTED';
93                break; +                break;
94            case 'READ COMMITTED': +            case 'READ COMMITTED':
95            case 'REPEATABLE READ': +            case 'REPEATABLE READ':
96            case 'SERIALIZABLE': +            case 'SERIALIZABLE':
97                $isolation = 'SERIALIZABLE'; +                $isolation = 'SERIALIZABLE';
98                break; +                break;
99            default: +            default:
100                throw new Doctrine_Transaction_Exception('Isolation level ' . $isolation . ' is not supported.'); +                throw new Doctrine_Transaction_Exception('Isolation level ' . $isolation . ' is not supported.');
101        } +        }
102 +
103        $query = 'ALTER SESSION ISOLATION LEVEL ' . $isolation; +        $query = 'ALTER SESSION ISOLATION LEVEL ' . $isolation;
104        return $this->conn->execute($query); +        return $this->conn->execute($query);
105    } +    }
106 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Transaction_Sqlite.html b/tests_old/coverage/Doctrine_Transaction_Sqlite.html index 8719ba36c..22459c53c 100644 --- a/tests_old/coverage/Doctrine_Transaction_Sqlite.html +++ b/tests_old/coverage/Doctrine_Transaction_Sqlite.html @@ -10,199 +10,199 @@

Coverage for Doctrine_Transaction_Sqlite

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Pgsql.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Pgsql.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Transaction'); +Doctrine::autoload('Doctrine_Transaction');
22/** +/**
23 * + *
24 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
25 * @author      Paul Cooper <pgc@ucecom.com> (PEAR MDB2 Pgsql driver) + * @author      Paul Cooper <pgc@ucecom.com> (PEAR MDB2 Pgsql driver)
26 * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library) + * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @package     Doctrine + * @package     Doctrine
29 * @subpackage  Transaction + * @subpackage  Transaction
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31 * @since       1.0 + * @since       1.0
32 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
33 */ + */
34class Doctrine_Transaction_Pgsql extends Doctrine_Transaction +class Doctrine_Transaction_Pgsql extends Doctrine_Transaction
35{ +{
36    /** +    /**
37     * createSavepoint +     * createSavepoint
38     * creates a new savepoint +     * creates a new savepoint
39     * +     *
40     * @param string $savepoint     name of a savepoint to set +     * @param string $savepoint     name of a savepoint to set
41     * @return void +     * @return void
42     */ +     */
43    protected function createSavePoint($savepoint) +    protected function createSavePoint($savepoint)
44    { +    {
45        $query = 'SAVEPOINT ' . $savepoint; +        $query = 'SAVEPOINT ' . $savepoint;
46 +
47        return $this->conn->execute($query); +        return $this->conn->execute($query);
48    } +    }
49 +
50    /** +    /**
51     * releaseSavePoint +     * releaseSavePoint
52     * releases given savepoint +     * releases given savepoint
53     * +     *
54     * @param string $savepoint     name of a savepoint to release +     * @param string $savepoint     name of a savepoint to release
55     * @return void +     * @return void
56     */ +     */
57    protected function releaseSavePoint($savepoint) +    protected function releaseSavePoint($savepoint)
58    { +    {
59        $query = 'RELEASE SAVEPOINT ' . $savepoint; +        $query = 'RELEASE SAVEPOINT ' . $savepoint;
60 +
61        return $this->conn->execute($query); +        return $this->conn->execute($query);
62    } +    }
63 +
64    /** +    /**
65     * rollbackSavePoint +     * rollbackSavePoint
66     * releases given savepoint +     * releases given savepoint
67     * +     *
68     * @param string $savepoint     name of a savepoint to rollback to +     * @param string $savepoint     name of a savepoint to rollback to
69     * @return void +     * @return void
70     */ +     */
71    protected function rollbackSavePoint($savepoint) +    protected function rollbackSavePoint($savepoint)
72    { +    {
73        $query = 'ROLLBACK TO SAVEPOINT ' . $savepoint; +        $query = 'ROLLBACK TO SAVEPOINT ' . $savepoint;
74 +
75        return $this->conn->execute($query); +        return $this->conn->execute($query);
76    } +    }
77 +
78    /** +    /**
79     * Set the transacton isolation level. +     * Set the transacton isolation level.
80     * +     *
81     * @param   string  standard isolation level +     * @param   string  standard isolation level
82     *                  READ UNCOMMITTED (allows dirty reads) +     *                  READ UNCOMMITTED (allows dirty reads)
83     *                  READ COMMITTED (prevents dirty reads) +     *                  READ COMMITTED (prevents dirty reads)
84     *                  REPEATABLE READ (prevents nonrepeatable reads) +     *                  REPEATABLE READ (prevents nonrepeatable reads)
85     *                  SERIALIZABLE (prevents phantom reads) +     *                  SERIALIZABLE (prevents phantom reads)
86     * @throws PDOException                         if something fails at the PDO level +     * @throws PDOException                         if something fails at the PDO level
87     * @throws Doctrine_Transaction_Exception       if using unknown isolation level or unknown wait option +     * @throws Doctrine_Transaction_Exception       if using unknown isolation level or unknown wait option
88     * @return void +     * @return void
89     */ +     */
90    public function setIsolation($isolation) +    public function setIsolation($isolation)
91    { +    {
92        switch ($isolation) { +        switch ($isolation) {
93            case 'READ UNCOMMITTED': +            case 'READ UNCOMMITTED':
94            case 'READ COMMITTED': +            case 'READ COMMITTED':
95            case 'REPEATABLE READ': +            case 'REPEATABLE READ':
96            case 'SERIALIZABLE': +            case 'SERIALIZABLE':
97                break; +                break;
98            default: +            default:
99                throw new Doctrine_Transaction_Exception('Isolation level '.$isolation.' is not supported.'); +                throw new Doctrine_Transaction_Exception('Isolation level '.$isolation.' is not supported.');
100        } +        }
101 +
102        $query = 'SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL ' . $isolation; +        $query = 'SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL ' . $isolation;
103        return $this->conn->execute($query); +        return $this->conn->execute($query);
104    } +    }
105 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Tree.html b/tests_old/coverage/Doctrine_Tree.html index e929b4869..7c03c5e28 100644 --- a/tests_old/coverage/Doctrine_Tree.html +++ b/tests_old/coverage/Doctrine_Tree.html @@ -64,7 +64,7 @@ - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: Sqlite.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $ + *  $Id: Sqlite.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Transaction'); +Doctrine::autoload('Doctrine_Transaction');
22/** +/**
23 * + *
24 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
25 * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library) + * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
26 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
27 * @package     Doctrine + * @package     Doctrine
28 * @subpackage  Transaction + * @subpackage  Transaction
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30 * @since       1.0 + * @since       1.0
31 * @version     $Revision: 2702 $ + * @version     $Revision: 2702 $
32 */ + */
33class Doctrine_Transaction_Sqlite extends Doctrine_Transaction +class Doctrine_Transaction_Sqlite extends Doctrine_Transaction
34{ +{
35    /** +    /**
36     * Set the transacton isolation level. +     * Set the transacton isolation level.
37     * +     *
38     * @param   string  standard isolation level +     * @param   string  standard isolation level
39     *                  READ UNCOMMITTED (allows dirty reads) +     *                  READ UNCOMMITTED (allows dirty reads)
40     *                  READ COMMITTED (prevents dirty reads) +     *                  READ COMMITTED (prevents dirty reads)
41     *                  REPEATABLE READ (prevents nonrepeatable reads) +     *                  REPEATABLE READ (prevents nonrepeatable reads)
42     *                  SERIALIZABLE (prevents phantom reads) +     *                  SERIALIZABLE (prevents phantom reads)
43     * @throws PDOException                         if something fails at the PDO level +     * @throws PDOException                         if something fails at the PDO level
44     * @throws Doctrine_Transaction_Exception       if using unknown isolation level +     * @throws Doctrine_Transaction_Exception       if using unknown isolation level
45     * @return void +     * @return void
46     */ +     */
47    public function setIsolation($isolation) +    public function setIsolation($isolation)
48    { +    {
49        switch ($isolation) { +        switch ($isolation) {
50            case 'READ UNCOMMITTED': +            case 'READ UNCOMMITTED':
51                $isolation = 0; +                $isolation = 0;
52                break; +                break;
53            case 'READ COMMITTED': +            case 'READ COMMITTED':
54            case 'REPEATABLE READ': +            case 'REPEATABLE READ':
55            case 'SERIALIZABLE': +            case 'SERIALIZABLE':
56                $isolation = 1; +                $isolation = 1;
57                break; +                break;
58            default: +            default:
59                throw new Doctrine_Transaction_Exception('Isolation level ' . $isolation . 'is not supported.'); +                throw new Doctrine_Transaction_Exception('Isolation level ' . $isolation . 'is not supported.');
60        } +        }
61 +
62        $query = 'PRAGMA read_uncommitted = ' . $isolation; +        $query = 'PRAGMA read_uncommitted = ' . $isolation;
63 +
64        return $this->conn->execute($query); +        return $this->conn->execute($query);
65    } +    }
66 }
 * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */                    @@ -88,7 +88,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
27 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
28  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Tree_NestedSet.html b/tests_old/coverage/Doctrine_Tree_NestedSet.html index 81f4de72d..1d8bdaaf5 100644 --- a/tests_old/coverage/Doctrine_Tree_NestedSet.html +++ b/tests_old/coverage/Doctrine_Tree_NestedSet.html @@ -64,7 +64,7 @@  * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -91,7 +91,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Validator.html b/tests_old/coverage/Doctrine_Validator.html index abda06503..8b40722cf 100644 --- a/tests_old/coverage/Doctrine_Validator.html +++ b/tests_old/coverage/Doctrine_Validator.html @@ -64,7 +64,7 @@  * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -94,7 +94,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Validator_Date.html b/tests_old/coverage/Doctrine_Validator_Date.html index b3f228015..7ce4f04ff 100644 --- a/tests_old/coverage/Doctrine_Validator_Date.html +++ b/tests_old/coverage/Doctrine_Validator_Date.html @@ -64,7 +64,7 @@  * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -91,7 +91,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Validator_Driver.html b/tests_old/coverage/Doctrine_Validator_Driver.html index 58d885c1e..307077dd7 100644 --- a/tests_old/coverage/Doctrine_Validator_Driver.html +++ b/tests_old/coverage/Doctrine_Validator_Driver.html @@ -10,349 +10,349 @@

Coverage for Doctrine_Validator_Driver

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Validator_Email.html b/tests_old/coverage/Doctrine_Validator_Email.html index 08c7ce8bd..c3e624aa4 100644 --- a/tests_old/coverage/Doctrine_Validator_Email.html +++ b/tests_old/coverage/Doctrine_Validator_Email.html @@ -64,7 +64,7 @@ - -
1<?php +<?php
2/* +/*
3 *  $Id: Notnull.php 1080 2007-02-10 18:17:08Z romanb $ + *  $Id: Notnull.php 1080 2007-02-10 18:17:08Z romanb $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Validator_Driver + * Doctrine_Validator_Driver
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Validator + * @subpackage  Validator
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 1080 $ + * @version     $Revision: 1080 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Validator_Driver +class Doctrine_Validator_Driver
34{ +{
35    /** +    /**
36     * @var array $_args     an array of plugin specific args +     * @var array $_args     an array of plugin specific args
37     */ +     */
38    protected $_args = array(); +    protected $_args = array();
39 +
40    /** +    /**
41     * __get +     * __get
42     * an alias for getOption +     * an alias for getOption
43     * +     *
44     * @param string $arg +     * @param string $arg
45     */ +     */
46    public function __get($arg) +    public function __get($arg)
47    { +    {
48        if (isset($this->_args[$arg])) { +        if (isset($this->_args[$arg])) {
49            return $this->_args[$arg]; +            return $this->_args[$arg];
50        } +        }
51        return null; +        return null;
52    } +    }
53 +
54    /** +    /**
55     * __isset +     * __isset
56     * +     *
57     * @param string $arg +     * @param string $arg
58     */ +     */
59    public function __isset($arg) +    public function __isset($arg)
60    { +    {
61        return isset($this->_args[$arg]); +        return isset($this->_args[$arg]);
62    } +    }
63 +
64    /** +    /**
65     * sets given value to an argument +     * sets given value to an argument
66     * +     *
67     * @param $arg          the name of the option to be changed +     * @param $arg          the name of the option to be changed
68     * @param $value        the value of the option +     * @param $value        the value of the option
69     * @return Doctrine_Validator_Driver    this object +     * @return Doctrine_Validator_Driver    this object
70     */ +     */
71    public function __set($arg, $value) +    public function __set($arg, $value)
72    { +    {
73        $this->_args[$arg] = $value; +        $this->_args[$arg] = $value;
74         +        
75        return $this; +        return $this;
76    } +    }
77 +
78    /** +    /**
79     * returns the value of an argument +     * returns the value of an argument
80     * +     *
81     * @param $arg          the name of the option to retrieve +     * @param $arg          the name of the option to retrieve
82     * @return mixed        the value of the option +     * @return mixed        the value of the option
83     */ +     */
84    public function getArg($arg) +    public function getArg($arg)
85    { +    {
86        if ( ! isset($this->_args[$arg])) { +        if ( ! isset($this->_args[$arg])) {
87            throw new Doctrine_Plugin_Exception('Unknown option ' . $arg); +            throw new Doctrine_Plugin_Exception('Unknown option ' . $arg);
88        } +        }
89         +        
90        return $this->_args[$arg]; +        return $this->_args[$arg];
91    } +    }
92 +
93    /** +    /**
94     * sets given value to an argument +     * sets given value to an argument
95     * +     *
96     * @param $arg          the name of the option to be changed +     * @param $arg          the name of the option to be changed
97     * @param $value        the value of the option +     * @param $value        the value of the option
98     * @return Doctrine_Validator_Driver    this object +     * @return Doctrine_Validator_Driver    this object
99     */ +     */
100    public function setArg($arg, $value) +    public function setArg($arg, $value)
101    { +    {
102        $this->_args[$arg] = $value; +        $this->_args[$arg] = $value;
103         +        
104        return $this; +        return $this;
105    } +    }
106 +
107    /** +    /**
108     * returns all args and their associated values +     * returns all args and their associated values
109     * +     *
110     * @return array    all args as an associative array +     * @return array    all args as an associative array
111     */ +     */
112    public function getArgs() +    public function getArgs()
113    { +    {
114        return $this->_args; +        return $this->_args;
115    } +    }
116 }
 * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -91,7 +91,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Validator_ErrorStack.html b/tests_old/coverage/Doctrine_Validator_ErrorStack.html index 154dc2d9a..dc8353776 100644 --- a/tests_old/coverage/Doctrine_Validator_ErrorStack.html +++ b/tests_old/coverage/Doctrine_Validator_ErrorStack.html @@ -10,450 +10,450 @@

Coverage for Doctrine_Validator_ErrorStack

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1<?php +<?php
2/* +/*
3 *  $Id: ErrorStack.php 3157 2007-11-14 21:06:30Z zYne $ + *  $Id: ErrorStack.php 3157 2007-11-14 21:06:30Z zYne $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Validator_ErrorStack + * Doctrine_Validator_ErrorStack
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Validator + * @subpackage  Validator
27 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
28 * @author      Roman Borschel <roman@code-factory.org> + * @author      Roman Borschel <roman@code-factory.org>
29 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
30 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
31 * @since       1.0 + * @since       1.0
32 * @version     $Revision: 3157 $ + * @version     $Revision: 3157 $
33 */ + */
34class Doctrine_Validator_ErrorStack extends Doctrine_Access implements Countable, IteratorAggregate +class Doctrine_Validator_ErrorStack extends Doctrine_Access implements Countable, IteratorAggregate
35{ +{
36 +
37    /** +    /**
38     * The errors of the error stack. +     * The errors of the error stack.
39     * +     *
40     * @var array +     * @var array
41     */ +     */
42    protected $errors = array(); +    protected $errors = array();
43 +
44    protected $classname = ""; +    protected $classname = "";
45 +
46    /** +    /**
47     * Constructor +     * Constructor
48     * +     *
49     */ +     */
50    public function __construct($classname = "") +    public function __construct($classname = "")
51    { +    {
52        $this->classname = $classname; +        $this->classname = $classname;
53    } +    }
54 +
55    /** +    /**
56     * Adds an error to the stack. +     * Adds an error to the stack.
57     * +     *
58     * @param string $invalidFieldName +     * @param string $invalidFieldName
59     * @param string $errorType +     * @param string $errorType
60     */ +     */
61    public function add($invalidFieldName, $errorCode = 'general') +    public function add($invalidFieldName, $errorCode = 'general')
62    { +    {
63        $this->errors[$invalidFieldName][] = $errorCode; +        $this->errors[$invalidFieldName][] = $errorCode;
64    } +    }
65 +
66    /** +    /**
67     * Removes all existing errors for the specified field from the stack. +     * Removes all existing errors for the specified field from the stack.
68     * +     *
69     * @param string $fieldName +     * @param string $fieldName
70     */ +     */
71    public function remove($fieldName) +    public function remove($fieldName)
72    { +    {
73        if (isset($this->errors[$fieldName])) { +        if (isset($this->errors[$fieldName])) {
74            unset($this->errors[$fieldName]); +            unset($this->errors[$fieldName]);
75        } +        }
76    } +    }
77 +
78    /** +    /**
79     * Enter description here... +     * Enter description here...
80     * +     *
81     * @param unknown_type $name +     * @param unknown_type $name
82     * @return unknown +     * @return unknown
83     */ +     */
84    public function get($fieldName) +    public function get($fieldName)
85    { +    {
86        return isset($this->errors[$fieldName]) ? $this->errors[$fieldName] : null; +        return isset($this->errors[$fieldName]) ? $this->errors[$fieldName] : null;
87    } +    }
88 +
89    /** +    /**
90     * Enter description here... +     * Enter description here...
91     * +     *
92     * @param unknown_type $name +     * @param unknown_type $name
93     */ +     */
94    public function set($fieldName, $errorCode) +    public function set($fieldName, $errorCode)
95    { +    {
96        $this->add($fieldName, $errorCode); +        $this->add($fieldName, $errorCode);
97    } +    }
98 +
99    /** +    /**
100     * Enter description here... +     * Enter description here...
101     * +     *
102     * @return unknown +     * @return unknown
103     */ +     */
104    public function contains($fieldName) +    public function contains($fieldName)
105    { +    {
106        return array_key_exists($fieldName, $this->errors); +        return array_key_exists($fieldName, $this->errors);
107    } +    }
108 +
109    /** +    /**
110     * Removes all errors from the stack. +     * Removes all errors from the stack.
111     */ +     */
112    public function clear() +    public function clear()
113    { +    {
114        $this->errors = array(); +        $this->errors = array();
115    } +    }
116 +
117    /** +    /**
118     * Enter description here... +     * Enter description here...
119     * +     *
120     * @return unknown +     * @return unknown
121     */ +     */
122    public function getIterator() +    public function getIterator()
123    { +    {
124        return new ArrayIterator($this->errors); +        return new ArrayIterator($this->errors);
125    } +    }
126 +
127    public function toArray() +    public function toArray()
128    { +    {
129        return $this->errors; +        return $this->errors;
130    } +    }
131 +
132    /** +    /**
133     * Enter description here... +     * Enter description here...
134     * +     *
135     * @return unknown +     * @return unknown
136     */ +     */
137    public function count() +    public function count()
138    { +    {
139        return count($this->errors); +        return count($this->errors);
140    } +    }
141 +
142    /** +    /**
143     * Get the classname where the errors occured +     * Get the classname where the errors occured
144     * +     *
145     */ +     */
146    public function getClassname(){ +    public function getClassname(){
147        return $this->classname; +        return $this->classname;
148    } +    }
149} +}
\ No newline at end of file diff --git a/tests_old/coverage/Doctrine_Validator_Exception.html b/tests_old/coverage/Doctrine_Validator_Exception.html index bab22738a..dd83889c8 100644 --- a/tests_old/coverage/Doctrine_Validator_Exception.html +++ b/tests_old/coverage/Doctrine_Validator_Exception.html @@ -10,301 +10,301 @@

Coverage for Doctrine_Validator_Exception

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Validator_Future.html b/tests_old/coverage/Doctrine_Validator_Future.html index a1b90a0e7..a77a2af0a 100644 --- a/tests_old/coverage/Doctrine_Validator_Future.html +++ b/tests_old/coverage/Doctrine_Validator_Future.html @@ -64,7 +64,7 @@ - -
1<?php +<?php
2/* +/*
3 *  $Id: Exception.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Exception.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21Doctrine::autoload('Doctrine_Exception'); +Doctrine::autoload('Doctrine_Exception');
22/** +/**
23 * Doctrine_Validator_Exception + * Doctrine_Validator_Exception
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Validator + * @subpackage  Validator
27 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
28 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
30 * @since       1.0 + * @since       1.0
31 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
32 */ + */
33class Doctrine_Validator_Exception extends Doctrine_Exception implements Countable, IteratorAggregate +class Doctrine_Validator_Exception extends Doctrine_Exception implements Countable, IteratorAggregate
34{ +{
35    /** +    /**
36     * @var array $invalid +     * @var array $invalid
37     */ +     */
38    private $invalid = array(); +    private $invalid = array();
39 +
40    /** +    /**
41     * @param Doctrine_Validator $validator +     * @param Doctrine_Validator $validator
42     */ +     */
43    public function __construct(array $invalid) +    public function __construct(array $invalid)
44    { +    {
45        $this->invalid = $invalid; +        $this->invalid = $invalid;
46        parent::__construct($this->generateMessage()); +        parent::__construct($this->generateMessage());
47    } +    }
48 +
49    public function getInvalidRecords() +    public function getInvalidRecords()
50    { +    {
51        return $this->invalid; +        return $this->invalid;
52    } +    }
53 +
54    public function getIterator() +    public function getIterator()
55    { +    {
56        return new ArrayIterator($this->invalid); +        return new ArrayIterator($this->invalid);
57    } +    }
58 +
59    public function count() +    public function count()
60    { +    {
61        return count($this->invalid); +        return count($this->invalid);
62    } +    }
63 +
64    /** +    /**
65     * __toString +     * __toString
66     * +     *
67     * @return string +     * @return string
68     */ +     */
69    public function __toString() +    public function __toString()
70    { +    {
71 +
72        return parent::__toString(); +        return parent::__toString();
73    } +    }
74 +
75    /** +    /**
76     * Generate a message with all classes that have exceptions +     * Generate a message with all classes that have exceptions
77     */ +     */
78    private function generateMessage() +    private function generateMessage()
79    { +    {
80        $message = ""; +        $message = "";
81        foreach ($this->invalid as $record) { +        foreach ($this->invalid as $record) {
82           $message .= "Validaton error in class " . get_class($record) . " "; +           $message .= "Validaton error in class " . get_class($record) . " ";
83        } +        }
84        return $message; +        return $message;
85    } +    }
86 +
87    /** +    /**
88     * This method will apply the value of the $function variable as a user_func  +     * This method will apply the value of the $function variable as a user_func 
89     * to tall errorstack objects in the exception +     * to tall errorstack objects in the exception
90     * +     *
91     * @param mixed Either string with function name or array with object,  +     * @param mixed Either string with function name or array with object, 
92     * functionname. See call_user_func in php manual for more inforamtion +     * functionname. See call_user_func in php manual for more inforamtion
93     */ +     */
94    public function inspect($function) +    public function inspect($function)
95    { +    {
96        foreach ($this->invalid as $record) { +        foreach ($this->invalid as $record) {
97            call_user_func($function, $record->getErrorStack()); +            call_user_func($function, $record->getErrorStack());
98        } +        }
99    } +    }
100 }
 * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -91,7 +91,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Validator_Notblank.html b/tests_old/coverage/Doctrine_Validator_Notblank.html index 84fafd896..62e5e6c77 100644 --- a/tests_old/coverage/Doctrine_Validator_Notblank.html +++ b/tests_old/coverage/Doctrine_Validator_Notblank.html @@ -10,139 +10,139 @@

Coverage for Doctrine_Validator_Notblank

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Validator_Notnull.html b/tests_old/coverage/Doctrine_Validator_Notnull.html index 24e5b3caa..b1eadb13a 100644 --- a/tests_old/coverage/Doctrine_Validator_Notnull.html +++ b/tests_old/coverage/Doctrine_Validator_Notnull.html @@ -10,136 +10,136 @@

Coverage for Doctrine_Validator_Notnull

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Notblank.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $ + *  $Id: Notblank.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Validator_Notblank + * Doctrine_Validator_Notblank
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Validator + * @subpackage  Validator
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 2702 $ + * @version     $Revision: 2702 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Validator_Notblank extends Doctrine_Validator_Driver +class Doctrine_Validator_Notblank extends Doctrine_Validator_Driver
34{ +{
35    /** +    /**
36     * checks that value isn't blank +     * checks that value isn't blank
37     * a value is blank when its either null or contains only space characters +     * a value is blank when its either null or contains only space characters
38     * +     *
39     * @param mixed $value +     * @param mixed $value
40     * @return boolean +     * @return boolean
41     */ +     */
42    public function validate($value) +    public function validate($value)
43    { +    {
44        return (trim($value) !== '' && $value !== null); +        return (trim($value) !== '' && $value !== null);
45    } +    }
46 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Validator_Past.html b/tests_old/coverage/Doctrine_Validator_Past.html index 4f89472a0..87ffa4de0 100644 --- a/tests_old/coverage/Doctrine_Validator_Past.html +++ b/tests_old/coverage/Doctrine_Validator_Past.html @@ -64,7 +64,7 @@ - -
1<?php +<?php
2/* +/*
3 *  $Id: Notnull.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $ + *  $Id: Notnull.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Validator_Notnull + * Doctrine_Validator_Notnull
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Validator + * @subpackage  Validator
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 2702 $ + * @version     $Revision: 2702 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Validator_Notnull extends Doctrine_Validator_Driver +class Doctrine_Validator_Notnull extends Doctrine_Validator_Driver
34{ +{
35    /** +    /**
36     * checks that given value isn't null +     * checks that given value isn't null
37     * +     *
38     * @param mixed $value +     * @param mixed $value
39     * @return boolean +     * @return boolean
40     */ +     */
41    public function validate($value) +    public function validate($value)
42    { +    {
43        return ($value !== null); +        return ($value !== null);
44    } +    }
45 }
 * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -91,7 +91,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Validator_Range.html b/tests_old/coverage/Doctrine_Validator_Range.html index 11cce7270..132919aae 100644 --- a/tests_old/coverage/Doctrine_Validator_Range.html +++ b/tests_old/coverage/Doctrine_Validator_Range.html @@ -10,154 +10,154 @@

Coverage for Doctrine_Validator_Range

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Validator_Regexp.html b/tests_old/coverage/Doctrine_Validator_Regexp.html index 0ebfdc0c1..65595d4f8 100644 --- a/tests_old/coverage/Doctrine_Validator_Regexp.html +++ b/tests_old/coverage/Doctrine_Validator_Regexp.html @@ -10,187 +10,187 @@

Coverage for Doctrine_Validator_Regexp

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Range.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $ + *  $Id: Range.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Validator_Range + * Doctrine_Validator_Range
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Validator + * @subpackage  Validator
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 2702 $ + * @version     $Revision: 2702 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Validator_Range +class Doctrine_Validator_Range
34{ +{
35    /** +    /**
36     * checks if value is within given range +     * checks if value is within given range
37     * +     *
38     * @param mixed $value +     * @param mixed $value
39     * @return boolean +     * @return boolean
40     */ +     */
41    public function validate($value) +    public function validate($value)
42    { +    {
43        if (isset($this->args[0]) && $value < $this->args[0]) { +        if (isset($this->args[0]) && $value < $this->args[0]) {
44            return false; +            return false;
45        } +        }
46        if (isset($this->args[1]) && $value > $this->args[1]) { +        if (isset($this->args[1]) && $value > $this->args[1]) {
47            return false; +            return false;
48        } +        }
49        return true; +        return true;
50    } +    }
51 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Validator_Unique.html b/tests_old/coverage/Doctrine_Validator_Unique.html index 5067b8e6d..2f74e9095 100644 --- a/tests_old/coverage/Doctrine_Validator_Unique.html +++ b/tests_old/coverage/Doctrine_Validator_Unique.html @@ -64,7 +64,7 @@ - -
1<?php +<?php
2/* +/*
3 *  $Id: Regexp.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $ + *  $Id: Regexp.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Validator_Regexp + * Doctrine_Validator_Regexp
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Validator + * @subpackage  Validator
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 2702 $ + * @version     $Revision: 2702 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Validator_Regexp +class Doctrine_Validator_Regexp
34{ +{
35    /** +    /**
36     * checks if given value satisfies a regular expression +     * checks if given value satisfies a regular expression
37     * +     *
38     * @param mixed $value +     * @param mixed $value
39     * @param mixed $args +     * @param mixed $args
40     * @return boolean +     * @return boolean
41     */ +     */
42    public function validate($value) +    public function validate($value)
43    { +    {
44        if ( ! isset($this->args)) { +        if ( ! isset($this->args)) {
45           return true; +           return true;
46        } +        }
47        if (is_array($this->args)) { +        if (is_array($this->args)) {
48            foreach ($this->args as $regexp) { +            foreach ($this->args as $regexp) {
49                if ( ! preg_match($regexp, $value)) { +                if ( ! preg_match($regexp, $value)) {
50                    return false; +                    return false;
51                } +                }
52            } +            }
53            return true; +            return true;
54        } else { +        } else {
55            if (preg_match($this->args, $value)) { +            if (preg_match($this->args, $value)) {
56                return true; +                return true;
57            } +            }
58        } +        }
59 +
60        return false; +        return false;
61    } +    }
62 }
 * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20  */ @@ -91,7 +91,7 @@  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29  * @since       1.0 diff --git a/tests_old/coverage/Doctrine_Validator_Unsigned.html b/tests_old/coverage/Doctrine_Validator_Unsigned.html index 3adacd1d5..9a33a0821 100644 --- a/tests_old/coverage/Doctrine_Validator_Unsigned.html +++ b/tests_old/coverage/Doctrine_Validator_Unsigned.html @@ -10,151 +10,151 @@

Coverage for Doctrine_Validator_Unsigned

Back to coverage report

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_Validator_Usstate.html b/tests_old/coverage/Doctrine_Validator_Usstate.html index 042fef618..4c7d2f05e 100644 --- a/tests_old/coverage/Doctrine_Validator_Usstate.html +++ b/tests_old/coverage/Doctrine_Validator_Usstate.html @@ -10,316 +10,316 @@

Coverage for Doctrine_Validator_Usstate

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Enum.php 1080 2007-02-10 18:17:08Z romanb $ + *  $Id: Enum.php 1080 2007-02-10 18:17:08Z romanb $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Validator_Unsigned + * Doctrine_Validator_Unsigned
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Validator + * @subpackage  Validator
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 1080 $ + * @version     $Revision: 1080 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Validator_Unsigned +class Doctrine_Validator_Unsigned
34{ +{
35    /** +    /**
36     * checks if given value is a valid unsigned integer +     * checks if given value is a valid unsigned integer
37     * +     *
38     * @param mixed $value +     * @param mixed $value
39     * @return boolean +     * @return boolean
40     */ +     */
41    public function validate($value) +    public function validate($value)
42    { +    {
43        $int = (int) $value; +        $int = (int) $value;
44 +
45        if ($int != $value || $int < 0) { +        if ($int != $value || $int < 0) {
46            return false; +            return false;
47        } +        }
48        return true; +        return true;
49    } +    }
50 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/Doctrine_View.html b/tests_old/coverage/Doctrine_View.html index dff7c9dad..d11bcd3f9 100644 --- a/tests_old/coverage/Doctrine_View.html +++ b/tests_old/coverage/Doctrine_View.html @@ -10,505 +10,505 @@

Coverage for Doctrine_View

Back to coverage report

1<?php +<?php
2/* +/*
3 *  $Id: Usstate.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: Usstate.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_Validator_Usstate + * Doctrine_Validator_Usstate
24 * + *
25 * @package     Doctrine + * @package     Doctrine
26 * @subpackage  Validator + * @subpackage  Validator
27 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
29 * @since       1.0 + * @since       1.0
30 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
31 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32 */ + */
33class Doctrine_Validator_Usstate +class Doctrine_Validator_Usstate
34{ +{
35    private static $states = array( +    private static $states = array(
36                'AK' => true, +                'AK' => true,
37                'AL' => true, +                'AL' => true,
38                'AR' => true, +                'AR' => true,
39                'AZ' => true, +                'AZ' => true,
40                'CA' => true, +                'CA' => true,
41                'CO' => true, +                'CO' => true,
42                'CT' => true, +                'CT' => true,
43                'DC' => true, +                'DC' => true,
44                'DE' => true, +                'DE' => true,
45                'FL' => true, +                'FL' => true,
46                'GA' => true, +                'GA' => true,
47                'HI' => true, +                'HI' => true,
48                'IA' => true, +                'IA' => true,
49                'ID' => true, +                'ID' => true,
50                'IL' => true, +                'IL' => true,
51                'IN' => true, +                'IN' => true,
52                'KS' => true, +                'KS' => true,
53                'KY' => true, +                'KY' => true,
54                'LA' => true, +                'LA' => true,
55                'MA' => true, +                'MA' => true,
56                'MD' => true, +                'MD' => true,
57                'ME' => true, +                'ME' => true,
58                'MI' => true, +                'MI' => true,
59                'MN' => true, +                'MN' => true,
60                'MO' => true, +                'MO' => true,
61                'MS' => true, +                'MS' => true,
62                'MT' => true, +                'MT' => true,
63                'NC' => true, +                'NC' => true,
64                'ND' => true, +                'ND' => true,
65                'NE' => true, +                'NE' => true,
66                'NH' => true, +                'NH' => true,
67                'NJ' => true, +                'NJ' => true,
68                'NM' => true, +                'NM' => true,
69                'NV' => true, +                'NV' => true,
70                'NY' => true, +                'NY' => true,
71                'OH' => true, +                'OH' => true,
72                'OK' => true, +                'OK' => true,
73                'OR' => true, +                'OR' => true,
74                'PA' => true, +                'PA' => true,
75                'PR' => true, +                'PR' => true,
76                'RI' => true, +                'RI' => true,
77                'SC' => true, +                'SC' => true,
78                'SD' => true, +                'SD' => true,
79                'TN' => true, +                'TN' => true,
80                'TX' => true, +                'TX' => true,
81                'UT' => true, +                'UT' => true,
82                'VA' => true, +                'VA' => true,
83                'VI' => true, +                'VI' => true,
84                'VT' => true, +                'VT' => true,
85                'WA' => true, +                'WA' => true,
86                'WI' => true, +                'WI' => true,
87                'WV' => true, +                'WV' => true,
88                'WY' => true +                'WY' => true
89            ); +            );
90    public function getStates() +    public function getStates()
91    { +    {
92        return self::$states; +        return self::$states;
93    } +    }
94 +
95    /** +    /**
96     * checks if given value is a valid US state code +     * checks if given value is a valid US state code
97     * +     *
98     * @param string $args +     * @param string $args
99     * @return boolean +     * @return boolean
100     */ +     */
101    public function validate($value) +    public function validate($value)
102    { +    {
103        return isset(self::$states[$value]); +        return isset(self::$states[$value]);
104    } +    }
105 }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests_old/coverage/index.php b/tests_old/coverage/index.php index 18a91ccb4..f565c80f1 100644 --- a/tests_old/coverage/index.php +++ b/tests_old/coverage/index.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ require_once dirname(__FILE__) . '/../../lib/Doctrine.php'; diff --git a/tests_old/template.tpl b/tests_old/template.tpl index 790c0e123..8eda37e69 100644 --- a/tests_old/template.tpl +++ b/tests_old/template.tpl @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -26,7 +26,7 @@ * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ diff --git a/tools/sandbox/config.php b/tools/sandbox/config.php index 8b22fc5af..3fe811275 100644 --- a/tools/sandbox/config.php +++ b/tools/sandbox/config.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /** @@ -27,7 +27,7 @@ * @package Doctrine * @subpackage Config * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.com + * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 2753 $ * @author Konsta Vesterinen diff --git a/vendor/Sensei/Sensei.php b/vendor/Sensei/Sensei.php index 8f472a043..6b7ecbab6 100644 --- a/vendor/Sensei/Sensei.php +++ b/vendor/Sensei/Sensei.php @@ -16,7 +16,7 @@ * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see - * . + * . */ /**
1<?php +<?php
2/* +/*
3 *  $Id: View.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $ + *  $Id: View.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
4 * + *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 * + *
17 * This software consists of voluntary contributions made by many individuals + * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information, see + * and is licensed under the LGPL. For more information, see
19 * <http://www.phpdoctrine.com>. + * <http://www.phpdoctrine.org>.
20 */ + */
21 +
22/** +/**
23 * Doctrine_View + * Doctrine_View
24 * + *
25 * this class represents a database view + * this class represents a database view
26 * + *
27 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> + * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
28 * @package     Doctrine + * @package     Doctrine
29 * @subpackage  View + * @subpackage  View
30 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL + * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
31 * @link        www.phpdoctrine.com + * @link        www.phpdoctrine.org
32 * @since       1.0 + * @since       1.0
33 * @version     $Revision: 2963 $ + * @version     $Revision: 2963 $
34 */ + */
35class Doctrine_View +class Doctrine_View
36{ +{
37    /** +    /**
38     * SQL DROP constant +     * SQL DROP constant
39     */ +     */
40    const DROP   = 'DROP VIEW %s'; +    const DROP   = 'DROP VIEW %s';
41 +
42    /** +    /**
43     * SQL CREATE constant +     * SQL CREATE constant
44     */ +     */
45    const CREATE = 'CREATE VIEW %s AS %s'; +    const CREATE = 'CREATE VIEW %s AS %s';
46 +
47    /** +    /**
48     * SQL SELECT constant +     * SQL SELECT constant
49     */ +     */
50    const SELECT = 'SELECT * FROM %s'; +    const SELECT = 'SELECT * FROM %s';
51 +
52    /** +    /**
53     * @var string $name                the name of the view +     * @var string $name                the name of the view
54     */ +     */
55    protected $name; +    protected $name;
56 +
57    /** +    /**
58     * @var Doctrine_Query $query       the DQL query object this view is hooked into +     * @var Doctrine_Query $query       the DQL query object this view is hooked into
59     */ +     */
60    protected $query; +    protected $query;
61 +
62    /** +    /**
63     * @var Doctrine_Connection $conn   the connection object +     * @var Doctrine_Connection $conn   the connection object
64     */ +     */
65    protected $conn; +    protected $conn;
66 +
67    /** +    /**
68     * constructor +     * constructor
69     * +     *
70     * @param Doctrine_Query $query +     * @param Doctrine_Query $query
71     */ +     */
72    public function __construct(Doctrine_Query $query, $viewName) +    public function __construct(Doctrine_Query $query, $viewName)
73    { +    {
74        $this->name  = $viewName; +        $this->name  = $viewName;
75        $this->query = $query; +        $this->query = $query;
76        $this->query->setView($this); +        $this->query->setView($this);
77        $this->conn   = $query->getConnection(); +        $this->conn   = $query->getConnection();
78    } +    }
79 +
80    /** +    /**
81     * getQuery +     * getQuery
82     * returns the associated query object +     * returns the associated query object
83     * +     *
84     * @return Doctrine_Query +     * @return Doctrine_Query
85     */ +     */
86    public function getQuery() +    public function getQuery()
87    { +    {
88        return $this->query; +        return $this->query;
89    } +    }
90 +
91    /** +    /**
92     * getName +     * getName
93     * returns the name of this view +     * returns the name of this view
94     * +     *
95     * @return string +     * @return string
96     */ +     */
97    public function getName() +    public function getName()
98    { +    {
99        return $this->name; +        return $this->name;
100    } +    }
101 +
102    /** +    /**
103     * getConnection +     * getConnection
104     * returns the connection object +     * returns the connection object
105     * +     *
106     * @return Doctrine_Connection +     * @return Doctrine_Connection
107     */ +     */
108    public function getConnection() +    public function getConnection()
109    { +    {
110        return $this->conn; +        return $this->conn;
111    } +    }
112 +
113    /** +    /**
114     * create +     * create
115     * creates this view +     * creates this view
116     * +     *
117     * @throws Doctrine_View_Exception +     * @throws Doctrine_View_Exception
118     * @return void +     * @return void
119     */ +     */
120    public function create() +    public function create()
121    { +    {
122        $sql = sprintf(self::CREATE, $this->name, $this->query->getQuery()); +        $sql = sprintf(self::CREATE, $this->name, $this->query->getQuery());
123        try { +        try {
124            $this->conn->execute($sql); +            $this->conn->execute($sql);
125        } catch(Doctrine_Exception $e) { +        } catch(Doctrine_Exception $e) {
126            throw new Doctrine_View_Exception($e->__toString()); +            throw new Doctrine_View_Exception($e->__toString());
127        } +        }
128    } +    }
129 +
130    /** +    /**
131     * drop +     * drop
132     * drops this view from the database +     * drops this view from the database
133     * +     *
134     * @throws Doctrine_View_Exception +     * @throws Doctrine_View_Exception
135     * @return void +     * @return void
136     */ +     */
137    public function drop() +    public function drop()
138    { +    {
139        try { +        try {
140            $this->conn->execute(sprintf(self::DROP, $this->name)); +            $this->conn->execute(sprintf(self::DROP, $this->name));
141        } catch(Doctrine_Exception $e) { +        } catch(Doctrine_Exception $e) {
142            throw new Doctrine_View_Exception($e->__toString()); +            throw new Doctrine_View_Exception($e->__toString());
143        } +        }
144    } +    }
145 +
146    /** +    /**
147     * execute +     * execute
148     * executes the view +     * executes the view
149     * returns a collection of Doctrine_Record objects +     * returns a collection of Doctrine_Record objects
150     * +     *
151     * @return Doctrine_Collection +     * @return Doctrine_Collection
152     */ +     */
153    public function execute() +    public function execute()
154    { +    {
155        return $this->query->execute(); +        return $this->query->execute();
156    } +    }
157 +
158    /** +    /**
159     * getSelectSql +     * getSelectSql
160     * returns the select sql for this view +     * returns the select sql for this view
161     * +     *
162     * @return string +     * @return string
163     */ +     */
164    public function getSelectSql() +    public function getSelectSql()
165    { +    {
166        return sprintf(self::SELECT, $this->name); +        return sprintf(self::SELECT, $this->name);
167    } +    }
168 }