diff --git a/app/AppKernel.php b/app/AppKernel.php index 3789b32..4fa2d1b 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -14,8 +14,9 @@ public function registerBundles() new Symfony\Bundle\MonologBundle\MonologBundle(), new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(), new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), + new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(), new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), - new AppBundle\AppBundle(), + new TenjavaBundle\TenjavaBundle(), ]; if (in_array($this->getEnvironment(), ['dev', 'test'], true)) { diff --git a/app/DoctrineMigrations/Version20160908202013.php b/app/DoctrineMigrations/Version20160908202013.php new file mode 100644 index 0000000..72718aa --- /dev/null +++ b/app/DoctrineMigrations/Version20160908202013.php @@ -0,0 +1,57 @@ +addSql([ + 'create table roles ( + id serial primary key not null, + name character varying (255) not null + )', + 'create table users ( + id serial primary key not null, + username character varying (255) unique not null, + email character varying (255) unique not null, + role_id integer references roles(id) not null + )', + 'create table donations ( + id serial primary key not null, + user_id integer references users(id), -- not null, can be anonymous + amount numeric(2) not null, + payment_type character varying (255) not null, + message text + )', + 'create table teams ( + id serial primary key not null, + leader integer references users(id) not null, + name character varying (255) unique not null, + general_rules text, + prize_rules text + )', + 'create table team_members ( + user_id integer references users(id) not null, + team_id integer references teams(id) not null, + application_accepted boolean default false not null, + agreed_on_team_name boolean default true not null, + agreed_on_rules boolean default true not null, + constraint team_members_pk primary key (user_id, team_id) + )', + 'insert into roles (name) values (\'contestant\'), (\'judge\'), (\'organizer\')' + ]); + } + + public function down(Schema $schema) { + $this->addSql([ + 'drop table team_members', + 'drop table teams', + 'drop table donations', + 'drop table users', + 'drop table roles', + ]); + } +} diff --git a/app/DoctrineMigrations/Version20160909135354.php b/app/DoctrineMigrations/Version20160909135354.php new file mode 100644 index 0000000..27d2506 --- /dev/null +++ b/app/DoctrineMigrations/Version20160909135354.php @@ -0,0 +1,23 @@ +addSql([ + 'alter table teams add column max_size integer default 2 not null', + 'alter table teams add column private boolean default true not null', + ]); + } + + public function down(Schema $schema) { + $this->addSql([ + 'alter table teams drop column max_size', + 'alter table teams drop column private', + ]); + } +} diff --git a/app/config/config.yml b/app/config/config.yml index 3292445..c672168 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -40,7 +40,7 @@ twig: # Doctrine Configuration doctrine: dbal: - driver: pdo_mysql + driver: pdo_pgsql host: "%database_host%" port: "%database_port%" dbname: "%database_name%" diff --git a/app/config/routing.yml b/app/config/routing.yml index 8eadc31..e17f9ad 100644 --- a/app/config/routing.yml +++ b/app/config/routing.yml @@ -1,3 +1,7 @@ -app: - resource: "@AppBundle/Controller/" - type: annotation +#app: +# resource: "@TenjavaBundle/Controller/" +# type: annotation + +homepage: + path: / + defaults: { _controller: \TenjavaBundle\Controller\DefaultController::indexAction } diff --git a/composer.json b/composer.json index 3bc0ea1..7f33f5a 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,8 @@ "symfony/polyfill-apcu": "^1.0", "sensio/distribution-bundle": "^5.0", "sensio/framework-extra-bundle": "^3.0.2", - "incenteev/composer-parameter-handler": "^2.0" + "incenteev/composer-parameter-handler": "^2.0", + "doctrine/doctrine-migrations-bundle": "1.*" }, "require-dev": { "sensio/generator-bundle": "^3.0", diff --git a/composer.lock b/composer.lock index 9004672..d54f839 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "8a4f83da0d6ebec4ea9c8d13e2a8622b", - "content-hash": "4be3c063eb6331a8a3de74d3393dee92", + "hash": "cc076ff814119f38825424cedfd86ce8", + "content-hash": "a4d2a1094d7869095fa0b1c1f809a20c", "packages": [ { "name": "doctrine/annotations", @@ -357,16 +357,16 @@ }, { "name": "doctrine/doctrine-bundle", - "version": "1.6.3", + "version": "1.6.4", "source": { "type": "git", "url": "https://github.com/doctrine/DoctrineBundle.git", - "reference": "fd51907c6c76acaa8a5234822a4f901c1500afc1" + "reference": "dd40b0a7fb16658cda9def9786992b8df8a49be7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/DoctrineBundle/zipball/fd51907c6c76acaa8a5234822a4f901c1500afc1", - "reference": "fd51907c6c76acaa8a5234822a4f901c1500afc1", + "url": "https://api.github.com/repos/doctrine/DoctrineBundle/zipball/dd40b0a7fb16658cda9def9786992b8df8a49be7", + "reference": "dd40b0a7fb16658cda9def9786992b8df8a49be7", "shasum": "" }, "require": { @@ -375,6 +375,7 @@ "jdorn/sql-formatter": "~1.1", "php": ">=5.3.2", "symfony/console": "~2.3|~3.0", + "symfony/dependency-injection": "~2.3|~3.0", "symfony/doctrine-bridge": "~2.2|~3.0", "symfony/framework-bundle": "~2.3|~3.0" }, @@ -433,7 +434,7 @@ "orm", "persistence" ], - "time": "2016-04-21 19:55:56" + "time": "2016-08-10 15:35:22" }, { "name": "doctrine/doctrine-cache-bundle", @@ -523,6 +524,67 @@ ], "time": "2016-01-26 17:28:51" }, + { + "name": "doctrine/doctrine-migrations-bundle", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/DoctrineMigrationsBundle.git", + "reference": "0b89ee55bceb53c60bc4ba32924ac5053e377abb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/DoctrineMigrationsBundle/zipball/0b89ee55bceb53c60bc4ba32924ac5053e377abb", + "reference": "0b89ee55bceb53c60bc4ba32924ac5053e377abb", + "shasum": "" + }, + "require": { + "doctrine/doctrine-bundle": "~1.0", + "doctrine/migrations": "^1.1", + "php": ">=5.4.0", + "symfony/framework-bundle": "~2.3|~3.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8" + }, + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Bundle\\MigrationsBundle\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Doctrine Project", + "homepage": "http://www.doctrine-project.org" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony DoctrineMigrationsBundle", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "dbal", + "migrations", + "schema" + ], + "time": "2016-06-30 19:26:35" + }, { "name": "doctrine/inflector", "version": "v1.1.0", @@ -698,6 +760,79 @@ ], "time": "2014-09-09 13:34:57" }, + { + "name": "doctrine/migrations", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/migrations.git", + "reference": "0d0ff5da10c5d30846da32060bd9e357abf70a05" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/migrations/zipball/0d0ff5da10c5d30846da32060bd9e357abf70a05", + "reference": "0d0ff5da10c5d30846da32060bd9e357abf70a05", + "shasum": "" + }, + "require": { + "doctrine/dbal": "~2.2", + "ocramius/proxy-manager": "^1.0|^2.0", + "php": "^5.5|^7.0", + "symfony/console": "~2.3|~3.0", + "symfony/yaml": "~2.3|~3.0" + }, + "require-dev": { + "doctrine/coding-standard": "dev-master", + "doctrine/orm": "2.*", + "jdorn/sql-formatter": "~1.1", + "johnkary/phpunit-speedtrap": "~1.0@dev", + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "~4.7", + "satooshi/php-coveralls": "0.6.*" + }, + "suggest": { + "jdorn/sql-formatter": "Allows to generate formatted SQL with the diff command." + }, + "bin": [ + "bin/doctrine-migrations" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "v1.5.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\DBAL\\Migrations\\": "lib/Doctrine/DBAL/Migrations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1" + ], + "authors": [ + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Michael Simonson", + "email": "contact@mikesimonson.com" + } + ], + "description": "Database Schema migrations using Doctrine DBAL", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "database", + "migrations" + ], + "time": "2016-03-14 12:29:11" + }, { "name": "doctrine/orm", "version": "v2.5.4", @@ -877,16 +1012,16 @@ }, { "name": "monolog/monolog", - "version": "1.20.0", + "version": "1.21.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "55841909e2bcde01b5318c35f2b74f8ecc86e037" + "reference": "f42fbdfd53e306bda545845e4dbfd3e72edb4952" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/55841909e2bcde01b5318c35f2b74f8ecc86e037", - "reference": "55841909e2bcde01b5318c35f2b74f8ecc86e037", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/f42fbdfd53e306bda545845e4dbfd3e72edb4952", + "reference": "f42fbdfd53e306bda545845e4dbfd3e72edb4952", "shasum": "" }, "require": { @@ -951,7 +1086,70 @@ "logging", "psr-3" ], - "time": "2016-07-02 14:02:10" + "time": "2016-07-29 03:23:52" + }, + { + "name": "ocramius/proxy-manager", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/Ocramius/ProxyManager.git", + "reference": "57e9272ec0e8deccf09421596e0e2252df440e11" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Ocramius/ProxyManager/zipball/57e9272ec0e8deccf09421596e0e2252df440e11", + "reference": "57e9272ec0e8deccf09421596e0e2252df440e11", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "zendframework/zend-code": ">2.2.5,<3.0" + }, + "require-dev": { + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "1.5.*" + }, + "suggest": { + "ocramius/generated-hydrator": "To have very fast object to array to object conversion for ghost objects", + "zendframework/zend-json": "To have the JsonRpc adapter (Remote Object feature)", + "zendframework/zend-soap": "To have the Soap adapter (Remote Object feature)", + "zendframework/zend-stdlib": "To use the hydrator proxy", + "zendframework/zend-xmlrpc": "To have the XmlRpc adapter (Remote Object feature)" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "ProxyManager\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A library providing utilities to generate, instantiate and generally operate with Object Proxies", + "homepage": "https://github.com/Ocramius/ProxyManager", + "keywords": [ + "aop", + "lazy loading", + "proxy", + "proxy pattern", + "service proxies" + ], + "time": "2015-08-09 04:28:19" }, { "name": "paragonie/random_compat", @@ -1003,16 +1201,16 @@ }, { "name": "psr/cache", - "version": "1.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/php-fig/cache.git", - "reference": "9e66031f41fbbdda45ee11e93c45d480ccba3eb3" + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/9e66031f41fbbdda45ee11e93c45d480ccba3eb3", - "reference": "9e66031f41fbbdda45ee11e93c45d480ccba3eb3", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", "shasum": "" }, "require": { @@ -1045,7 +1243,7 @@ "psr", "psr-6" ], - "time": "2015-12-11 02:52:07" + "time": "2016-08-06 20:24:11" }, { "name": "psr/log", @@ -1087,16 +1285,16 @@ }, { "name": "sensio/distribution-bundle", - "version": "v5.0.7", + "version": "v5.0.9", "source": { "type": "git", "url": "https://github.com/sensiolabs/SensioDistributionBundle.git", - "reference": "a9c4723cbdbc6cf7fbfdfde3c639cb1943f0293a" + "reference": "e5e0d8d06b07864b2752bd865537b0817edf4c5a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sensiolabs/SensioDistributionBundle/zipball/a9c4723cbdbc6cf7fbfdfde3c639cb1943f0293a", - "reference": "a9c4723cbdbc6cf7fbfdfde3c639cb1943f0293a", + "url": "https://api.github.com/repos/sensiolabs/SensioDistributionBundle/zipball/e5e0d8d06b07864b2752bd865537b0817edf4c5a", + "reference": "e5e0d8d06b07864b2752bd865537b0817edf4c5a", "shasum": "" }, "require": { @@ -1135,7 +1333,7 @@ "configuration", "distribution" ], - "time": "2016-06-23 16:11:33" + "time": "2016-09-06 01:05:01" }, { "name": "sensio/framework-extra-bundle", @@ -1752,16 +1950,16 @@ }, { "name": "symfony/symfony", - "version": "v3.1.3", + "version": "v3.1.4", "source": { "type": "git", "url": "https://github.com/symfony/symfony.git", - "reference": "4478f047409028dc6e3ab320590f1247fec7a850" + "reference": "65ca9e4fbdb34f6d463ef77898ca583b101a4162" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/symfony/zipball/4478f047409028dc6e3ab320590f1247fec7a850", - "reference": "4478f047409028dc6e3ab320590f1247fec7a850", + "url": "https://api.github.com/repos/symfony/symfony/zipball/65ca9e4fbdb34f6d463ef77898ca583b101a4162", + "reference": "65ca9e4fbdb34f6d463ef77898ca583b101a4162", "shasum": "" }, "require": { @@ -1780,6 +1978,9 @@ "phpdocumentor/reflection-docblock": "<3.0", "phpdocumentor/type-resolver": "<0.2.0" }, + "provide": { + "psr/cache-implementation": "1.0" + }, "replace": { "symfony/asset": "self.version", "symfony/browser-kit": "self.version", @@ -1801,6 +2002,7 @@ "symfony/framework-bundle": "self.version", "symfony/http-foundation": "self.version", "symfony/http-kernel": "self.version", + "symfony/inflector": "self.version", "symfony/intl": "self.version", "symfony/ldap": "self.version", "symfony/monolog-bridge": "self.version", @@ -1884,20 +2086,20 @@ "keywords": [ "framework" ], - "time": "2016-07-30 09:31:00" + "time": "2016-09-03 15:28:43" }, { "name": "twig/twig", - "version": "v1.24.1", + "version": "v1.24.2", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "3566d311a92aae4deec6e48682dc5a4528c4a512" + "reference": "33093f6e310e6976baeac7b14f3a6ec02f2d79b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/3566d311a92aae4deec6e48682dc5a4528c4a512", - "reference": "3566d311a92aae4deec6e48682dc5a4528c4a512", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/33093f6e310e6976baeac7b14f3a6ec02f2d79b7", + "reference": "33093f6e310e6976baeac7b14f3a6ec02f2d79b7", "shasum": "" }, "require": { @@ -1945,22 +2147,128 @@ "keywords": [ "templating" ], - "time": "2016-05-30 09:11:59" + "time": "2016-09-01 17:50:53" + }, + { + "name": "zendframework/zend-code", + "version": "2.6.3", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-code.git", + "reference": "95033f061b083e16cdee60530ec260d7d628b887" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-code/zipball/95033f061b083e16cdee60530ec260d7d628b887", + "reference": "95033f061b083e16cdee60530ec260d7d628b887", + "shasum": "" + }, + "require": { + "php": "^5.5 || 7.0.0 - 7.0.4 || ^7.0.6", + "zendframework/zend-eventmanager": "^2.6 || ^3.0" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "^4.8.21", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "suggest": { + "doctrine/annotations": "Doctrine\\Common\\Annotations >=1.0 for annotation features", + "zendframework/zend-stdlib": "Zend\\Stdlib component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev", + "dev-develop": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Code\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides facilities to generate arbitrary code using an object oriented interface", + "homepage": "https://github.com/zendframework/zend-code", + "keywords": [ + "code", + "zf2" + ], + "time": "2016-04-20 17:26:42" + }, + { + "name": "zendframework/zend-eventmanager", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-eventmanager.git", + "reference": "5c80bdee0e952be112dcec0968bad770082c3a6e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/5c80bdee0e952be112dcec0968bad770082c3a6e", + "reference": "5c80bdee0e952be112dcec0968bad770082c3a6e", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0" + }, + "require-dev": { + "athletic/athletic": "^0.1", + "container-interop/container-interop": "^1.1.0", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "^2.0", + "zendframework/zend-stdlib": "^2.7.3 || ^3.0" + }, + "suggest": { + "container-interop/container-interop": "^1.1.0, to use the lazy listeners feature", + "zendframework/zend-stdlib": "^2.7.3 || ^3.0, to use the FilterChain feature" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev", + "dev-develop": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\EventManager\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Trigger and listen to events within a PHP application", + "homepage": "https://github.com/zendframework/zend-eventmanager", + "keywords": [ + "event", + "eventmanager", + "events", + "zf2" + ], + "time": "2016-02-18 20:53:00" } ], "packages-dev": [ { "name": "sensio/generator-bundle", - "version": "v3.0.7", + "version": "v3.0.8", "source": { "type": "git", "url": "https://github.com/sensiolabs/SensioGeneratorBundle.git", - "reference": "d1be460925376703a470a3ac6ec034eb7eab3892" + "reference": "3c20d16512f37d2be159eca0411b99a141b90fa4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sensiolabs/SensioGeneratorBundle/zipball/d1be460925376703a470a3ac6ec034eb7eab3892", - "reference": "d1be460925376703a470a3ac6ec034eb7eab3892", + "url": "https://api.github.com/repos/sensiolabs/SensioGeneratorBundle/zipball/3c20d16512f37d2be159eca0411b99a141b90fa4", + "reference": "3c20d16512f37d2be159eca0411b99a141b90fa4", "shasum": "" }, "require": { @@ -1999,20 +2307,20 @@ } ], "description": "This bundle generates code for you", - "time": "2016-06-20 05:58:05" + "time": "2016-09-06 01:30:19" }, { "name": "symfony/phpunit-bridge", - "version": "v3.1.3", + "version": "v3.1.4", "source": { "type": "git", "url": "https://github.com/symfony/phpunit-bridge.git", - "reference": "eeb3bf9a195df7552fdda46f4724a9442d157413" + "reference": "1f4e2059cf4ecae1053b9c3027b3fc548fd077b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/eeb3bf9a195df7552fdda46f4724a9442d157413", - "reference": "eeb3bf9a195df7552fdda46f4724a9442d157413", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/1f4e2059cf4ecae1053b9c3027b3fc548fd077b9", + "reference": "1f4e2059cf4ecae1053b9c3027b3fc548fd077b9", "shasum": "" }, "require": { @@ -2054,7 +2362,7 @@ ], "description": "Symfony PHPUnit Bridge", "homepage": "https://symfony.com", - "time": "2016-06-29 05:42:25" + "time": "2016-08-19 06:48:39" } ], "aliases": [], diff --git a/src/AppBundle/AppBundle.php b/src/AppBundle/AppBundle.php deleted file mode 100644 index 05123b6..0000000 --- a/src/AppBundle/AppBundle.php +++ /dev/null @@ -1,9 +0,0 @@ -render('default/index.html.twig', [ - 'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..'), - ]); - } -} diff --git a/src/TenjavaBundle/Controller/DefaultController.php b/src/TenjavaBundle/Controller/DefaultController.php new file mode 100644 index 0000000..7f17754 --- /dev/null +++ b/src/TenjavaBundle/Controller/DefaultController.php @@ -0,0 +1,19 @@ +getDoctrine()->getRepository(Role::class); + dump($repository->findAll()); + + return $this->render('TenjavaBundle::default/index.html.twig'); + } + +} diff --git a/src/TenjavaBundle/Entity/Donation.php b/src/TenjavaBundle/Entity/Donation.php new file mode 100644 index 0000000..5c3e39a --- /dev/null +++ b/src/TenjavaBundle/Entity/Donation.php @@ -0,0 +1,56 @@ +id; + } + + public function setAmount(float $amount): Donation { + $this->amount = $amount; + + return $this; + } + + public function getAmount(): string { + return $this->amount; + } + + public function setPaymentType(string $paymentType): Donation { + $this->paymentType = $paymentType; + + return $this; + } + + public function getPaymentType(): string { + return $this->paymentType; + } + + public function setMessage(?string $message): Donation { + $this->message = $message; + + return $this; + } + + public function getMessage(): ?string { + return $this->message; + } + + public function setUser(?User $user): Donation { + $this->user = $user; + + return $this; + } + + public function getUser(): ?User { + return $this->user; + } +} + diff --git a/src/TenjavaBundle/Entity/Role.php b/src/TenjavaBundle/Entity/Role.php new file mode 100644 index 0000000..91eff47 --- /dev/null +++ b/src/TenjavaBundle/Entity/Role.php @@ -0,0 +1,23 @@ +id; + } + + public function setName(string $name): Role { + $this->name = $name; + + return $this; + } + + public function getName(): string { + return $this->name; + } +} + diff --git a/src/TenjavaBundle/Entity/Team.php b/src/TenjavaBundle/Entity/Team.php new file mode 100644 index 0000000..6b1ff70 --- /dev/null +++ b/src/TenjavaBundle/Entity/Team.php @@ -0,0 +1,100 @@ +users = new ArrayCollection(); + } + + public function getId(): integer { + return $this->id; + } + + public function setName(string $name): Team { + $this->name = $name; + + return $this; + } + + public function getName(): string { + return $this->name; + } + + public function getMaxSize(): int { + return $this->maxSize; + } + + public function setMaxSize(int $maxSize): Team { + $this->maxSize = $maxSize; + + return $this; + } + + public function getPrivate(): bool { + return $this->private; + } + + public function setPrivate(bool $private): Team { + $this->private = $private; + + return $this; + } + + public function setGeneralRules(?string $generalRules): Team { + $this->generalRules = $generalRules; + + return $this; + } + + public function getGeneralRules(): ?string { + return $this->generalRules; + } + + public function setPrizeRules(?string $prizeRules): Team { + $this->prizeRules = $prizeRules; + + return $this; + } + + public function getPrizeRules(): ?string { + return $this->prizeRules; + } + + public function setLeader(User $leader = null): Team { + $this->leader = $leader; + + return $this; + } + + public function getLeader(): User { + return $this->leader; + } + + public function addUser(User $user): Team { + $this->users[] = $user; + + return $this; + } + + public function removeUser(User $user) { + $this->users->removeElement($user); + } + + public function getUsers(): Collection { + return $this->users; + } +} + diff --git a/src/TenjavaBundle/Entity/User.php b/src/TenjavaBundle/Entity/User.php new file mode 100644 index 0000000..839a396 --- /dev/null +++ b/src/TenjavaBundle/Entity/User.php @@ -0,0 +1,67 @@ +team = new ArrayCollection(); + } + + public function getId(): int { + return $this->id; + } + + public function setUsername(string $username): User { + $this->username = $username; + + return $this; + } + + public function getUsername(): string { + return $this->username; + } + + public function setEmail(string $email): User { + $this->email = $email; + + return $this; + } + + public function getEmail(): string { + return $this->email; + } + + public function setRole(Role $role): User { + $this->role = $role; + + return $this; + } + + public function getRole(): Role { + return $this->role; + } + + public function addTeam(Team $team): User { + $this->team[] = $team; + + return $this; + } + + public function removeTeam(Team $team) { + $this->team->removeElement($team); + } + + public function getTeam(): Collection { + return $this->team; + } +} + diff --git a/src/TenjavaBundle/Resources/config/doctrine/Donation.orm.yml b/src/TenjavaBundle/Resources/config/doctrine/Donation.orm.yml new file mode 100644 index 0000000..27135e4 --- /dev/null +++ b/src/TenjavaBundle/Resources/config/doctrine/Donation.orm.yml @@ -0,0 +1,47 @@ +TenjavaBundle\Entity\Donation: + type: entity + table: donations + indexes: + IDX_CDE98962A76ED395: + columns: + - user_id + id: + id: + type: integer + nullable: false + options: + unsigned: false + id: true + generator: + strategy: SEQUENCE + fields: + amount: + type: decimal + nullable: false + precision: 2 + scale: 0 + paymentType: + type: string + nullable: false + length: 255 + options: + fixed: false + column: payment_type + message: + type: text + nullable: true + length: null + options: + fixed: false + manyToOne: + user: + targetEntity: Users + cascade: { } + fetch: LAZY + mappedBy: null + inversedBy: null + joinColumns: + user_id: + referencedColumnName: id + orphanRemoval: false + lifecycleCallbacks: { } diff --git a/src/TenjavaBundle/Resources/config/doctrine/Role.orm.yml b/src/TenjavaBundle/Resources/config/doctrine/Role.orm.yml new file mode 100644 index 0000000..0208232 --- /dev/null +++ b/src/TenjavaBundle/Resources/config/doctrine/Role.orm.yml @@ -0,0 +1,20 @@ +TenjavaBundle\Entity\Role: + type: entity + table: roles + id: + id: + type: integer + nullable: false + options: + unsigned: false + id: true + generator: + strategy: SEQUENCE + fields: + name: + type: string + nullable: false + length: 255 + options: + fixed: false + lifecycleCallbacks: { } diff --git a/src/TenjavaBundle/Resources/config/doctrine/Team.orm.yml b/src/TenjavaBundle/Resources/config/doctrine/Team.orm.yml new file mode 100644 index 0000000..1ab50b9 --- /dev/null +++ b/src/TenjavaBundle/Resources/config/doctrine/Team.orm.yml @@ -0,0 +1,71 @@ +TenjavaBundle\Entity\Team: + type: entity + table: teams + indexes: + IDX_96C22258F5E3EAD7: + columns: + - leader + uniqueConstraints: + teams_name_key: + columns: + - name + id: + id: + type: integer + nullable: false + options: + unsigned: false + id: true + generator: + strategy: SEQUENCE + fields: + name: + type: string + nullable: false + length: 255 + options: + fixed: false + maxSize: + type: integer + nullable: false + options: + unsigned: false + column: max_size + private: + type: boolean + nullable: false + generalRules: + type: text + nullable: true + length: null + options: + fixed: false + column: general_rules + prizeRules: + type: text + nullable: true + length: null + options: + fixed: false + column: prize_rules + manyToOne: + leader: + targetEntity: User + cascade: { } + fetch: LAZY + mappedBy: null + inversedBy: null + joinColumns: + leader: + referencedColumnName: id + orphanRemoval: false + manyToMany: + users: + targetEntity: User + cascade: { } + fetch: LAZY + mappedBy: team + inversedBy: null + joinTable: null + orderBy: null + lifecycleCallbacks: { } diff --git a/src/TenjavaBundle/Resources/config/doctrine/User.orm.yml b/src/TenjavaBundle/Resources/config/doctrine/User.orm.yml new file mode 100644 index 0000000..ade656e --- /dev/null +++ b/src/TenjavaBundle/Resources/config/doctrine/User.orm.yml @@ -0,0 +1,66 @@ +TenjavaBundle\Entity\User: + type: entity + table: users + indexes: + IDX_1483A5E9D60322AC: + columns: + - role_id + uniqueConstraints: + users_username_key: + columns: + - username + users_email_key: + columns: + - email + id: + id: + type: integer + nullable: false + options: + unsigned: false + id: true + generator: + strategy: SEQUENCE + fields: + username: + type: string + nullable: false + length: 255 + options: + fixed: false + email: + type: string + nullable: false + length: 255 + options: + fixed: false + manyToOne: + role: + targetEntity: Role + cascade: { } + fetch: LAZY + mappedBy: null + inversedBy: null + joinColumns: + role_id: + referencedColumnName: id + orphanRemoval: false + manyToMany: + team: + targetEntity: Team + cascade: { } + fetch: LAZY + mappedBy: null + inversedBy: user + joinTable: + name: team_members + joinColumns: + - + name: user_id + referencedColumnName: id + inverseJoinColumns: + - + name: team_id + referencedColumnName: id + orderBy: null + lifecycleCallbacks: { } diff --git a/src/TenjavaBundle/Resources/views/base.html.twig b/src/TenjavaBundle/Resources/views/base.html.twig new file mode 100644 index 0000000..bafd28d --- /dev/null +++ b/src/TenjavaBundle/Resources/views/base.html.twig @@ -0,0 +1,13 @@ + + +
+ +