├── .gitignore ├── Domain ├── Entities │ └── Fish.php ├── Repositories │ └── IFishRepository.php └── Services │ ├── Fisherman.php │ ├── Pond.php │ └── PondStocker.php ├── Infrastructure ├── Persistence │ ├── FishRepository.php │ └── xml │ │ └── Domain.Entities.Fish.dcm.xml ├── Services │ ├── Autoloader.php │ └── Console.php └── Vendors │ └── Doctrine │ ├── Common │ ├── Annotations │ │ ├── Annotation.php │ │ ├── Annotation │ │ │ ├── Attribute.php │ │ │ ├── Attributes.php │ │ │ ├── IgnoreAnnotation.php │ │ │ ├── Required.php │ │ │ └── Target.php │ │ ├── AnnotationException.php │ │ ├── AnnotationReader.php │ │ ├── AnnotationRegistry.php │ │ ├── CachedReader.php │ │ ├── DocLexer.php │ │ ├── DocParser.php │ │ ├── FileCacheReader.php │ │ ├── IndexedReader.php │ │ ├── PhpParser.php │ │ ├── Reader.php │ │ └── SimpleAnnotationReader.php │ ├── Cache │ │ ├── ApcCache.php │ │ ├── ArrayCache.php │ │ ├── Cache.php │ │ ├── CacheProvider.php │ │ ├── MemcacheCache.php │ │ ├── MemcachedCache.php │ │ ├── WinCacheCache.php │ │ ├── XcacheCache.php │ │ └── ZendDataCache.php │ ├── ClassLoader.php │ ├── Collections │ │ ├── ArrayCollection.php │ │ └── Collection.php │ ├── CommonException.php │ ├── Comparable.php │ ├── EventArgs.php │ ├── EventManager.php │ ├── EventSubscriber.php │ ├── Lexer.php │ ├── NotifyPropertyChanged.php │ ├── Persistence │ │ ├── AbstractManagerRegistry.php │ │ ├── ConnectionRegistry.php │ │ ├── Event │ │ │ ├── LifecycleEventArgs.php │ │ │ ├── LoadClassMetadataEventArgs.php │ │ │ ├── ManagerEventArgs.php │ │ │ ├── OnClearEventArgs.php │ │ │ └── PreUpdateEventArgs.php │ │ ├── ManagerRegistry.php │ │ ├── Mapping │ │ │ ├── AbstractClassMetadataFactory.php │ │ │ ├── ClassMetadata.php │ │ │ ├── ClassMetadataFactory.php │ │ │ ├── Driver │ │ │ │ ├── AnnotationDriver.php │ │ │ │ ├── DefaultFileLocator.php │ │ │ │ ├── FileDriver.php │ │ │ │ ├── FileLocator.php │ │ │ │ ├── MappingDriver.php │ │ │ │ ├── MappingDriverChain.php │ │ │ │ ├── PHPDriver.php │ │ │ │ ├── StaticPHPDriver.php │ │ │ │ └── SymfonyFileLocator.php │ │ │ ├── MappingException.php │ │ │ ├── ReflectionService.php │ │ │ ├── RuntimeReflectionService.php │ │ │ └── StaticReflectionService.php │ │ ├── ObjectManager.php │ │ ├── ObjectManagerAware.php │ │ ├── ObjectRepository.php │ │ ├── PersistentObject.php │ │ └── Proxy.php │ ├── PropertyChangedListener.php │ ├── Util │ │ ├── ClassUtils.php │ │ ├── Debug.php │ │ └── Inflector.php │ └── Version.php │ ├── DBAL │ ├── Cache │ │ ├── ArrayStatement.php │ │ ├── CacheException.php │ │ ├── QueryCacheProfile.php │ │ └── ResultCacheStatement.php │ ├── Configuration.php │ ├── Connection.php │ ├── ConnectionException.php │ ├── Connections │ │ └── MasterSlaveConnection.php │ ├── DBALException.php │ ├── Driver.php │ ├── Driver │ │ ├── Connection.php │ │ ├── IBMDB2 │ │ │ ├── DB2Connection.php │ │ │ ├── DB2Driver.php │ │ │ ├── DB2Exception.php │ │ │ └── DB2Statement.php │ │ ├── Mysqli │ │ │ ├── Driver.php │ │ │ ├── MysqliConnection.php │ │ │ ├── MysqliException.php │ │ │ └── MysqliStatement.php │ │ ├── OCI8 │ │ │ ├── Driver.php │ │ │ ├── OCI8Connection.php │ │ │ ├── OCI8Exception.php │ │ │ └── OCI8Statement.php │ │ ├── PDOConnection.php │ │ ├── PDOIbm │ │ │ └── Driver.php │ │ ├── PDOMySql │ │ │ └── Driver.php │ │ ├── PDOOracle │ │ │ └── Driver.php │ │ ├── PDOPgSql │ │ │ └── Driver.php │ │ ├── PDOSqlite │ │ │ └── Driver.php │ │ ├── PDOSqlsrv │ │ │ ├── Connection.php │ │ │ └── Driver.php │ │ ├── PDOStatement.php │ │ ├── ResultStatement.php │ │ └── Statement.php │ ├── DriverManager.php │ ├── Event │ │ ├── ConnectionEventArgs.php │ │ ├── Listeners │ │ │ ├── MysqlSessionInit.php │ │ │ ├── OracleSessionInit.php │ │ │ └── SQLSessionInit.php │ │ ├── SchemaAlterTableAddColumnEventArgs.php │ │ ├── SchemaAlterTableChangeColumnEventArgs.php │ │ ├── SchemaAlterTableEventArgs.php │ │ ├── SchemaAlterTableRemoveColumnEventArgs.php │ │ ├── SchemaAlterTableRenameColumnEventArgs.php │ │ ├── SchemaColumnDefinitionEventArgs.php │ │ ├── SchemaCreateTableColumnEventArgs.php │ │ ├── SchemaCreateTableEventArgs.php │ │ ├── SchemaDropTableEventArgs.php │ │ ├── SchemaEventArgs.php │ │ └── SchemaIndexDefinitionEventArgs.php │ ├── Events.php │ ├── LockMode.php │ ├── Logging │ │ ├── DebugStack.php │ │ ├── EchoSQLLogger.php │ │ ├── LoggerChain.php │ │ └── SQLLogger.php │ ├── Platforms │ │ ├── AbstractPlatform.php │ │ ├── DB2Platform.php │ │ ├── Keywords │ │ │ ├── DB2Keywords.php │ │ │ ├── KeywordList.php │ │ │ ├── MsSQLKeywords.php │ │ │ ├── MySQLKeywords.php │ │ │ ├── OracleKeywords.php │ │ │ ├── PostgreSQLKeywords.php │ │ │ ├── ReservedKeywordsValidator.php │ │ │ └── SQLiteKeywords.php │ │ ├── MySqlPlatform.php │ │ ├── OraclePlatform.php │ │ ├── PostgreSqlPlatform.php │ │ ├── SQLServer2005Platform.php │ │ ├── SQLServer2008Platform.php │ │ ├── SQLServerPlatform.php │ │ └── SqlitePlatform.php │ ├── Portability │ │ ├── Connection.php │ │ └── Statement.php │ ├── Query │ │ ├── Expression │ │ │ ├── CompositeExpression.php │ │ │ └── ExpressionBuilder.php │ │ ├── QueryBuilder.php │ │ └── QueryException.php │ ├── SQLParserUtils.php │ ├── Schema │ │ ├── AbstractAsset.php │ │ ├── AbstractSchemaManager.php │ │ ├── Column.php │ │ ├── ColumnDiff.php │ │ ├── Comparator.php │ │ ├── Constraint.php │ │ ├── DB2SchemaManager.php │ │ ├── ForeignKeyConstraint.php │ │ ├── Index.php │ │ ├── MySqlSchemaManager.php │ │ ├── OracleSchemaManager.php │ │ ├── PostgreSqlSchemaManager.php │ │ ├── SQLServerSchemaManager.php │ │ ├── Schema.php │ │ ├── SchemaConfig.php │ │ ├── SchemaDiff.php │ │ ├── SchemaException.php │ │ ├── Sequence.php │ │ ├── SqliteSchemaManager.php │ │ ├── Table.php │ │ ├── TableDiff.php │ │ ├── View.php │ │ └── Visitor │ │ │ ├── CreateSchemaSqlCollector.php │ │ │ ├── DropSchemaSqlCollector.php │ │ │ ├── Graphviz.php │ │ │ ├── RemoveNamespacedAssets.php │ │ │ └── Visitor.php │ ├── Statement.php │ ├── Tools │ │ └── Console │ │ │ ├── Command │ │ │ ├── ImportCommand.php │ │ │ ├── ReservedWordsCommand.php │ │ │ └── RunSqlCommand.php │ │ │ └── Helper │ │ │ └── ConnectionHelper.php │ ├── Types │ │ ├── ArrayType.php │ │ ├── BigIntType.php │ │ ├── BlobType.php │ │ ├── BooleanType.php │ │ ├── ConversionException.php │ │ ├── DateTimeType.php │ │ ├── DateTimeTzType.php │ │ ├── DateType.php │ │ ├── DecimalType.php │ │ ├── FloatType.php │ │ ├── IntegerType.php │ │ ├── ObjectType.php │ │ ├── SmallIntType.php │ │ ├── StringType.php │ │ ├── TextType.php │ │ ├── TimeType.php │ │ ├── Type.php │ │ └── VarDateTimeType.php │ └── Version.php │ └── ORM │ ├── AbstractQuery.php │ ├── Configuration.php │ ├── EntityManager.php │ ├── EntityNotFoundException.php │ ├── EntityRepository.php │ ├── Event │ ├── LifecycleEventArgs.php │ ├── LoadClassMetadataEventArgs.php │ ├── OnClearEventArgs.php │ ├── OnFlushEventArgs.php │ ├── PostFlushEventArgs.php │ ├── PreFlushEventArgs.php │ └── PreUpdateEventArgs.php │ ├── Events.php │ ├── Id │ ├── AbstractIdGenerator.php │ ├── AssignedGenerator.php │ ├── IdentityGenerator.php │ ├── SequenceGenerator.php │ └── TableGenerator.php │ ├── Internal │ ├── CommitOrderCalculator.php │ └── Hydration │ │ ├── AbstractHydrator.php │ │ ├── ArrayHydrator.php │ │ ├── HydrationException.php │ │ ├── IterableResult.php │ │ ├── ObjectHydrator.php │ │ ├── ScalarHydrator.php │ │ ├── SimpleObjectHydrator.php │ │ └── SingleScalarHydrator.php │ ├── Mapping │ ├── Annotation.php │ ├── Builder │ │ ├── AssociationBuilder.php │ │ ├── ClassMetadataBuilder.php │ │ ├── FieldBuilder.php │ │ ├── ManyToManyAssociationBuilder.php │ │ └── OneToManyAssociationBuilder.php │ ├── ChangeTrackingPolicy.php │ ├── ClassMetadata.php │ ├── ClassMetadataFactory.php │ ├── ClassMetadataInfo.php │ ├── Column.php │ ├── DiscriminatorColumn.php │ ├── DiscriminatorMap.php │ ├── Driver │ │ ├── AbstractFileDriver.php │ │ ├── AnnotationDriver.php │ │ ├── DatabaseDriver.php │ │ ├── DoctrineAnnotations.php │ │ ├── Driver.php │ │ ├── DriverChain.php │ │ ├── PHPDriver.php │ │ ├── SimplifiedXmlDriver.php │ │ ├── SimplifiedYamlDriver.php │ │ ├── StaticPHPDriver.php │ │ ├── XmlDriver.php │ │ └── YamlDriver.php │ ├── ElementCollection.php │ ├── Entity.php │ ├── GeneratedValue.php │ ├── HasLifecycleCallbacks.php │ ├── Id.php │ ├── Index.php │ ├── InheritanceType.php │ ├── JoinColumn.php │ ├── JoinColumns.php │ ├── JoinTable.php │ ├── ManyToMany.php │ ├── ManyToOne.php │ ├── MappedSuperclass.php │ ├── MappingException.php │ ├── NamedQueries.php │ ├── NamedQuery.php │ ├── OneToMany.php │ ├── OneToOne.php │ ├── OrderBy.php │ ├── PostLoad.php │ ├── PostPersist.php │ ├── PostRemove.php │ ├── PostUpdate.php │ ├── PreFlush.php │ ├── PrePersist.php │ ├── PreRemove.php │ ├── PreUpdate.php │ ├── SequenceGenerator.php │ ├── Table.php │ ├── UniqueConstraint.php │ └── Version.php │ ├── NativeQuery.php │ ├── NoResultException.php │ ├── NonUniqueResultException.php │ ├── ORMException.php │ ├── ORMInvalidArgumentException.php │ ├── OptimisticLockException.php │ ├── PersistentCollection.php │ ├── Persisters │ ├── AbstractCollectionPersister.php │ ├── AbstractEntityInheritancePersister.php │ ├── BasicEntityPersister.php │ ├── ElementCollectionPersister.php │ ├── JoinedSubclassPersister.php │ ├── ManyToManyPersister.php │ ├── OneToManyPersister.php │ ├── SingleTablePersister.php │ └── UnionSubclassPersister.php │ ├── PessimisticLockException.php │ ├── Proxy │ ├── Autoloader.php │ ├── Proxy.php │ ├── ProxyException.php │ └── ProxyFactory.php │ ├── Query.php │ ├── Query │ ├── AST │ │ ├── ASTException.php │ │ ├── AggregateExpression.php │ │ ├── ArithmeticExpression.php │ │ ├── ArithmeticFactor.php │ │ ├── ArithmeticTerm.php │ │ ├── BetweenExpression.php │ │ ├── CoalesceExpression.php │ │ ├── CollectionMemberExpression.php │ │ ├── ComparisonExpression.php │ │ ├── ConditionalExpression.php │ │ ├── ConditionalFactor.php │ │ ├── ConditionalPrimary.php │ │ ├── ConditionalTerm.php │ │ ├── DeleteClause.php │ │ ├── DeleteStatement.php │ │ ├── EmptyCollectionComparisonExpression.php │ │ ├── ExistsExpression.php │ │ ├── FromClause.php │ │ ├── Functions │ │ │ ├── AbsFunction.php │ │ │ ├── BitAndFunction.php │ │ │ ├── BitOrFunction.php │ │ │ ├── ConcatFunction.php │ │ │ ├── CurrentDateFunction.php │ │ │ ├── CurrentTimeFunction.php │ │ │ ├── CurrentTimestampFunction.php │ │ │ ├── DateAddFunction.php │ │ │ ├── DateDiffFunction.php │ │ │ ├── DateSubFunction.php │ │ │ ├── FunctionNode.php │ │ │ ├── IdentityFunction.php │ │ │ ├── LengthFunction.php │ │ │ ├── LocateFunction.php │ │ │ ├── LowerFunction.php │ │ │ ├── ModFunction.php │ │ │ ├── SizeFunction.php │ │ │ ├── SqrtFunction.php │ │ │ ├── SubstringFunction.php │ │ │ ├── TrimFunction.php │ │ │ └── UpperFunction.php │ │ ├── GeneralCaseExpression.php │ │ ├── GroupByClause.php │ │ ├── HavingClause.php │ │ ├── IdentificationVariableDeclaration.php │ │ ├── InExpression.php │ │ ├── IndexBy.php │ │ ├── InputParameter.php │ │ ├── InstanceOfExpression.php │ │ ├── Join.php │ │ ├── JoinAssociationPathExpression.php │ │ ├── JoinVariableDeclaration.php │ │ ├── LikeExpression.php │ │ ├── Literal.php │ │ ├── Node.php │ │ ├── NullComparisonExpression.php │ │ ├── NullIfExpression.php │ │ ├── OrderByClause.php │ │ ├── OrderByItem.php │ │ ├── PartialObjectExpression.php │ │ ├── PathExpression.php │ │ ├── QuantifiedExpression.php │ │ ├── RangeVariableDeclaration.php │ │ ├── SelectClause.php │ │ ├── SelectExpression.php │ │ ├── SelectStatement.php │ │ ├── SimpleArithmeticExpression.php │ │ ├── SimpleCaseExpression.php │ │ ├── SimpleSelectClause.php │ │ ├── SimpleSelectExpression.php │ │ ├── SimpleWhenClause.php │ │ ├── Subselect.php │ │ ├── SubselectFromClause.php │ │ ├── UpdateClause.php │ │ ├── UpdateItem.php │ │ ├── UpdateStatement.php │ │ ├── WhenClause.php │ │ └── WhereClause.php │ ├── Exec │ │ ├── AbstractSqlExecutor.php │ │ ├── MultiTableDeleteExecutor.php │ │ ├── MultiTableUpdateExecutor.php │ │ ├── SingleSelectExecutor.php │ │ └── SingleTableDeleteUpdateExecutor.php │ ├── Expr.php │ ├── Expr │ │ ├── Andx.php │ │ ├── Base.php │ │ ├── Comparison.php │ │ ├── Composite.php │ │ ├── From.php │ │ ├── Func.php │ │ ├── GroupBy.php │ │ ├── Join.php │ │ ├── Literal.php │ │ ├── Math.php │ │ ├── OrderBy.php │ │ ├── Orx.php │ │ └── Select.php │ ├── Filter │ │ └── SQLFilter.php │ ├── FilterCollection.php │ ├── Lexer.php │ ├── ParameterTypeInferer.php │ ├── Parser.php │ ├── ParserResult.php │ ├── Printer.php │ ├── QueryException.php │ ├── ResultSetMapping.php │ ├── ResultSetMappingBuilder.php │ ├── SqlWalker.php │ ├── TreeWalker.php │ ├── TreeWalkerAdapter.php │ └── TreeWalkerChain.php │ ├── QueryBuilder.php │ ├── Tools │ ├── Console │ │ ├── Command │ │ │ ├── ClearCache │ │ │ │ ├── MetadataCommand.php │ │ │ │ ├── QueryCommand.php │ │ │ │ └── ResultCommand.php │ │ │ ├── ConvertDoctrine1SchemaCommand.php │ │ │ ├── ConvertMappingCommand.php │ │ │ ├── EnsureProductionSettingsCommand.php │ │ │ ├── GenerateEntitiesCommand.php │ │ │ ├── GenerateProxiesCommand.php │ │ │ ├── GenerateRepositoriesCommand.php │ │ │ ├── InfoCommand.php │ │ │ ├── RunDqlCommand.php │ │ │ ├── SchemaTool │ │ │ │ ├── AbstractCommand.php │ │ │ │ ├── CreateCommand.php │ │ │ │ ├── DropCommand.php │ │ │ │ └── UpdateCommand.php │ │ │ └── ValidateSchemaCommand.php │ │ ├── ConsoleRunner.php │ │ ├── Helper │ │ │ └── EntityManagerHelper.php │ │ └── MetadataFilter.php │ ├── ConvertDoctrine1Schema.php │ ├── DebugUnitOfWorkListener.php │ ├── DisconnectedClassMetadataFactory.php │ ├── EntityGenerator.php │ ├── EntityRepositoryGenerator.php │ ├── Event │ │ ├── GenerateSchemaEventArgs.php │ │ └── GenerateSchemaTableEventArgs.php │ ├── Export │ │ ├── ClassMetadataExporter.php │ │ ├── Driver │ │ │ ├── AbstractExporter.php │ │ │ ├── AnnotationExporter.php │ │ │ ├── PhpExporter.php │ │ │ ├── XmlExporter.php │ │ │ └── YamlExporter.php │ │ └── ExportException.php │ ├── Pagination │ │ ├── CountWalker.php │ │ ├── LimitSubqueryWalker.php │ │ ├── Paginator.php │ │ └── WhereInWalker.php │ ├── ResolveTargetEntityListener.php │ ├── SchemaTool.php │ ├── SchemaValidator.php │ ├── Setup.php │ ├── ToolEvents.php │ └── ToolsException.php │ ├── TransactionRequiredException.php │ ├── UnitOfWork.php │ └── Version.php ├── README.md ├── Test ├── Integration │ └── Infrastructure │ │ ├── Persistence │ │ ├── FishRepositoryTest.php │ │ ├── PersistenceTestCase.php │ │ └── dataset.xml │ │ └── Services │ │ └── ConsoleTest.php ├── Unit │ └── Domain │ │ └── Services │ │ ├── FishermanTest.php │ │ ├── FishingTestCase.php │ │ ├── PondStockerTest.php │ │ └── PondTest.php ├── bootstrap.php └── phpunit.xml ├── app.php └── environment.php /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | -------------------------------------------------------------------------------- /Domain/Entities/Fish.php: -------------------------------------------------------------------------------- 1 | id; 13 | } 14 | } -------------------------------------------------------------------------------- /Domain/Repositories/IFishRepository.php: -------------------------------------------------------------------------------- 1 | pond = $pond; 15 | $this->castCount = 0; 16 | $this->fish = array(); 17 | } 18 | 19 | public function getPond() 20 | { 21 | return $this->pond; 22 | } 23 | 24 | public function cast() 25 | { 26 | $this->castCount++; 27 | if($this->castIsCatch()) 28 | return $this->catchFish(); 29 | } 30 | 31 | public function getCastCount() 32 | { 33 | return $this->castCount; 34 | } 35 | 36 | public function getFish() 37 | { 38 | return $this->fish; 39 | } 40 | 41 | protected function castIsCatch() 42 | { 43 | return $this->castCount % 3 == 0; 44 | } 45 | 46 | protected function catchFish() 47 | { 48 | $fish = $this->pond->deplete(); 49 | $this->fish[] = $fish; 50 | return $fish; 51 | } 52 | } -------------------------------------------------------------------------------- /Domain/Services/Pond.php: -------------------------------------------------------------------------------- 1 | repo = $repo; 16 | $this->count = 0; 17 | } 18 | 19 | public function getRepo() 20 | { 21 | return $this->repo; 22 | } 23 | 24 | public function stock(Fish $fish) 25 | { 26 | $this->repo->store($fish); 27 | $this->count++; 28 | } 29 | 30 | public function getFishCount() 31 | { 32 | return $this->count; 33 | } 34 | 35 | public function deplete($fishId = 0) 36 | { 37 | if(!$fishId && $fish = $this->getRandomFish()) 38 | $fishId = $fish->getId(); 39 | 40 | return $this->removeFish($fishId); 41 | } 42 | 43 | protected function getRandomFish() 44 | { 45 | $all = $this->repo->all(); 46 | if(!$all) 47 | return; 48 | 49 | $randKey = array_rand($all); 50 | return $all[$randKey]; 51 | } 52 | 53 | public function removeFish($fishId) 54 | { 55 | $fish = $this->repo->delete($fishId); 56 | $this->count--; 57 | return $fish; 58 | } 59 | } -------------------------------------------------------------------------------- /Domain/Services/PondStocker.php: -------------------------------------------------------------------------------- 1 | pond = $pond; 15 | } 16 | 17 | public function getPond() 18 | { 19 | return $this->pond; 20 | } 21 | 22 | public function stock($numNewFish) 23 | { 24 | $this->stockExisting(); 25 | 26 | $i = 0; 27 | while($i < $numNewFish) { 28 | $this->pond->stock(new Fish()); 29 | $i++; 30 | } 31 | } 32 | 33 | public function pondIsEmpty() 34 | { 35 | return $this->pond->getFishCount() == 0; 36 | } 37 | 38 | private function stockExisting() 39 | { 40 | $uncaught = $this->pond->getRepo()->all(); 41 | foreach ($uncaught as $fish) { 42 | $this->pond->stock($fish); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Infrastructure/Persistence/xml/Domain.Entities.Fish.dcm.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Infrastructure/Services/Autoloader.php: -------------------------------------------------------------------------------- 1 | . 19 | */ 20 | 21 | namespace Doctrine\Common\Annotations\Annotation; 22 | 23 | /** 24 | * Annotation that can be used to signal to the parser 25 | * to check the attribute type during the parsing process. 26 | * 27 | * @author Fabio B. Silva 28 | * 29 | * @Annotation 30 | */ 31 | final class Attribute 32 | { 33 | /** 34 | * @var string 35 | */ 36 | public $name; 37 | 38 | /** 39 | * @var string 40 | */ 41 | public $type; 42 | 43 | /** 44 | * @var boolean 45 | */ 46 | public $required = false; 47 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/Common/Annotations/Annotation/Attributes.php: -------------------------------------------------------------------------------- 1 | . 19 | */ 20 | 21 | namespace Doctrine\Common\Annotations\Annotation; 22 | 23 | /** 24 | * Annotation that can be used to signal to the parser 25 | * to check the types of all declared attributes during the parsing process. 26 | * 27 | * @author Fabio B. Silva 28 | * 29 | * @Annotation 30 | */ 31 | final class Attributes 32 | { 33 | /** 34 | * @var array 35 | */ 36 | public $value; 37 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\Common\Annotations\Annotation; 21 | 22 | /** 23 | * Annotation that can be used to signal to the parser to ignore specific 24 | * annotations during the parsing process. 25 | * 26 | * @Annotation 27 | * @author Johannes M. Schmitt 28 | */ 29 | final class IgnoreAnnotation 30 | { 31 | public $names; 32 | 33 | public function __construct(array $values) 34 | { 35 | if (is_string($values['value'])) { 36 | $values['value'] = array($values['value']); 37 | } 38 | if (!is_array($values['value'])) { 39 | throw new \RuntimeException(sprintf('@IgnoreAnnotation expects either a string name, or an array of strings, but got %s.', json_encode($values['value']))); 40 | } 41 | 42 | $this->names = $values['value']; 43 | } 44 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/Common/Annotations/Annotation/Required.php: -------------------------------------------------------------------------------- 1 | . 19 | */ 20 | 21 | namespace Doctrine\Common\Annotations\Annotation; 22 | 23 | /** 24 | * Annotation that can be used to signal to the parser 25 | * to check if that attribute is required during the parsing process. 26 | * 27 | * @author Fabio B. Silva 28 | * 29 | * @Annotation 30 | */ 31 | final class Required 32 | { 33 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/Common/Annotations/Reader.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\Common\Annotations; 21 | 22 | /** 23 | * Interface for annotation readers. 24 | * 25 | * @author Johannes M. Schmitt 26 | */ 27 | interface Reader 28 | { 29 | function getClassAnnotations(\ReflectionClass $class); 30 | function getClassAnnotation(\ReflectionClass $class, $annotationName); 31 | function getMethodAnnotations(\ReflectionMethod $method); 32 | function getMethodAnnotation(\ReflectionMethod $method, $annotationName); 33 | function getPropertyAnnotations(\ReflectionProperty $property); 34 | function getPropertyAnnotation(\ReflectionProperty $property, $annotationName); 35 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/Common/CommonException.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\Common; 21 | 22 | /** 23 | * Base exception class for package Doctrine\Common 24 | * @author heinrich 25 | * 26 | */ 27 | class CommonException extends \Exception { 28 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/Common/Comparable.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | 21 | namespace Doctrine\Common; 22 | 23 | /** 24 | * Comparable interface that allows to compare two value objects to each other for similarity. 25 | * 26 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 27 | * @link www.doctrine-project.com 28 | * @since 2.2 29 | * @author Benjamin Eberlei 30 | * @author Guilherme Blanco 31 | */ 32 | interface Comparable 33 | { 34 | /** 35 | * Compare the current object to the passed $other. 36 | * 37 | * Returns 0 if they are semantically equal, 1 if the other object 38 | * is less than the current one, or -1 if its more than the current one. 39 | * 40 | * This method should not check for identity using ===, only for semantical equality for example 41 | * when two different DateTime instances point to the exact same Date + TZ. 42 | * 43 | * @return int 44 | */ 45 | public function compareTo($other); 46 | } 47 | 48 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/Common/EventSubscriber.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\Common; 23 | 24 | /** 25 | * An EventSubscriber knows himself what events he is interested in. 26 | * If an EventSubscriber is added to an EventManager, the manager invokes 27 | * {@link getSubscribedEvents} and registers the subscriber as a listener for all 28 | * returned events. 29 | * 30 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 31 | * @link www.doctrine-project.org 32 | * @since 2.0 33 | * @author Guilherme Blanco 34 | * @author Jonathan Wage 35 | * @author Roman Borschel 36 | */ 37 | interface EventSubscriber 38 | { 39 | /** 40 | * Returns an array of events this subscriber wants to listen to. 41 | * 42 | * @return array 43 | */ 44 | function getSubscribedEvents(); 45 | } 46 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/Common/NotifyPropertyChanged.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\Common; 23 | 24 | /** 25 | * Contract for classes that provide the service of notifying listeners of 26 | * changes to their properties. 27 | * 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @link www.doctrine-project.org 30 | * @since 2.0 31 | * @version $Revision: 3938 $ 32 | * @author Guilherme Blanco 33 | * @author Jonathan Wage 34 | * @author Roman Borschel 35 | */ 36 | interface NotifyPropertyChanged 37 | { 38 | /** 39 | * Adds a listener that wants to be notified about property changes. 40 | * 41 | * @param PropertyChangedListener $listener 42 | */ 43 | function addPropertyChangedListener(PropertyChangedListener $listener); 44 | } 45 | 46 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/Common/Persistence/Proxy.php: -------------------------------------------------------------------------------- 1 | . 19 | */ 20 | 21 | namespace Doctrine\Common\Persistence; 22 | 23 | /** 24 | * Interface for proxy classes. 25 | * 26 | * @author Roman Borschel 27 | * @since 2.2 28 | */ 29 | interface Proxy 30 | { 31 | /** 32 | * Marker for Proxy class names. 33 | * 34 | * @var string 35 | */ 36 | const MARKER = '__CG__'; 37 | 38 | /** 39 | * Length of the proxy marker 40 | * 41 | * @var int 42 | */ 43 | const MARKER_LENGTH = 6; 44 | 45 | /** 46 | * Initialize this proxy if its not yet initialized. 47 | * 48 | * Acts as a no-op if already initialized. 49 | * 50 | * @return void 51 | */ 52 | public function __load(); 53 | 54 | /** 55 | * Is this proxy initialized or not. 56 | * 57 | * @return bool 58 | */ 59 | public function __isInitialized(); 60 | } 61 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/DBAL/Cache/CacheException.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\DBAL\Cache; 21 | 22 | /** 23 | * @author Benjamin Eberlei 24 | * @since 2.2 25 | */ 26 | class CacheException extends \Doctrine\DBAL\DBALException 27 | { 28 | static public function noCacheKey() 29 | { 30 | return new self("No cache key was set."); 31 | } 32 | 33 | static public function noResultDriverConfigured() 34 | { 35 | return new self("Trying to cache a query but no result driver is configured."); 36 | } 37 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/DBAL/Driver/Connection.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\DBAL\Driver; 21 | 22 | /** 23 | * Connection interface. 24 | * Driver connections must implement this interface. 25 | * 26 | * This resembles (a subset of) the PDO interface. 27 | * 28 | * @since 2.0 29 | */ 30 | interface Connection 31 | { 32 | function prepare($prepareString); 33 | function query(); 34 | function quote($input, $type=\PDO::PARAM_STR); 35 | function exec($statement); 36 | function lastInsertId($name = null); 37 | function beginTransaction(); 38 | function commit(); 39 | function rollBack(); 40 | function errorCode(); 41 | function errorInfo(); 42 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/DBAL/Driver/IBMDB2/DB2Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\DBAL\Driver\IBMDB2; 23 | 24 | class DB2Exception extends \Exception 25 | { 26 | 27 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/DBAL/Driver/Mysqli/MysqliException.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\DBAL\Driver\Mysqli; 21 | 22 | /** 23 | * @author Kim Hemsø Rasmussen 24 | */ 25 | class MysqliException extends \Exception 26 | {} 27 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/DBAL/Driver/OCI8/OCI8Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\DBAL\Driver\OCI8; 23 | 24 | class OCI8Exception extends \Exception 25 | { 26 | static public function fromErrorInfo($error) 27 | { 28 | return new self($error['message'], $error['code']); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/DBAL/Driver/PDOConnection.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\DBAL\Driver; 23 | 24 | use \PDO; 25 | 26 | /** 27 | * PDO implementation of the Connection interface. 28 | * Used by all PDO-based drivers. 29 | * 30 | * @since 2.0 31 | */ 32 | class PDOConnection extends PDO implements Connection 33 | { 34 | public function __construct($dsn, $user = null, $password = null, array $options = null) 35 | { 36 | parent::__construct($dsn, $user, $password, $options); 37 | $this->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('Doctrine\DBAL\Driver\PDOStatement', array())); 38 | $this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 39 | } 40 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/DBAL/Driver/PDOPgSql/Driver.php: -------------------------------------------------------------------------------- 1 | _constructPdoDsn($params), 23 | $username, 24 | $password, 25 | $driverOptions 26 | ); 27 | } 28 | 29 | /** 30 | * Constructs the Postgres PDO DSN. 31 | * 32 | * @return string The DSN. 33 | */ 34 | private function _constructPdoDsn(array $params) 35 | { 36 | $dsn = 'pgsql:'; 37 | if (isset($params['host']) && $params['host'] != '') { 38 | $dsn .= 'host=' . $params['host'] . ' '; 39 | } 40 | if (isset($params['port']) && $params['port'] != '') { 41 | $dsn .= 'port=' . $params['port'] . ' '; 42 | } 43 | if (isset($params['dbname'])) { 44 | $dsn .= 'dbname=' . $params['dbname'] . ' '; 45 | } 46 | 47 | return $dsn; 48 | } 49 | 50 | public function getDatabasePlatform() 51 | { 52 | return new \Doctrine\DBAL\Platforms\PostgreSqlPlatform(); 53 | } 54 | 55 | public function getSchemaManager(\Doctrine\DBAL\Connection $conn) 56 | { 57 | return new \Doctrine\DBAL\Schema\PostgreSqlSchemaManager($conn); 58 | } 59 | 60 | public function getName() 61 | { 62 | return 'pdo_pgsql'; 63 | } 64 | 65 | public function getDatabase(\Doctrine\DBAL\Connection $conn) 66 | { 67 | $params = $conn->getParams(); 68 | return $params['dbname']; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/DBAL/Driver/PDOSqlsrv/Connection.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\DBAL\Driver\PDOSqlsrv; 23 | 24 | /** 25 | * Sqlsrv Connection implementation. 26 | * 27 | * @since 2.0 28 | */ 29 | class Connection extends \Doctrine\DBAL\Driver\PDOConnection implements \Doctrine\DBAL\Driver\Connection 30 | { 31 | /** 32 | * @override 33 | */ 34 | public function quote($value, $type=\PDO::PARAM_STR) 35 | { 36 | $val = parent::quote($value, $type); 37 | 38 | // Fix for a driver version terminating all values with null byte 39 | if (strpos($val, "\0") !== false) { 40 | $val = substr($val, 0, -1); 41 | } 42 | 43 | return $val; 44 | } 45 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/DBAL/Driver/PDOStatement.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\DBAL\Driver; 23 | 24 | /** 25 | * The PDO implementation of the Statement interface. 26 | * Used by all PDO-based drivers. 27 | * 28 | * @since 2.0 29 | */ 30 | class PDOStatement extends \PDOStatement implements Statement 31 | { 32 | private function __construct() {} 33 | 34 | public function setFetchMode($fetchStyle, $params = NULL) 35 | { 36 | // This thin wrapper is necessary to shield against the weird signature 37 | // of PDOStatement::setFetchMode(): even if the second and third 38 | // parameters are optional, PHP will not let us remove it from this 39 | // declaration. 40 | return parent::setFetchMode($fetchStyle); 41 | } 42 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/DBAL/Event/SchemaEventArgs.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\DBAL\Event; 21 | 22 | use Doctrine\Common\EventArgs; 23 | 24 | /** 25 | * Base class for schema related events. 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.com 29 | * @since 2.2 30 | * @author Jan Sorgalla 31 | */ 32 | class SchemaEventArgs extends EventArgs 33 | { 34 | /** 35 | * @var boolean 36 | */ 37 | private $_preventDefault = false; 38 | 39 | /** 40 | * @return \Doctrine\DBAL\Event\SchemaEventArgs 41 | */ 42 | public function preventDefault() 43 | { 44 | $this->_preventDefault = true; 45 | 46 | return $this; 47 | } 48 | 49 | /** 50 | * @return boolean 51 | */ 52 | public function isDefaultPrevented() 53 | { 54 | return $this->_preventDefault; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/DBAL/LockMode.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\DBAL; 23 | 24 | /** 25 | * Contains all DBAL LockModes 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.com 29 | * @since 1.0 30 | * @version $Revision$ 31 | * @author Benjamin Eberlei 32 | * @author Roman Borschel 33 | */ 34 | class LockMode 35 | { 36 | const NONE = 0; 37 | const OPTIMISTIC = 1; 38 | const PESSIMISTIC_READ = 2; 39 | const PESSIMISTIC_WRITE = 4; 40 | 41 | final private function __construct() { } 42 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/DBAL/Query/QueryException.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\DBAL\Query; 21 | 22 | use Doctrine\DBAL\DBALException; 23 | 24 | /** 25 | * Driver interface. 26 | * Interface that all DBAL drivers must implement. 27 | * 28 | * @since 2.1.4 29 | */ 30 | class QueryException extends DBALException 31 | { 32 | static public function unknownFromAlias($alias, $registeredAliases) 33 | { 34 | return new self("The given alias '" . $alias . "' is not part of " . 35 | "any FROM clause table. The currently registered FROM-clause " . 36 | "aliases are: " . implode(", ", $registeredAliases) . ". Join clauses " . 37 | "are bound to from clauses to provide support for mixing of multiple " . 38 | "from and join clauses."); 39 | } 40 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/DBAL/Schema/ColumnDiff.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\DBAL\Schema; 23 | 24 | /** 25 | * Represent the change of a column 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 2.0 30 | * @version $Revision$ 31 | * @author Benjamin Eberlei 32 | */ 33 | class ColumnDiff 34 | { 35 | public $oldColumnName; 36 | 37 | /** 38 | * @var Column 39 | */ 40 | public $column; 41 | 42 | /** 43 | * @var array 44 | */ 45 | public $changedProperties = array(); 46 | 47 | public function __construct($oldColumnName, Column $column, array $changedProperties = array()) 48 | { 49 | $this->oldColumnName = $oldColumnName; 50 | $this->column = $column; 51 | $this->changedProperties = $changedProperties; 52 | } 53 | 54 | public function hasChanged($propertyName) 55 | { 56 | return in_array($propertyName, $this->changedProperties); 57 | } 58 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/DBAL/Schema/Constraint.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\DBAL\Schema; 23 | 24 | /** 25 | * Marker interface for contraints 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 2.0 30 | * @version $Revision$ 31 | * @author Benjamin Eberlei 32 | */ 33 | interface Constraint 34 | { 35 | public function getName(); 36 | 37 | public function getColumns(); 38 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/DBAL/Schema/View.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\DBAL\Schema; 23 | 24 | /** 25 | * Representation of a Database View 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.com 29 | * @since 1.0 30 | * @version $Revision$ 31 | * @author Benjamin Eberlei 32 | */ 33 | class View extends AbstractAsset 34 | { 35 | /** 36 | * @var string 37 | */ 38 | private $_sql; 39 | 40 | public function __construct($name, $sql) 41 | { 42 | $this->_setName($name); 43 | $this->_sql = $sql; 44 | } 45 | 46 | /** 47 | * @return string 48 | */ 49 | public function getSql() 50 | { 51 | return $this->_sql; 52 | } 53 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/DBAL/Types/BigIntType.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\DBAL\Types; 23 | 24 | use Doctrine\DBAL\Platforms\AbstractPlatform; 25 | 26 | /** 27 | * Type that maps a database BIGINT to a PHP string. 28 | * 29 | * @author robo 30 | * @since 2.0 31 | */ 32 | class BigIntType extends Type 33 | { 34 | public function getName() 35 | { 36 | return Type::BIGINT; 37 | } 38 | 39 | public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) 40 | { 41 | return $platform->getBigIntTypeDeclarationSQL($fieldDeclaration); 42 | } 43 | 44 | public function getBindingType() 45 | { 46 | return \PDO::PARAM_STR; 47 | } 48 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/DBAL/Types/BooleanType.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\DBAL\Types; 23 | 24 | use Doctrine\DBAL\Platforms\AbstractPlatform; 25 | 26 | /** 27 | * Type that maps an SQL boolean to a PHP boolean. 28 | * 29 | * @since 2.0 30 | */ 31 | class BooleanType extends Type 32 | { 33 | public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) 34 | { 35 | return $platform->getBooleanTypeDeclarationSQL($fieldDeclaration); 36 | } 37 | 38 | public function convertToDatabaseValue($value, AbstractPlatform $platform) 39 | { 40 | return $platform->convertBooleans($value); 41 | } 42 | 43 | public function convertToPHPValue($value, AbstractPlatform $platform) 44 | { 45 | return (null === $value) ? null : (bool) $value; 46 | } 47 | 48 | public function getName() 49 | { 50 | return Type::BOOLEAN; 51 | } 52 | 53 | public function getBindingType() 54 | { 55 | return \PDO::PARAM_BOOL; 56 | } 57 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/DBAL/Types/DecimalType.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\DBAL\Types; 21 | 22 | use Doctrine\DBAL\Platforms\AbstractPlatform; 23 | 24 | /** 25 | * Type that maps an SQL DECIMAL to a PHP double. 26 | * 27 | * @since 2.0 28 | */ 29 | class DecimalType extends Type 30 | { 31 | public function getName() 32 | { 33 | return Type::DECIMAL; 34 | } 35 | 36 | public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) 37 | { 38 | return $platform->getDecimalTypeDeclarationSQL($fieldDeclaration); 39 | } 40 | 41 | public function convertToPHPValue($value, AbstractPlatform $platform) 42 | { 43 | return (null === $value) ? null : $value; 44 | } 45 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/DBAL/Types/IntegerType.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\DBAL\Types; 23 | 24 | use Doctrine\DBAL\Platforms\AbstractPlatform; 25 | 26 | /** 27 | * Type that maps an SQL INT to a PHP integer. 28 | * 29 | * @author Roman Borschel 30 | * @since 2.0 31 | */ 32 | class IntegerType extends Type 33 | { 34 | public function getName() 35 | { 36 | return Type::INTEGER; 37 | } 38 | 39 | public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) 40 | { 41 | return $platform->getIntegerTypeDeclarationSQL($fieldDeclaration); 42 | } 43 | 44 | public function convertToPHPValue($value, AbstractPlatform $platform) 45 | { 46 | return (null === $value) ? null : (int) $value; 47 | } 48 | 49 | public function getBindingType() 50 | { 51 | return \PDO::PARAM_INT; 52 | } 53 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/DBAL/Types/SmallIntType.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\DBAL\Types; 23 | 24 | use Doctrine\DBAL\Platforms\AbstractPlatform; 25 | 26 | /** 27 | * Type that maps a database SMALLINT to a PHP integer. 28 | * 29 | * @author robo 30 | */ 31 | class SmallIntType extends Type 32 | { 33 | public function getName() 34 | { 35 | return Type::SMALLINT; 36 | } 37 | 38 | public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) 39 | { 40 | return $platform->getSmallIntTypeDeclarationSQL($fieldDeclaration); 41 | } 42 | 43 | public function convertToPHPValue($value, AbstractPlatform $platform) 44 | { 45 | return (null === $value) ? null : (int) $value; 46 | } 47 | 48 | public function getBindingType() 49 | { 50 | return \PDO::PARAM_INT; 51 | } 52 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/DBAL/Types/StringType.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\DBAL\Types; 23 | 24 | use Doctrine\DBAL\Platforms\AbstractPlatform; 25 | 26 | /** 27 | * Type that maps an SQL VARCHAR to a PHP string. 28 | * 29 | * @since 2.0 30 | */ 31 | class StringType extends Type 32 | { 33 | /** @override */ 34 | public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) 35 | { 36 | return $platform->getVarcharTypeDeclarationSQL($fieldDeclaration); 37 | } 38 | 39 | /** @override */ 40 | public function getDefaultLength(AbstractPlatform $platform) 41 | { 42 | return $platform->getVarcharDefaultLength(); 43 | } 44 | 45 | /** @override */ 46 | public function getName() 47 | { 48 | return Type::STRING; 49 | } 50 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/EntityNotFoundException.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM; 21 | 22 | /** 23 | * Exception thrown when a Proxy fails to retrieve an Entities result. 24 | * 25 | * @author robo 26 | * @since 2.0 27 | */ 28 | class EntityNotFoundException extends ORMException 29 | { 30 | public function __construct() 31 | { 32 | parent::__construct('Entities was not found.'); 33 | } 34 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Event/PreFlushEventArgs.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Event; 23 | 24 | /** 25 | * Provides event arguments for the preFlush event. 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.com 29 | * @since 2.0 30 | * @version $Revision$ 31 | * @author Roman Borschel 32 | * @author Benjamin Eberlei 33 | */ 34 | class PreFlushEventArgs extends \Doctrine\Common\EventArgs 35 | { 36 | /** 37 | * @var EntityManager 38 | */ 39 | private $_em; 40 | 41 | public function __construct($em) 42 | { 43 | $this->_em = $em; 44 | } 45 | 46 | /** 47 | * @return EntityManager 48 | */ 49 | public function getEntityManager() 50 | { 51 | return $this->_em; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Id/AbstractIdGenerator.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Id; 21 | 22 | use Doctrine\ORM\EntityManager; 23 | 24 | abstract class AbstractIdGenerator 25 | { 26 | /** 27 | * Generates an identifier for an entity. 28 | * 29 | * @param \Doctrine\ORM\Entity $entity 30 | * @return mixed 31 | */ 32 | abstract public function generate(EntityManager $em, $entity); 33 | 34 | /** 35 | * Gets whether this generator is a post-insert generator which means that 36 | * {@link generate()} must be called after the entity has been inserted 37 | * into the database. 38 | * 39 | * By default, this method returns FALSE. Generators that have this requirement 40 | * must override this method and return TRUE. 41 | * 42 | * @return boolean 43 | */ 44 | public function isPostInsertGenerator() 45 | { 46 | return false; 47 | } 48 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Internal/Hydration/HydrationException.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | interface Annotation 23 | { 24 | } 25 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/ChangeTrackingPolicy.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("CLASS") 25 | */ 26 | final class ChangeTrackingPolicy implements Annotation 27 | { 28 | /** @var string */ 29 | public $value; 30 | } 31 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/ClassMetadata.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | use ReflectionClass, ReflectionProperty; 23 | 24 | /** 25 | * A ClassMetadata instance holds all the object-relational mapping metadata 26 | * of an entity and it's associations. 27 | * 28 | * Once populated, ClassMetadata instances are usually cached in a serialized form. 29 | * 30 | * IMPORTANT NOTE: 31 | * 32 | * The fields of this class are only public for 2 reasons: 33 | * 1) To allow fast READ access. 34 | * 2) To drastically reduce the size of a serialized instance (private/protected members 35 | * get the whole class name, namespace inclusive, prepended to every property in 36 | * the serialized representation). 37 | * 38 | * @author Roman Borschel 39 | * @author Jonathan H. Wage 40 | * @since 2.0 41 | */ 42 | class ClassMetadata extends ClassMetadataInfo 43 | { 44 | } 45 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/Column.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("PROPERTY") 25 | */ 26 | final class Column implements Annotation 27 | { 28 | /** @var string */ 29 | public $name; 30 | /** @var mixed */ 31 | public $type = 'string'; 32 | /** @var integer */ 33 | public $length; 34 | /** @var integer */ 35 | public $precision = 0; // The precision for a decimal (exact numeric) column (Applies only for decimal column) 36 | /** @var integer */ 37 | public $scale = 0; // The scale for a decimal (exact numeric) column (Applies only for decimal column) 38 | /** @var boolean */ 39 | public $unique = false; 40 | /** @var boolean */ 41 | public $nullable = false; 42 | /** @var array */ 43 | public $options = array(); 44 | /** @var string */ 45 | public $columnDefinition; 46 | } 47 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/DiscriminatorColumn.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("CLASS") 25 | */ 26 | final class DiscriminatorColumn implements Annotation 27 | { 28 | /** @var string */ 29 | public $name; 30 | /** @var string */ 31 | public $type; 32 | /** @var integer */ 33 | public $length; 34 | /** @var mixed */ 35 | public $fieldName; // field name used in non-object hydration (array/scalar) 36 | } 37 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/DiscriminatorMap.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("CLASS") 25 | */ 26 | final class DiscriminatorMap implements Annotation 27 | { 28 | /** @var array */ 29 | public $value; 30 | } 31 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/ElementCollection.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("ALL") 25 | * @todo check available targets 26 | */ 27 | final class ElementCollection implements Annotation 28 | { 29 | /** @var string */ 30 | public $tableName; 31 | } 32 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/Entity.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("CLASS") 25 | */ 26 | final class Entity implements Annotation 27 | { 28 | /** @var string */ 29 | public $repositoryClass; 30 | /** @var boolean */ 31 | public $readOnly = false; 32 | } 33 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/GeneratedValue.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("PROPERTY") 25 | */ 26 | final class GeneratedValue implements Annotation 27 | { 28 | /** @var string */ 29 | public $strategy = 'AUTO'; 30 | } 31 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/HasLifecycleCallbacks.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("CLASS") 25 | */ 26 | final class HasLifecycleCallbacks implements Annotation 27 | { 28 | } 29 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/Id.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("PROPERTY") 25 | */ 26 | final class Id implements Annotation 27 | { 28 | } 29 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/Index.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("ANNOTATION") 25 | */ 26 | final class Index implements Annotation 27 | { 28 | /** @var string */ 29 | public $name; 30 | /** @var array */ 31 | public $columns; 32 | } 33 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/InheritanceType.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("CLASS") 25 | */ 26 | final class InheritanceType implements Annotation 27 | { 28 | /** @var string */ 29 | public $value; 30 | } 31 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/JoinColumn.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target({"PROPERTY","ANNOTATION"}) 25 | */ 26 | final class JoinColumn implements Annotation 27 | { 28 | /** @var string */ 29 | public $name; 30 | /** @var string */ 31 | public $referencedColumnName = 'id'; 32 | /** @var boolean */ 33 | public $unique = false; 34 | /** @var boolean */ 35 | public $nullable = true; 36 | /** @var mixed */ 37 | public $onDelete; 38 | /** @var string */ 39 | public $columnDefinition; 40 | /** @var string */ 41 | public $fieldName; // field name used in non-object hydration (array/scalar) 42 | } 43 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/JoinColumns.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("PROPERTY") 25 | */ 26 | final class JoinColumns implements Annotation 27 | { 28 | /** @var array<\Doctrine\ORM\Mapping\JoinColumn> */ 29 | public $value; 30 | } 31 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/JoinTable.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("PROPERTY") 25 | */ 26 | final class JoinTable implements Annotation 27 | { 28 | /** @var string */ 29 | public $name; 30 | /** @var string */ 31 | public $schema; 32 | /** @var array<\Doctrine\ORM\Mapping\JoinColumn> */ 33 | public $joinColumns = array(); 34 | /** @var array<\Doctrine\ORM\Mapping\JoinColumn> */ 35 | public $inverseJoinColumns = array(); 36 | } 37 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/ManyToMany.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("PROPERTY") 25 | */ 26 | final class ManyToMany implements Annotation 27 | { 28 | /** @var string */ 29 | public $targetEntity; 30 | /** @var string */ 31 | public $mappedBy; 32 | /** @var string */ 33 | public $inversedBy; 34 | /** @var array */ 35 | public $cascade; 36 | /** @var string */ 37 | public $fetch = 'LAZY'; 38 | /** @var boolean */ 39 | public $orphanRemoval = false; 40 | /** @var string */ 41 | public $indexBy; 42 | } 43 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/ManyToOne.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("PROPERTY") 25 | */ 26 | final class ManyToOne implements Annotation 27 | { 28 | /** @var string */ 29 | public $targetEntity; 30 | /** @var array */ 31 | public $cascade; 32 | /** @var string */ 33 | public $fetch = 'LAZY'; 34 | /** @var string */ 35 | public $inversedBy; 36 | } 37 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/MappedSuperclass.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("CLASS") 25 | */ 26 | final class MappedSuperclass implements Annotation 27 | { 28 | /** @var string */ 29 | public $repositoryClass; 30 | } 31 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/NamedQueries.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("CLASS") 25 | */ 26 | final class NamedQueries implements Annotation 27 | { 28 | /** @var array<\Doctrine\ORM\Mapping\NamedQuery> */ 29 | public $value; 30 | } 31 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/NamedQuery.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("ANNOTATION") 25 | */ 26 | final class NamedQuery implements Annotation 27 | { 28 | /** @var string */ 29 | public $name; 30 | /** @var string */ 31 | public $query; 32 | } 33 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/OneToMany.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("PROPERTY") 25 | */ 26 | final class OneToMany implements Annotation 27 | { 28 | /** @var string */ 29 | public $mappedBy; 30 | /** @var string */ 31 | public $targetEntity; 32 | /** @var array */ 33 | public $cascade; 34 | /** @var string */ 35 | public $fetch = 'LAZY'; 36 | /** @var boolean */ 37 | public $orphanRemoval = false; 38 | /** @var string */ 39 | public $indexBy; 40 | } 41 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/OneToOne.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("PROPERTY") 25 | */ 26 | final class OneToOne implements Annotation 27 | { 28 | /** @var string */ 29 | public $targetEntity; 30 | /** @var string */ 31 | public $mappedBy; 32 | /** @var string */ 33 | public $inversedBy; 34 | /** @var array */ 35 | public $cascade; 36 | /** @var string */ 37 | public $fetch = 'LAZY'; 38 | /** @var boolean */ 39 | public $orphanRemoval = false; 40 | } 41 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/OrderBy.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("PROPERTY") 25 | */ 26 | final class OrderBy implements Annotation 27 | { 28 | /** @var array */ 29 | public $value; 30 | } 31 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/PostLoad.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("METHOD") 25 | */ 26 | final class PostLoad implements Annotation 27 | { 28 | } 29 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/PostPersist.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("METHOD") 25 | */ 26 | final class PostPersist implements Annotation 27 | { 28 | } 29 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/PostRemove.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("METHOD") 25 | */ 26 | final class PostRemove implements Annotation 27 | { 28 | } 29 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/PostUpdate.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("METHOD") 25 | */ 26 | final class PostUpdate implements Annotation 27 | { 28 | } 29 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/PreFlush.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("METHOD") 25 | */ 26 | final class PreFlush implements Annotation 27 | { 28 | } 29 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/PrePersist.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("METHOD") 25 | */ 26 | final class PrePersist implements Annotation 27 | { 28 | } 29 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/PreRemove.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("METHOD") 25 | */ 26 | final class PreRemove implements Annotation 27 | { 28 | } 29 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/PreUpdate.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("METHOD") 25 | */ 26 | final class PreUpdate implements Annotation 27 | { 28 | } 29 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/SequenceGenerator.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("PROPERTY") 25 | */ 26 | final class SequenceGenerator implements Annotation 27 | { 28 | /** @var string */ 29 | public $sequenceName; 30 | /** @var integer */ 31 | public $allocationSize = 1; 32 | /** @var integer */ 33 | public $initialValue = 1; 34 | } 35 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/Table.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("CLASS") 25 | */ 26 | final class Table implements Annotation 27 | { 28 | /** @var string */ 29 | public $name; 30 | /** @var string */ 31 | public $schema; 32 | /** @var array<\Doctrine\ORM\Mapping\Index> */ 33 | public $indexes; 34 | /** @var array<\Doctrine\ORM\Mapping\UniqueConstraint> */ 35 | public $uniqueConstraints; 36 | } 37 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/UniqueConstraint.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("ANNOTATION") 25 | */ 26 | final class UniqueConstraint implements Annotation 27 | { 28 | /** @var string */ 29 | public $name; 30 | /** @var array */ 31 | public $columns; 32 | } 33 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Mapping/Version.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Mapping; 21 | 22 | /** 23 | * @Annotation 24 | * @Target("PROPERTY") 25 | */ 26 | final class Version implements Annotation 27 | { 28 | } 29 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/NoResultException.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM; 21 | 22 | /** 23 | * Exception thrown when an ORM query unexpectedly does not return any results. 24 | * 25 | * @author robo 26 | * @since 2.0 27 | */ 28 | class NoResultException extends ORMException 29 | { 30 | public function __construct() 31 | { 32 | parent::__construct('No result was found for query although at least one row was expected.'); 33 | } 34 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/NonUniqueResultException.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM; 21 | 22 | /** 23 | * Exception thrown when an ORM query unexpectedly returns more than one result. 24 | * 25 | * @author robo 26 | * @since 2.0 27 | */ 28 | class NonUniqueResultException extends ORMException {} -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Persisters/ElementCollectionPersister.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Persisters; 23 | 24 | /** 25 | * Persister for collections of basic elements / value types. 26 | * 27 | * @author robo 28 | * @todo Implementation once support for collections of basic elements (i.e. strings) is added. 29 | */ 30 | abstract class ElementCollectionPersister extends AbstractCollectionPersister 31 | { 32 | //put your code here 33 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Persisters/UnionSubclassPersister.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM; 23 | 24 | /** 25 | * Pessimistic Lock Exception 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.com 29 | * @since 1.0 30 | * @version $Revision$ 31 | * @author Benjamin Eberlei 32 | * @author Roman Borschel 33 | */ 34 | class PessimisticLockException extends ORMException 35 | { 36 | public static function lockFailed() 37 | { 38 | return new self("The pessimistic lock failed."); 39 | } 40 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Proxy/Proxy.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Proxy; 21 | 22 | use Doctrine\Common\Persistence\Proxy as BaseProxy; 23 | 24 | /** 25 | * Interface for proxy classes. 26 | * 27 | * @author Roman Borschel 28 | * @since 2.0 29 | */ 30 | interface Proxy extends BaseProxy {} 31 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Proxy/ProxyException.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Proxy; 23 | 24 | /** 25 | * ORM Proxy Exception 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.com 29 | * @since 1.0 30 | * @version $Revision$ 31 | * @author Benjamin Eberlei 32 | */ 33 | class ProxyException extends \Doctrine\ORM\ORMException { 34 | 35 | public static function proxyDirectoryRequired() { 36 | return new self("You must configure a proxy directory. See docs for details"); 37 | } 38 | 39 | public static function proxyNamespaceRequired() { 40 | return new self("You must configure a proxy namespace. See docs for details"); 41 | } 42 | 43 | public static function notProxyClass($className, $proxyNamespace) 44 | { 45 | return new self(sprintf( 46 | "The class %s is not part of the proxy namespace %s", 47 | $className, $proxyNamespace 48 | )); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/ASTException.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Query\AST; 23 | 24 | /** 25 | * ArithmeticExpression ::= SimpleArithmeticExpression | "(" Subselect ")" 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 2.0 30 | * @version $Revision: 3938 $ 31 | * @author Guilherme Blanco 32 | * @author Jonathan Wage 33 | * @author Roman Borschel 34 | */ 35 | class ArithmeticExpression extends Node 36 | { 37 | public $simpleArithmeticExpression; 38 | public $subselect; 39 | 40 | public function isSimpleArithmeticExpression() 41 | { 42 | return (bool) $this->simpleArithmeticExpression; 43 | } 44 | 45 | public function isSubselect() 46 | { 47 | return (bool) $this->subselect; 48 | } 49 | 50 | public function dispatch($walker) 51 | { 52 | return $walker->walkArithmeticExpression($this); 53 | } 54 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/ArithmeticTerm.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Query\AST; 23 | 24 | /** 25 | * ArithmeticTerm ::= ArithmeticFactor {("*" | "/") ArithmeticFactor}* 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 2.0 30 | * @version $Revision: 3938 $ 31 | * @author Guilherme Blanco 32 | * @author Jonathan Wage 33 | * @author Roman Borschel 34 | */ 35 | class ArithmeticTerm extends Node 36 | { 37 | public $arithmeticFactors; 38 | 39 | public function __construct(array $arithmeticFactors) 40 | { 41 | $this->arithmeticFactors = $arithmeticFactors; 42 | } 43 | 44 | public function dispatch($sqlWalker) 45 | { 46 | return $sqlWalker->walkArithmeticTerm($this); 47 | } 48 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/CoalesceExpression.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Query\AST; 21 | 22 | /** 23 | * CoalesceExpression ::= "COALESCE" "(" ScalarExpression {"," ScalarExpression}* ")" 24 | * 25 | * @since 2.1 26 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 27 | * @link www.doctrine-project.org 28 | * @author Benjamin Eberlei 29 | * @author Guilherme Blanco 30 | * @author Jonathan Wage 31 | * @author Roman Borschel 32 | */ 33 | class CoalesceExpression extends Node 34 | { 35 | public $scalarExpressions = array(); 36 | 37 | 38 | public function __construct(array $scalarExpressions) 39 | { 40 | $this->scalarExpressions = $scalarExpressions; 41 | } 42 | 43 | public function dispatch($sqlWalker) 44 | { 45 | return $sqlWalker->walkCoalesceExpression($this); 46 | } 47 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/ConditionalExpression.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Query\AST; 23 | 24 | /** 25 | * ConditionalExpression ::= ConditionalTerm {"OR" ConditionalTerm}* 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 2.0 30 | * @version $Revision: 3938 $ 31 | * @author Guilherme Blanco 32 | * @author Jonathan Wage 33 | * @author Roman Borschel 34 | */ 35 | class ConditionalExpression extends Node 36 | { 37 | public $conditionalTerms = array(); 38 | 39 | public function __construct(array $conditionalTerms) 40 | { 41 | $this->conditionalTerms = $conditionalTerms; 42 | } 43 | 44 | public function dispatch($sqlWalker) 45 | { 46 | return $sqlWalker->walkConditionalExpression($this); 47 | } 48 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/ConditionalFactor.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Query\AST; 23 | 24 | /** 25 | * ConditionalFactor ::= ["NOT"] ConditionalPrimary 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 2.0 30 | * @version $Revision: 3938 $ 31 | * @author Guilherme Blanco 32 | * @author Jonathan Wage 33 | * @author Roman Borschel 34 | */ 35 | class ConditionalFactor extends Node 36 | { 37 | public $not = false; 38 | public $conditionalPrimary; 39 | 40 | public function __construct($conditionalPrimary) 41 | { 42 | $this->conditionalPrimary = $conditionalPrimary; 43 | } 44 | 45 | public function dispatch($sqlWalker) 46 | { 47 | return $sqlWalker->walkConditionalFactor($this); 48 | } 49 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/ConditionalTerm.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Query\AST; 23 | 24 | /** 25 | * ConditionalTerm ::= ConditionalFactor {"AND" ConditionalFactor}* 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 2.0 30 | * @version $Revision: 3938 $ 31 | * @author Guilherme Blanco 32 | * @author Jonathan Wage 33 | * @author Roman Borschel 34 | */ 35 | class ConditionalTerm extends Node 36 | { 37 | public $conditionalFactors = array(); 38 | 39 | public function __construct(array $conditionalFactors) 40 | { 41 | $this->conditionalFactors = $conditionalFactors; 42 | } 43 | 44 | public function dispatch($sqlWalker) 45 | { 46 | return $sqlWalker->walkConditionalTerm($this); 47 | } 48 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/DeleteClause.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Query\AST; 23 | 24 | /** 25 | * DeleteClause ::= "DELETE" ["FROM"] AbstractSchemaName [["AS"] AliasIdentificationVariable] 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 2.0 30 | * @version $Revision: 3938 $ 31 | * @author Guilherme Blanco 32 | * @author Jonathan Wage 33 | * @author Roman Borschel 34 | */ 35 | class DeleteClause extends Node 36 | { 37 | public $abstractSchemaName; 38 | public $aliasIdentificationVariable; 39 | 40 | public function __construct($abstractSchemaName) 41 | { 42 | $this->abstractSchemaName = $abstractSchemaName; 43 | } 44 | 45 | public function dispatch($sqlWalker) 46 | { 47 | return $sqlWalker->walkDeleteClause($this); 48 | } 49 | } 50 | 51 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/DeleteStatement.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Query\AST; 23 | 24 | /** 25 | * DeleteStatement = DeleteClause [WhereClause] 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 2.0 30 | * @version $Revision: 3938 $ 31 | * @author Guilherme Blanco 32 | * @author Jonathan Wage 33 | * @author Roman Borschel 34 | */ 35 | class DeleteStatement extends Node 36 | { 37 | public $deleteClause; 38 | public $whereClause; 39 | 40 | public function __construct($deleteClause) 41 | { 42 | $this->deleteClause = $deleteClause; 43 | } 44 | 45 | public function dispatch($sqlWalker) 46 | { 47 | return $sqlWalker->walkDeleteStatement($this); 48 | } 49 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/EmptyCollectionComparisonExpression.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Query\AST; 23 | 24 | /** 25 | * EmptyCollectionComparisonExpression ::= CollectionValuedPathExpression "IS" ["NOT"] "EMPTY" 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 2.0 30 | * @version $Revision: 3938 $ 31 | * @author Guilherme Blanco 32 | * @author Jonathan Wage 33 | * @author Roman Borschel 34 | */ 35 | class EmptyCollectionComparisonExpression extends Node 36 | { 37 | public $expression; 38 | public $not; 39 | 40 | public function __construct($expression) 41 | { 42 | $this->expression = $expression; 43 | } 44 | 45 | public function dispatch($sqlWalker) 46 | { 47 | return $sqlWalker->walkEmptyCollectionComparisonExpression($this); 48 | } 49 | } 50 | 51 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/ExistsExpression.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Query\AST; 23 | 24 | /** 25 | * ExistsExpression ::= ["NOT"] "EXISTS" "(" Subselect ")" 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 2.0 30 | * @version $Revision: 3938 $ 31 | * @author Guilherme Blanco 32 | * @author Jonathan Wage 33 | * @author Roman Borschel 34 | */ 35 | class ExistsExpression extends Node 36 | { 37 | public $not; 38 | public $subselect; 39 | 40 | public function __construct($subselect) 41 | { 42 | $this->subselect = $subselect; 43 | } 44 | 45 | public function dispatch($sqlWalker) 46 | { 47 | return $sqlWalker->walkExistsExpression($this); 48 | } 49 | } 50 | 51 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/FromClause.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Query\AST; 21 | 22 | /** 23 | * FromClause ::= "FROM" IdentificationVariableDeclaration {"," IdentificationVariableDeclaration} 24 | * 25 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 26 | * @link www.doctrine-project.org 27 | * @since 2.0 28 | * @author Guilherme Blanco 29 | * @author Jonathan Wage 30 | * @author Roman Borschel 31 | */ 32 | class FromClause extends Node 33 | { 34 | public $identificationVariableDeclarations = array(); 35 | 36 | public function __construct(array $identificationVariableDeclarations) 37 | { 38 | $this->identificationVariableDeclarations = $identificationVariableDeclarations; 39 | } 40 | 41 | public function dispatch($sqlWalker) 42 | { 43 | return $sqlWalker->walkFromClause($this); 44 | } 45 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/Functions/FunctionNode.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Query\AST\Functions; 21 | 22 | use Doctrine\ORM\Query\AST\Node; 23 | 24 | /** 25 | * Abtract Function Node. 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 2.0 30 | * @author Guilherme Blanco 31 | * @author Jonathan Wage 32 | * @author Roman Borschel 33 | * @author Benjamin Eberlei 34 | */ 35 | abstract class FunctionNode extends Node 36 | { 37 | public $name; 38 | 39 | public function __construct($name) 40 | { 41 | $this->name = $name; 42 | } 43 | 44 | abstract public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker); 45 | 46 | public function dispatch($sqlWalker) 47 | { 48 | return $sqlWalker->walkFunction($this); 49 | } 50 | 51 | abstract public function parse(\Doctrine\ORM\Query\Parser $parser); 52 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/GeneralCaseExpression.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Query\AST; 21 | 22 | /** 23 | * GeneralCaseExpression ::= "CASE" WhenClause {WhenClause}* "ELSE" ScalarExpression "END" 24 | * 25 | * @since 2.2 26 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 27 | * @link www.doctrine-project.org 28 | * @author Benjamin Eberlei 29 | * @author Guilherme Blanco 30 | * @author Jonathan Wage 31 | * @author Roman Borschel 32 | */ 33 | class GeneralCaseExpression extends Node 34 | { 35 | public $whenClauses = array(); 36 | public $elseScalarExpression = null; 37 | 38 | public function __construct(array $whenClauses, $elseScalarExpression) 39 | { 40 | $this->whenClauses = $whenClauses; 41 | $this->elseScalarExpression = $elseScalarExpression; 42 | } 43 | 44 | public function dispatch($sqlWalker) 45 | { 46 | return $sqlWalker->walkGeneralCaseExpression($this); 47 | } 48 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/GroupByClause.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Query\AST; 23 | 24 | /** 25 | * Description of GroupByClause 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 2.0 30 | * @version $Revision: 3938 $ 31 | * @author Guilherme Blanco 32 | * @author Jonathan Wage 33 | * @author Roman Borschel 34 | */ 35 | class GroupByClause extends Node 36 | { 37 | public $groupByItems = array(); 38 | 39 | public function __construct(array $groupByItems) 40 | { 41 | $this->groupByItems = $groupByItems; 42 | } 43 | 44 | public function dispatch($sqlWalker) 45 | { 46 | return $sqlWalker->walkGroupByClause($this); 47 | } 48 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/HavingClause.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Query\AST; 23 | 24 | /** 25 | * Description of HavingClause 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 2.0 30 | * @version $Revision: 3938 $ 31 | * @author Guilherme Blanco 32 | * @author Jonathan Wage 33 | * @author Roman Borschel 34 | */ 35 | class HavingClause extends Node 36 | { 37 | public $conditionalExpression; 38 | 39 | public function __construct($conditionalExpression) 40 | { 41 | $this->conditionalExpression = $conditionalExpression; 42 | } 43 | 44 | public function dispatch($sqlWalker) 45 | { 46 | return $sqlWalker->walkHavingClause($this); 47 | } 48 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/InExpression.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Query\AST; 23 | 24 | /** 25 | * InExpression ::= StateFieldPathExpression ["NOT"] "IN" "(" (Literal {"," Literal}* | Subselect) ")" 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 2.0 30 | * @version $Revision: 3938 $ 31 | * @author Guilherme Blanco 32 | * @author Jonathan Wage 33 | * @author Roman Borschel 34 | */ 35 | class InExpression extends Node 36 | { 37 | public $not; 38 | public $expression; 39 | public $literals = array(); 40 | public $subselect; 41 | 42 | public function __construct($expression) 43 | { 44 | $this->expression = $expression; 45 | } 46 | 47 | public function dispatch($sqlWalker) 48 | { 49 | return $sqlWalker->walkInExpression($this); 50 | } 51 | } 52 | 53 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/IndexBy.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Query\AST; 23 | 24 | /** 25 | * IndexBy ::= "INDEX" "BY" SimpleStateFieldPathExpression 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 2.0 30 | * @version $Revision: 3938 $ 31 | * @author Guilherme Blanco 32 | * @author Jonathan Wage 33 | * @author Roman Borschel 34 | */ 35 | class IndexBy extends Node 36 | { 37 | public $simpleStateFieldPathExpression = null; 38 | 39 | public function __construct($simpleStateFieldPathExpression) 40 | { 41 | $this->simpleStateFieldPathExpression = $simpleStateFieldPathExpression; 42 | } 43 | 44 | public function dispatch($sqlWalker) 45 | { 46 | return $sqlWalker->walkIndexBy($this); 47 | } 48 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/JoinVariableDeclaration.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Query\AST; 23 | 24 | /** 25 | * JoinVariableDeclaration ::= Join [IndexBy] 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 2.0 30 | * @version $Revision: 3938 $ 31 | * @author Guilherme Blanco 32 | * @author Jonathan Wage 33 | * @author Roman Borschel 34 | */ 35 | class JoinVariableDeclaration extends Node 36 | { 37 | public $join = null; 38 | public $indexBy = null; 39 | 40 | public function __construct($join, $indexBy) 41 | { 42 | $this->join = $join; 43 | $this->indexBy = $indexBy; 44 | } 45 | 46 | public function dispatch($sqlWalker) 47 | { 48 | return $sqlWalker->walkJoinVariableDeclaration($this); 49 | } 50 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/Literal.php: -------------------------------------------------------------------------------- 1 | type = $type; 17 | $this->value = $value; 18 | } 19 | 20 | public function dispatch($walker) 21 | { 22 | return $walker->walkLiteral($this); 23 | } 24 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/NullComparisonExpression.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Query\AST; 23 | 24 | /** 25 | * NullComparisonExpression ::= (SingleValuedPathExpression | InputParameter) "IS" ["NOT"] "NULL" 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 2.0 30 | * @version $Revision: 3938 $ 31 | * @author Guilherme Blanco 32 | * @author Jonathan Wage 33 | * @author Roman Borschel 34 | */ 35 | class NullComparisonExpression extends Node 36 | { 37 | public $not; 38 | public $expression; 39 | 40 | public function __construct($expression) 41 | { 42 | $this->expression = $expression; 43 | } 44 | 45 | public function dispatch($sqlWalker) 46 | { 47 | return $sqlWalker->walkNullComparisonExpression($this); 48 | } 49 | } 50 | 51 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/NullIfExpression.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Query\AST; 21 | 22 | /** 23 | * NullIfExpression ::= "NULLIF" "(" ScalarExpression "," ScalarExpression ")" 24 | * 25 | * @since 2.1 26 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 27 | * @link www.doctrine-project.org 28 | * @author Benjamin Eberlei 29 | * @author Guilherme Blanco 30 | * @author Jonathan Wage 31 | * @author Roman Borschel 32 | */ 33 | class NullIfExpression extends Node 34 | { 35 | public $firstExpression; 36 | 37 | public $secondExpression; 38 | 39 | public function __construct($firstExpression, $secondExpression) 40 | { 41 | $this->firstExpression = $firstExpression; 42 | $this->secondExpression = $secondExpression; 43 | } 44 | 45 | public function dispatch($sqlWalker) 46 | { 47 | return $sqlWalker->walkNullIfExpression($this); 48 | } 49 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/OrderByClause.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Query\AST; 23 | 24 | /** 25 | * OrderByClause ::= "ORDER" "BY" OrderByItem {"," OrderByItem}* 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 2.0 30 | * @version $Revision: 3938 $ 31 | * @author Guilherme Blanco 32 | * @author Jonathan Wage 33 | * @author Roman Borschel 34 | */ 35 | class OrderByClause extends Node 36 | { 37 | public $orderByItems = array(); 38 | 39 | public function __construct(array $orderByItems) 40 | { 41 | $this->orderByItems = $orderByItems; 42 | } 43 | 44 | public function dispatch($sqlWalker) 45 | { 46 | return $sqlWalker->walkOrderByClause($this); 47 | } 48 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/PartialObjectExpression.php: -------------------------------------------------------------------------------- 1 | identificationVariable = $identificationVariable; 13 | $this->partialFieldSet = $partialFieldSet; 14 | } 15 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/SelectClause.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Query\AST; 23 | 24 | /** 25 | * SelectClause = "SELECT" ["DISTINCT"] SelectExpression {"," SelectExpression} 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 2.0 30 | * @version $Revision: 3938 $ 31 | * @author Guilherme Blanco 32 | * @author Jonathan Wage 33 | * @author Roman Borschel 34 | */ 35 | class SelectClause extends Node 36 | { 37 | public $isDistinct; 38 | public $selectExpressions = array(); 39 | 40 | public function __construct(array $selectExpressions, $isDistinct) 41 | { 42 | $this->isDistinct = $isDistinct; 43 | $this->selectExpressions = $selectExpressions; 44 | } 45 | 46 | public function dispatch($sqlWalker) 47 | { 48 | return $sqlWalker->walkSelectClause($this); 49 | } 50 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/SimpleArithmeticExpression.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Query\AST; 23 | 24 | /** 25 | * SimpleArithmeticExpression ::= ArithmeticTerm {("+" | "-") ArithmeticTerm}* 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 2.0 30 | * @version $Revision: 3938 $ 31 | * @author Guilherme Blanco 32 | * @author Jonathan Wage 33 | * @author Roman Borschel 34 | */ 35 | class SimpleArithmeticExpression extends Node 36 | { 37 | public $arithmeticTerms = array(); 38 | 39 | public function __construct(array $arithmeticTerms) 40 | { 41 | $this->arithmeticTerms = $arithmeticTerms; 42 | } 43 | 44 | public function dispatch($sqlWalker) 45 | { 46 | return $sqlWalker->walkSimpleArithmeticExpression($this); 47 | } 48 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/SimpleSelectClause.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Query\AST; 23 | 24 | /** 25 | * SimpleSelectClause ::= "SELECT" ["DISTINCT"] SimpleSelectExpression 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 2.0 30 | * @version $Revision: 3938 $ 31 | * @author Guilherme Blanco 32 | * @author Jonathan Wage 33 | * @author Roman Borschel 34 | */ 35 | class SimpleSelectClause extends Node 36 | { 37 | public $isDistinct = false; 38 | public $simpleSelectExpression; 39 | 40 | public function __construct($simpleSelectExpression, $isDistinct) 41 | { 42 | $this->simpleSelectExpression = $simpleSelectExpression; 43 | $this->isDistinct = $isDistinct; 44 | } 45 | 46 | public function dispatch($sqlWalker) 47 | { 48 | return $sqlWalker->walkSimpleSelectClause($this); 49 | } 50 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/SimpleSelectExpression.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Query\AST; 23 | 24 | /** 25 | * SimpleSelectExpression ::= StateFieldPathExpression | IdentificationVariable 26 | * | (AggregateExpression [["AS"] FieldAliasIdentificationVariable]) 27 | * 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @link www.doctrine-project.org 30 | * @since 2.0 31 | * @version $Revision: 3938 $ 32 | * @author Guilherme Blanco 33 | * @author Jonathan Wage 34 | * @author Roman Borschel 35 | */ 36 | class SimpleSelectExpression extends Node 37 | { 38 | public $expression; 39 | public $fieldIdentificationVariable; 40 | 41 | public function __construct($expression) 42 | { 43 | $this->expression = $expression; 44 | } 45 | 46 | public function dispatch($sqlWalker) 47 | { 48 | return $sqlWalker->walkSimpleSelectExpression($this); 49 | } 50 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/SimpleWhenClause.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Query\AST; 21 | 22 | /** 23 | * SimpleWhenClause ::= "WHEN" ScalarExpression "THEN" ScalarExpression 24 | * 25 | * @since 2.2 26 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 27 | * @link www.doctrine-project.org 28 | * @author Benjamin Eberlei 29 | * @author Guilherme Blanco 30 | * @author Jonathan Wage 31 | * @author Roman Borschel 32 | */ 33 | class SimpleWhenClause extends Node 34 | { 35 | public $caseScalarExpression = null; 36 | public $thenScalarExpression = null; 37 | 38 | public function __construct($caseScalarExpression, $thenScalarExpression) 39 | { 40 | $this->caseScalarExpression = $caseScalarExpression; 41 | $this->thenScalarExpression = $thenScalarExpression; 42 | } 43 | 44 | public function dispatch($sqlWalker) 45 | { 46 | return $sqlWalker->walkWhenClauseExpression($this); 47 | } 48 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/SubselectFromClause.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Query\AST; 23 | 24 | /** 25 | * SubselectFromClause ::= "FROM" SubselectIdentificationVariableDeclaration {"," SubselectIdentificationVariableDeclaration}* 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 2.0 30 | * @version $Revision: 3938 $ 31 | * @author Guilherme Blanco 32 | * @author Jonathan Wage 33 | * @author Roman Borschel 34 | */ 35 | class SubselectFromClause extends Node 36 | { 37 | public $identificationVariableDeclarations = array(); 38 | 39 | public function __construct(array $identificationVariableDeclarations) 40 | { 41 | $this->identificationVariableDeclarations = $identificationVariableDeclarations; 42 | } 43 | 44 | public function dispatch($sqlWalker) 45 | { 46 | return $sqlWalker->walkSubselectFromClause($this); 47 | } 48 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/UpdateStatement.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Query\AST; 23 | 24 | /** 25 | * UpdateStatement = UpdateClause [WhereClause] 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 2.0 30 | * @version $Revision: 3938 $ 31 | * @author Guilherme Blanco 32 | * @author Jonathan Wage 33 | * @author Roman Borschel 34 | */ 35 | class UpdateStatement extends Node 36 | { 37 | public $updateClause; 38 | public $whereClause; 39 | 40 | public function __construct($updateClause) 41 | { 42 | $this->updateClause = $updateClause; 43 | } 44 | 45 | public function dispatch($sqlWalker) 46 | { 47 | return $sqlWalker->walkUpdateStatement($this); 48 | } 49 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/WhenClause.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Query\AST; 21 | 22 | /** 23 | * WhenClause ::= "WHEN" ConditionalExpression "THEN" ScalarExpression 24 | * 25 | * @since 2.2 26 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 27 | * @link www.doctrine-project.org 28 | * @author Benjamin Eberlei 29 | * @author Guilherme Blanco 30 | * @author Jonathan Wage 31 | * @author Roman Borschel 32 | */ 33 | class WhenClause extends Node 34 | { 35 | public $caseConditionExpression = null; 36 | public $thenScalarExpression = null; 37 | 38 | public function __construct($caseConditionExpression, $thenScalarExpression) 39 | { 40 | $this->caseConditionExpression = $caseConditionExpression; 41 | $this->thenScalarExpression = $thenScalarExpression; 42 | } 43 | 44 | public function dispatch($sqlWalker) 45 | { 46 | return $sqlWalker->walkWhenClauseExpression($this); 47 | } 48 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/AST/WhereClause.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Query\AST; 23 | 24 | /** 25 | * WhereClause ::= "WHERE" ConditionalExpression 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 2.0 30 | * @version $Revision: 3938 $ 31 | * @author Guilherme Blanco 32 | * @author Jonathan Wage 33 | * @author Roman Borschel 34 | */ 35 | class WhereClause extends Node 36 | { 37 | public $conditionalExpression; 38 | 39 | public function __construct($conditionalExpression) 40 | { 41 | $this->conditionalExpression = $conditionalExpression; 42 | } 43 | 44 | public function dispatch($sqlWalker) 45 | { 46 | return $sqlWalker->walkWhereClause($this); 47 | } 48 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/Exec/SingleSelectExecutor.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Query\Exec; 21 | 22 | use Doctrine\DBAL\Connection, 23 | Doctrine\ORM\Query\AST\SelectStatement, 24 | Doctrine\ORM\Query\SqlWalker; 25 | 26 | /** 27 | * Executor that executes the SQL statement for simple DQL SELECT statements. 28 | * 29 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 30 | * @author Roman Borschel 31 | * @link www.doctrine-project.org 32 | * @since 2.0 33 | */ 34 | class SingleSelectExecutor extends AbstractSqlExecutor 35 | { 36 | public function __construct(SelectStatement $AST, SqlWalker $sqlWalker) 37 | { 38 | $this->_sqlStatements = $sqlWalker->walkSelectStatement($AST); 39 | } 40 | 41 | /** 42 | * {@inheritDoc} 43 | */ 44 | public function execute(Connection $conn, array $params, array $types) 45 | { 46 | return $conn->executeQuery($this->_sqlStatements, $params, $types, $this->queryCacheProfile); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/Expr/Andx.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Query\Expr; 23 | 24 | /** 25 | * Expression class for building DQL and parts 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 2.0 30 | * @version $Revision$ 31 | * @author Guilherme Blanco 32 | * @author Jonathan Wage 33 | * @author Roman Borschel 34 | */ 35 | class Andx extends Composite 36 | { 37 | protected $_separator = ' AND '; 38 | protected $_allowedClasses = array( 39 | 'Doctrine\ORM\Query\Expr\Comparison', 40 | 'Doctrine\ORM\Query\Expr\Func', 41 | 'Doctrine\ORM\Query\Expr\Orx', 42 | 'Doctrine\ORM\Query\Expr\Andx', 43 | ); 44 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/Expr/Func.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Query\Expr; 23 | 24 | /** 25 | * Expression class for generating DQL functions 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 2.0 30 | * @version $Revision$ 31 | * @author Guilherme Blanco 32 | * @author Jonathan Wage 33 | * @author Roman Borschel 34 | */ 35 | class Func 36 | { 37 | private $_name; 38 | private $_arguments; 39 | 40 | public function __construct($name, $arguments) 41 | { 42 | $this->_name = $name; 43 | $this->_arguments = (array) $arguments; 44 | } 45 | 46 | public function __toString() 47 | { 48 | return $this->_name . '(' . implode(', ', $this->_arguments) . ')'; 49 | } 50 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/Expr/GroupBy.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Query\Expr; 23 | 24 | /** 25 | * Expression class for building DQL Group By parts 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 2.0 30 | * @version $Revision$ 31 | * @author Guilherme Blanco 32 | * @author Jonathan Wage 33 | * @author Roman Borschel 34 | */ 35 | class GroupBy extends Base 36 | { 37 | protected $_preSeparator = ''; 38 | protected $_postSeparator = ''; 39 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/Expr/Literal.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Query\Expr; 23 | 24 | /** 25 | * Expression class for building DQL OR clauses 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 2.0 30 | * @version $Revision$ 31 | * @author Guilherme Blanco 32 | * @author Jonathan Wage 33 | * @author Roman Borschel 34 | */ 35 | class Orx extends Composite 36 | { 37 | protected $_separator = ' OR '; 38 | protected $_allowedClasses = array( 39 | 'Doctrine\ORM\Query\Expr\Comparison', 40 | 'Doctrine\ORM\Query\Expr\Func', 41 | 'Doctrine\ORM\Query\Expr\Andx', 42 | 'Doctrine\ORM\Query\Expr\Orx', 43 | ); 44 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Query/Expr/Select.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Query\Expr; 23 | 24 | /** 25 | * Expression class for building DQL select statements 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 2.0 30 | * @version $Revision$ 31 | * @author Guilherme Blanco 32 | * @author Jonathan Wage 33 | * @author Roman Borschel 34 | */ 35 | class Select extends Base 36 | { 37 | protected $_preSeparator = ''; 38 | protected $_postSeparator = ''; 39 | protected $_allowedClasses = array( 40 | 'Doctrine\ORM\Query\Expr\Func' 41 | ); 42 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Tools/Export/ExportException.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM\Tools; 23 | 24 | class ToolEvents 25 | { 26 | /** 27 | * The postGenerateSchemaTable event occurs in SchemaTool#getSchemaFromMetadata() 28 | * whenever an entity class is transformed into its table representation. It recieves 29 | * the current non-complete Schema instance, the Entities Metadata Class instance and 30 | * the Schema Table instance of this entity. 31 | * 32 | * @var string 33 | */ 34 | const postGenerateSchemaTable = 'postGenerateSchemaTable'; 35 | 36 | /** 37 | * The postGenerateSchema event is triggered in SchemaTool#getSchemaFromMetadata() 38 | * after all entity classes have been transformed into the related Schema structure. 39 | * The EventArgs contain the EntityManager and the created Schema instance. 40 | * 41 | * @var string 42 | */ 43 | const postGenerateSchema = 'postGenerateSchema'; 44 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/Tools/ToolsException.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | namespace Doctrine\ORM\Tools; 21 | 22 | use Doctrine\ORM\ORMException; 23 | 24 | /** 25 | * Tools related Exceptions 26 | * 27 | * @author Benjamin Eberlei 28 | */ 29 | class ToolsException extends ORMException 30 | { 31 | public static function schemaToolFailure($sql, \Exception $e) 32 | { 33 | return new self("Schema-Tool failed with Error '" . $e->getMessage() . "' while executing DDL: " . $sql, "0", $e); 34 | } 35 | 36 | public static function couldNotMapDoctrine1Type($type) 37 | { 38 | return new self("Could not map doctrine 1 type '$type'!"); 39 | } 40 | } -------------------------------------------------------------------------------- /Infrastructure/Vendors/Doctrine/ORM/TransactionRequiredException.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | namespace Doctrine\ORM; 23 | 24 | /** 25 | * Is thrown when a transaction is required for the current operation, but there is none open. 26 | * 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.com 29 | * @since 1.0 30 | * @version $Revision$ 31 | * @author Benjamin Eberlei 32 | * @author Roman Borschel 33 | */ 34 | class TransactionRequiredException extends ORMException 35 | { 36 | static public function transactionRequired() 37 | { 38 | return new self('An open transaction is required for this operation.'); 39 | } 40 | } -------------------------------------------------------------------------------- /Test/Integration/Infrastructure/Persistence/PersistenceTestCase.php: -------------------------------------------------------------------------------- 1 | conn === null) { 19 | if (self::$pdo == null) { 20 | self::$pdo = new \PDO( $GLOBALS['DB_DSN'], $GLOBALS['DB_USER'], $GLOBALS['DB_PASSWD'] ); 21 | } 22 | $this->conn = $this->createDefaultDBConnection(self::$pdo, $GLOBALS['DB_DBNAME']); 23 | $this->initDbal(); 24 | } 25 | 26 | return $this->conn; 27 | } 28 | 29 | public function getDataSet() 30 | { 31 | $this->setupTable(); 32 | return $this->createXmlDataSet(dirname(__FILE__) . DS . 'dataset.xml'); 33 | } 34 | 35 | public function getDbal() 36 | { 37 | return $this->dbal; 38 | } 39 | 40 | protected function initDbal() 41 | { 42 | $isDevMode = true; 43 | $config = Setup::createXMLMetadataConfiguration(array(DBAL_XML),$isDevMode); 44 | $this->dbal = DriverManager::getConnection(array('pdo' => self::$pdo),$config); 45 | } 46 | 47 | protected function setupTable() 48 | { 49 | $sm = $this->dbal->getSchemaManager(); 50 | $table = $this->getTableDefinition(); 51 | $sm->dropAndCreateTable($table); 52 | } 53 | 54 | /** 55 | * @return \Doctrine\DBAL\Schema\Table $table 56 | */ 57 | abstract protected function getTableDefinition(); 58 | } -------------------------------------------------------------------------------- /Test/Integration/Infrastructure/Persistence/dataset.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | id 5 | 6 | 1 7 | 8 | 9 | 2 10 | 11 | 12 | 3 13 | 14 |
15 |
-------------------------------------------------------------------------------- /Test/Integration/Infrastructure/Services/ConsoleTest.php: -------------------------------------------------------------------------------- 1 | console = new Console(); 14 | } 15 | 16 | public function testWriteLineToStdout() 17 | { 18 | $bytes = $this->console->writeLine("hello"); 19 | $this->assertEquals(6,$bytes); 20 | } 21 | 22 | public function testConsoleInput() 23 | { 24 | $ret = $this->console->input("input",array( 25 | "input" => function($c) { 26 | return 'test'; 27 | } 28 | )); 29 | $this->assertEquals("test",$ret); 30 | } 31 | 32 | public function testConsoleInputDefaultFunction() 33 | { 34 | $ret = $this->console->input("input",array( 35 | 'default' => function($c) { 36 | return 'default'; 37 | } 38 | )); 39 | $this->assertEquals('default',$ret); 40 | } 41 | 42 | /** 43 | * @expectedException \InvalidArgumentException 44 | */ 45 | public function testConsoleFunctionArrayHasAllCallable() 46 | { 47 | $ret = $this->console->input("input",array( 48 | 'input' => 'string', 49 | 'default' => function($c) { 50 | return 'default'; 51 | } 52 | )); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Test/Unit/Domain/Services/FishingTestCase.php: -------------------------------------------------------------------------------- 1 | getProperty('id'); 16 | $idProp->setAccessible(true); 17 | $idProp->setValue($fish,$id); 18 | return $fish; 19 | } 20 | 21 | protected function setUpRepoAll($matcher,$returnValue) 22 | { 23 | $this->repo->expects($matcher) 24 | ->method('all') 25 | ->will($this->returnValue($returnValue)); 26 | } 27 | } -------------------------------------------------------------------------------- /Test/Unit/Domain/Services/PondStockerTest.php: -------------------------------------------------------------------------------- 1 | repoMock = $this->getMock('Domain\Repositories\IFishRepository'); 18 | $this->stocker = new PondStocker(new Pond($this->repoMock)); 19 | } 20 | 21 | public function testGetPondReturnsPondInstance() 22 | { 23 | $this->assertInstanceOf('Domain\Services\Pond',$this->stocker->getPond()); 24 | } 25 | 26 | public function testStockNewFishWithEmptyRepoStocksPond() 27 | { 28 | $this->repoAllWillReturn(array()); 29 | 30 | $this->repoMock->expects($this->exactly(3)) 31 | ->method('store'); 32 | 33 | $this->stocker->stock(3); 34 | 35 | $this->assertEquals(3,$this->stocker->getPond()->getFishCount()); 36 | } 37 | 38 | public function testStockNewFishWithExistingFishStocksPond() 39 | { 40 | $fixture = array(new Fish(),new Fish(), new Fish()); 41 | 42 | $this->repoAllWillReturn($fixture); 43 | 44 | $this->stocker->stock(3); 45 | 46 | $this->assertEquals(6,$this->stocker->getPond()->getFishCount()); 47 | } 48 | 49 | public function testPondIsEmptyReturnsTrueWhenNone() 50 | { 51 | $this->assertTrue($this->stocker->pondIsEmpty()); 52 | } 53 | 54 | public function testPondIsEmptyFalsWhenFishInPond() 55 | { 56 | $this->repoAllWillReturn(array()); 57 | 58 | $this->stocker->stock(3); 59 | 60 | $this->assertFalse($this->stocker->pondIsEmpty()); 61 | } 62 | 63 | private function repoAllWillReturn($returnValue) 64 | { 65 | $this->repoMock->expects($this->once()) 66 | ->method('all') 67 | ->will($this->returnValue($returnValue)); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /Test/bootstrap.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app.php: -------------------------------------------------------------------------------- 1 | stock(3); 22 | 23 | //our lone fisherman needs to start fishing 24 | $fisherman = new Fisherman($stocker->getPond()); 25 | 26 | //this is the main application loop 27 | $console->writeLine("It's time to go fishing! Pick from the options below:"); 28 | while(!$stocker->pondIsEmpty()) 29 | { 30 | $console->writeLine("[1] Cast, [2] Quit"); 31 | $console->input(trim(fgets(STDIN)),array( 32 | 1 => function($c) use($fisherman,$stocker) { 33 | $fish = $fisherman->cast(); 34 | if(!is_null($fish)) { 35 | $c->writeLine("You caught one!"); 36 | if($stocker->pondIsEmpty()) { 37 | $c->writeLine("Looks like this pond is out of fish....."); 38 | exit; 39 | } 40 | } else { 41 | $c->writeLine("Oh darn! Try casting one or two more times."); 42 | } 43 | }, 44 | 2 => function($c) { 45 | $c->writeLine("Good call... there will probably be more fish when you come back."); 46 | exit; 47 | }, 48 | 'default' => function($c) { 49 | $c->writeLine("That option isn't recognized. Try again."); 50 | } 51 | )); 52 | } -------------------------------------------------------------------------------- /environment.php: -------------------------------------------------------------------------------- 1 |