Compare commits
No commits in common. "557b586b76a9e4da1aa9d566fea6ec1e701cd2be" and "main" have entirely different histories.
557b586b76
...
main
45
.env
45
.env
|
|
@ -1,45 +0,0 @@
|
|||
# In all environments, the following files are loaded if they exist,
|
||||
# the latter taking precedence over the former:
|
||||
#
|
||||
# * .env contains default values for the environment variables needed by the app
|
||||
# * .env.local uncommitted file with local overrides
|
||||
# * .env.$APP_ENV committed environment-specific defaults
|
||||
# * .env.$APP_ENV.local uncommitted environment-specific overrides
|
||||
#
|
||||
# Real environment variables win over .env files.
|
||||
#
|
||||
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
|
||||
# https://symfony.com/doc/current/configuration/secrets.html
|
||||
#
|
||||
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
|
||||
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
|
||||
|
||||
###> symfony/framework-bundle ###
|
||||
APP_ENV=dev
|
||||
APP_SECRET=b8e4c4620ab2c4f9e0f74deb028cca79
|
||||
###< symfony/framework-bundle ###
|
||||
|
||||
###> doctrine/doctrine-bundle ###
|
||||
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
|
||||
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
|
||||
#
|
||||
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
|
||||
# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8.0.32&charset=utf8mb4"
|
||||
# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4"
|
||||
#DATABASE_URL="mysql://mamb:lakers06@db.dyb-tech.com:3306/la_liga?serverVersion=10.11.2-MariaDB&charset=utf8mb4"
|
||||
# DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=15&charset=utf8"
|
||||
###< doctrine/doctrine-bundle ###
|
||||
|
||||
###> lexik/jwt-authentication-bundle ###
|
||||
JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem
|
||||
JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem
|
||||
JWT_PASSPHRASE=51429d81a28d5a6df251a9de746259e21d4721499e62ea4d155a316ec968f28c
|
||||
###< lexik/jwt-authentication-bundle ###
|
||||
|
||||
###> nelmio/cors-bundle ###
|
||||
CORS_ALLOW_ORIGIN='^https?://(localhost|127\.0\.0\.1)(:[0-9]+)?$'
|
||||
###< nelmio/cors-bundle ###
|
||||
|
||||
###> symfony/mailer ###
|
||||
# MAILER_DSN=null://null
|
||||
###< symfony/mailer ###
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage('Show Branch Name and Project Name') {
|
||||
steps {
|
||||
echo "The job name its ${JOB_NAME} at project dyb-tech.com - Jenkins"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,3 @@
|
|||
# LaLiga-BackEnd
|
||||
|
||||
La Liga BackEnd Repository
|
||||
|
||||
Initial commit.
|
||||
La Liga Back End
|
||||
17
bin/console
17
bin/console
|
|
@ -1,17 +0,0 @@
|
|||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
use DMD\LaLigaApi\Kernel;
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
|
||||
if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
|
||||
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
|
||||
}
|
||||
|
||||
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
|
||||
|
||||
return function (array $context) {
|
||||
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
|
||||
|
||||
return new Application($kernel);
|
||||
};
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
{
|
||||
"type": "project",
|
||||
"license": "proprietary",
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true,
|
||||
"require": {
|
||||
"php": ">=8.1",
|
||||
"ext-ctype": "*",
|
||||
"ext-iconv": "*",
|
||||
"doctrine/doctrine-bundle": "^2.10",
|
||||
"doctrine/doctrine-migrations-bundle": "^3.2",
|
||||
"doctrine/orm": "^2.16",
|
||||
"lexik/jwt-authentication-bundle": "^2.19",
|
||||
"nelmio/api-doc-bundle": "^4.12",
|
||||
"nelmio/cors-bundle": "*",
|
||||
"symfony/console": "6.3.*",
|
||||
"symfony/dotenv": "6.3.*",
|
||||
"symfony/flex": "^2",
|
||||
"symfony/framework-bundle": "6.3.*",
|
||||
"symfony/mailer": "6.3.*",
|
||||
"symfony/runtime": "6.3.*",
|
||||
"symfony/twig-bundle": "6.3.*",
|
||||
"symfony/validator": "6.3.*",
|
||||
"symfony/yaml": "6.3.*"
|
||||
},
|
||||
"config": {
|
||||
"allow-plugins": {
|
||||
"php-http/discovery": true,
|
||||
"symfony/flex": true,
|
||||
"symfony/runtime": true
|
||||
},
|
||||
"sort-packages": true
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"DMD\\LaLigaApi\\": "src/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"DMD\\LaLigaApi\\Tests\\": "tests/"
|
||||
}
|
||||
},
|
||||
"replace": {
|
||||
"symfony/polyfill-ctype": "*",
|
||||
"symfony/polyfill-iconv": "*",
|
||||
"symfony/polyfill-php72": "*",
|
||||
"symfony/polyfill-php73": "*",
|
||||
"symfony/polyfill-php74": "*",
|
||||
"symfony/polyfill-php80": "*",
|
||||
"symfony/polyfill-php81": "*"
|
||||
},
|
||||
"scripts": {
|
||||
"auto-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
},
|
||||
"post-install-cmd": [
|
||||
"@auto-scripts"
|
||||
],
|
||||
"post-update-cmd": [
|
||||
"@auto-scripts"
|
||||
]
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/symfony": "*"
|
||||
},
|
||||
"extra": {
|
||||
"symfony": {
|
||||
"allow-contrib": false,
|
||||
"require": "6.3.*"
|
||||
}
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/maker-bundle": "^1.50"
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,13 +0,0 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
|
||||
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
|
||||
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
|
||||
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
|
||||
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
|
||||
Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true],
|
||||
Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true],
|
||||
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
|
||||
Nelmio\ApiDocBundle\NelmioApiDocBundle::class => ['all' => true],
|
||||
];
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
-----BEGIN ENCRYPTED PRIVATE KEY-----
|
||||
MIIFHDBOBgkqhkiG9w0BBQ0wQTApBgkqhkiG9w0BBQwwHAQInDeviyrjeGECAggA
|
||||
MAwGCCqGSIb3DQIJBQAwFAYIKoZIhvcNAwcECOv8u+sIrYZyBIIEyH00Kuv7H9X/
|
||||
pbCCgoQaisJ8oWyakZEvxJY+bvpteYMRqFBGfSSCwM198FhR49+gf29hWsr8bF3f
|
||||
zoS+e8dnkzaVebBZ582FVAWUWdTBVct2CNHXDLTmwz/PJel/xGXXEqpoyb2wcxrr
|
||||
+m3kEJq00AV2m5zDcPjL3lP71pEta2DwuPfKgs+n9KnqGO94zuj0Q+pe7hEVlfia
|
||||
nKbmUWfXRSXscBv7dzt/Npl0pRiDkPCSPCKIXZfrVa8agxrUQbS422cVNtee8h5u
|
||||
dqU5ZrnfmUOogRWW+/Is8HbdMPk1u1TGlHIBeJeJCeR7cype6KXFvZKqREP1MhH3
|
||||
u9ge+J14PRqdm2ZeGpeKyvpnmrObE+qSeSShrttaytC6862IBJAcWs7+30oM/TUR
|
||||
mpA8yj9G5wRgNB4kBYGfNCo3VgDL1be/ai0yUTeIpxOwszMidSXZ6lQ9KvJG55X8
|
||||
kKmFfnLHqCx4D44WhtQPggcipZgsKePjFd348Wb2OWTRYpf66e5Q0Sua2+Faf6yL
|
||||
8Y891ZFb2k68GNFS4sL0ZKvjiIRvbOYUt0wPebL5z5yJgza8/a7rC2cEv+vo/grw
|
||||
npGGMc73iQ/jtFRYHNQBe4/uq5xO8eLxyrSdgHjIPek6N/yvP0BX994AV6KM9ew3
|
||||
ovIgouBPfjF+jE5/wKfoFZFua2QVdm8kK0BcXqQkeKlgeBIXZEspuHqWRVAvH0Zx
|
||||
zrqdraj8kTW9FtaRsTctwqsIuVBMXMm7h8ASl0nDSQRY+0xICdq0xO43Ie8UXx2i
|
||||
8hQkRNa/zqmzbtenZhZXoKc/K6ylhA++7o/nEjwPZmfbgIndTdu5CDnH3qclX/Ls
|
||||
cwTo1/mZuXyy0MCQ+qbagq2a4Ymbx5YQ304R8N6BieT2cnItWOWiImO1VgKQWlUp
|
||||
9tNubgFFVCb+I6orguPwUPeptvXnxBERiTqFmlv7t1rK8+5twk07TXMQXQkHs20C
|
||||
7MeKRUkXrQmRDiPRkRlEs2SmyPVqIT0eXi4ofGf57VQ4llkjBeDZIXzckMjFctZ4
|
||||
2vBH2QCzWDb9+/8Gm/rDJh55VoJhyTGCiM6p87ebNHpmOtWviGThr02Fv8h+p3oZ
|
||||
r5qWUU6k7XWS2UbL4FOcmctzsj1ieXPMeA6GjcRhzB48Ctp9FClYoaug1hTaupQc
|
||||
7UYoy/j1kDVR+ft4Ld8RTTXC1M1ejHopEF3ssuLY7/t9tAA0Dyx0jBwJh+sZMZot
|
||||
rKP/mOvmMzIQxQwgj05Q4vXF5g9rVCDVCKbb8AGWdktkG8SBe9M2xzEv7GWuOLwa
|
||||
tmlRSD8V/hRpclCu5ry6zX/H/sjhDQkUkBRdO6drClyqEiX8HYkWsbkd791P8mgt
|
||||
E42Fy02L7KyVa3wTn9QHu+9bwUBUI7cBmjindWXNdCbzNYoNevAwAgsfCoK0LZmp
|
||||
BxbJ9e68yZXkIrEnxkl4tboaidhn/zDcf9msJfdZqwbfPtdDheIFGjgvZYPBxDzA
|
||||
W9/4YGwwRFznycTobhLmBCYqpUrON7nXNdvMvSaG3mQevkRBRBVNTIxEufq6u/11
|
||||
FrT/2kmFKAMPfypwV4PEZRaoJuxpnjWgMDQV1+W0HC0xdIlrTEySEmhTRiTdax8F
|
||||
rvvz81Q6bF7l6y5xVcWv2g==
|
||||
-----END ENCRYPTED PRIVATE KEY-----
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
-----BEGIN PUBLIC KEY-----
|
||||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwDsrme1BZmfXZF9XDBGY
|
||||
l/eBtM04MTfHC5IV9HI4scoiFsQUUgxiESrE1ATwzd94E/V98W6xeApKpRlHKulb
|
||||
/AxoBo+FaHZLIAEwfkSsqHhhcTATfdkI3nLd3OksbuqDg19nrWoStjTeig9jb3op
|
||||
GezkL+fHcrUpBUFdT0jkuyR/hnIaYtWK6xalWodozJjPHxNC69X7p6xuWGPkRW2q
|
||||
Plm1GzBl4hsvdZ0QfTJQC8aGPXII6Ug5jAySN4jvNSEQNDrnrZ1aiD+A8mnePaE/
|
||||
le9Md4h/pMAn0ku9nv1dTMmFOl7xZUPpG2Qq7wilHyejtU2sLi8MciJaUSesg5ee
|
||||
dwIDAQAB
|
||||
-----END PUBLIC KEY-----
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
framework:
|
||||
cache:
|
||||
# Unique name of your app: used to compute stable namespaces for cache keys.
|
||||
#prefix_seed: your_vendor_name/app_name
|
||||
|
||||
# The "app" cache stores to the filesystem by default.
|
||||
# The data in this cache should persist between deploys.
|
||||
# Other options include:
|
||||
|
||||
# Redis
|
||||
#app: cache.adapter.redis
|
||||
#default_redis_provider: redis://localhost
|
||||
|
||||
# APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)
|
||||
#app: cache.adapter.apcu
|
||||
|
||||
# Namespaced pools use the above "app" backend by default
|
||||
#pools:
|
||||
#my.dedicated.cache: null
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
maker:
|
||||
# tell MakerBundle that all of your classes live in an
|
||||
# Acme namespace, instead of the default App
|
||||
# (e.g. Acme\Entity\Article, Acme\Command\MyCommand, etc)
|
||||
root_namespace: 'DMD\LaLigaApi\'
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
doctrine:
|
||||
dbal:
|
||||
# url: '%env(resolve:DATABASE_URL)%'
|
||||
url: 'mysql://mamb:lakers06@casa.dyb-tech.com:3306/laliga?serverVersion=10.5.22-MariaDB&charset=utf8mb4'
|
||||
# url: 'mysql://root:root@localhost:3307/la_liga?serverVersion=7.4.16&charset=utf8mb4'
|
||||
# IMPORTANT: You MUST configure your server version,
|
||||
# either here or in the DATABASE_URL env var (see .env file)
|
||||
#server_version: '15'
|
||||
|
||||
profiling_collect_backtrace: '%kernel.debug%'
|
||||
orm:
|
||||
auto_generate_proxy_classes: true
|
||||
enable_lazy_ghost_objects: true
|
||||
report_fields_where_declared: true
|
||||
validate_xml_mapping: true
|
||||
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
|
||||
auto_mapping: true
|
||||
mappings:
|
||||
DMD\LaLigaApi:
|
||||
is_bundle: false
|
||||
dir: '%kernel.project_dir%/src/Entity'
|
||||
prefix: 'DMD\LaLigaApi\Entity'
|
||||
alias: App
|
||||
|
||||
when@test:
|
||||
doctrine:
|
||||
dbal:
|
||||
# "TEST_TOKEN" is typically set by ParaTest
|
||||
dbname_suffix: '_test%env(default::TEST_TOKEN)%'
|
||||
|
||||
when@prod:
|
||||
doctrine:
|
||||
orm:
|
||||
auto_generate_proxy_classes: false
|
||||
proxy_dir: '%kernel.build_dir%/doctrine/orm/Proxies'
|
||||
query_cache_driver:
|
||||
type: pool
|
||||
pool: doctrine.system_cache_pool
|
||||
result_cache_driver:
|
||||
type: pool
|
||||
pool: doctrine.result_cache_pool
|
||||
|
||||
framework:
|
||||
cache:
|
||||
pools:
|
||||
doctrine.result_cache_pool:
|
||||
adapter: cache.app
|
||||
doctrine.system_cache_pool:
|
||||
adapter: cache.system
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
doctrine_migrations:
|
||||
migrations_paths:
|
||||
# namespace is arbitrary but should be different from App\Migrations
|
||||
# as migrations classes should NOT be autoloaded
|
||||
'DoctrineMigrations': '%kernel.project_dir%/migrations'
|
||||
enable_profiler: false
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
# see https://symfony.com/doc/current/reference/configuration/framework.html
|
||||
framework:
|
||||
secret: '%env(APP_SECRET)%'
|
||||
#csrf_protection: true
|
||||
http_method_override: false
|
||||
handle_all_throwables: true
|
||||
|
||||
# Enables session support. Note that the session will ONLY be started if you read or write from it.
|
||||
# Remove or comment this section to explicitly disable session support.
|
||||
session:
|
||||
handler_id: null
|
||||
cookie_secure: auto
|
||||
cookie_samesite: lax
|
||||
storage_factory_id: session.storage.factory.native
|
||||
|
||||
#esi: true
|
||||
#fragments: true
|
||||
php_errors:
|
||||
log: true
|
||||
|
||||
when@test:
|
||||
framework:
|
||||
test: true
|
||||
session:
|
||||
storage_factory_id: session.storage.factory.mock_file
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
lexik_jwt_authentication:
|
||||
secret_key: '%env(resolve:JWT_SECRET_KEY)%'
|
||||
public_key: '%env(resolve:JWT_PUBLIC_KEY)%'
|
||||
pass_phrase: '%env(JWT_PASSPHRASE)%'
|
||||
token_ttl: 1800
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
framework:
|
||||
mailer:
|
||||
dsn: 'smtp://soporteliga:dmdlakers06@localhost:8025?verify_peer=0'
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
nelmio_api_doc:
|
||||
documentation:
|
||||
info:
|
||||
title: My App
|
||||
description: This is an awesome app!
|
||||
version: 1.0.0
|
||||
areas: # to filter documented areas
|
||||
path_patterns:
|
||||
- ^/api(?!/doc$) # Accepts routes under /api except /api/doc
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
nelmio_cors:
|
||||
defaults:
|
||||
origin_regex: true
|
||||
allow_origin: ['*']
|
||||
allow_methods: ['GET', 'OPTIONS', 'POST', 'PUT', 'PATCH', 'DELETE']
|
||||
allow_headers: ['Content-Type', 'Authorization']
|
||||
expose_headers: ['Link']
|
||||
max_age: 3600
|
||||
paths:
|
||||
'^/': null
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
framework:
|
||||
router:
|
||||
utf8: true
|
||||
|
||||
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
|
||||
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
|
||||
#default_uri: http://localhost
|
||||
|
||||
when@prod:
|
||||
framework:
|
||||
router:
|
||||
strict_requirements: null
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
security:
|
||||
# https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords
|
||||
enable_authenticator_manager: true
|
||||
password_hashers:
|
||||
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
|
||||
# https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider
|
||||
providers:
|
||||
# used to reload user from session & other features (e.g. switch_user)
|
||||
app_user_provider:
|
||||
entity:
|
||||
class: DMD\LaLigaApi\Entity\User
|
||||
property: email
|
||||
firewalls:
|
||||
login:
|
||||
pattern: ^/api/login
|
||||
stateless: true
|
||||
json_login:
|
||||
check_path: /api/login_check
|
||||
success_handler: lexik_jwt_authentication.handler.authentication_success
|
||||
failure_handler: lexik_jwt_authentication.handler.authentication_failure
|
||||
|
||||
api:
|
||||
pattern: ^/api
|
||||
stateless: true
|
||||
jwt: ~
|
||||
|
||||
dev:
|
||||
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
||||
security: false
|
||||
main:
|
||||
lazy: true
|
||||
provider: app_user_provider
|
||||
|
||||
# activate different ways to authenticate
|
||||
# https://symfony.com/doc/current/security.html#the-firewall
|
||||
|
||||
# https://symfony.com/doc/current/security/impersonating_user.html
|
||||
# switch_user: true
|
||||
|
||||
# Easy way to control access for large sections of your site
|
||||
# Note: Only the *first* access control that matches will be used
|
||||
access_control:
|
||||
- { path: ^/api/login, roles: PUBLIC_ACCESS }
|
||||
- { path: ^/api/user/password, roles: PUBLIC_ACCESS }
|
||||
- { path: ^/api/public, roles: PUBLIC_ACCESS }
|
||||
- { path: ^/api/register, roles: PUBLIC_ACCESS }
|
||||
- { path: ^/api, roles: IS_AUTHENTICATED_FULLY }
|
||||
|
||||
when@test:
|
||||
security:
|
||||
password_hashers:
|
||||
# By default, password hashers are resource intensive and take time. This is
|
||||
# important to generate secure password hashes. In tests however, secure hashes
|
||||
# are not important, waste resources and increase test times. The following
|
||||
# reduces the work factor to the lowest possible values.
|
||||
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface:
|
||||
algorithm: auto
|
||||
cost: 4 # Lowest possible value for bcrypt
|
||||
time_cost: 3 # Lowest possible value for argon
|
||||
memory_cost: 10 # Lowest possible value for argon
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
twig:
|
||||
default_path: '%kernel.project_dir%/templates'
|
||||
|
||||
when@test:
|
||||
twig:
|
||||
strict_variables: true
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
framework:
|
||||
validation:
|
||||
email_validation_mode: html5
|
||||
|
||||
# Enables validator auto-mapping support.
|
||||
# For instance, basic validation constraints will be inferred from Doctrine's metadata.
|
||||
#auto_mapping:
|
||||
# App\Entity\: []
|
||||
|
||||
when@test:
|
||||
framework:
|
||||
validation:
|
||||
not_compromised_password: false
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
<?php
|
||||
|
||||
if (file_exists(dirname(__DIR__).'/var/cache/prod/DMD_LaLigaApi_KernelProdContainer.preload.php')) {
|
||||
require dirname(__DIR__).'/var/cache/prod/DMD_LaLigaApi_KernelProdContainer.preload.php';
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
controllers:
|
||||
resource:
|
||||
path: ../src/Controller/
|
||||
namespace: DMD\LaLigaApi\Controller
|
||||
type: attribute
|
||||
|
||||
api_login_check:
|
||||
path: /api/login_check
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
when@dev:
|
||||
_errors:
|
||||
resource: '@FrameworkBundle/Resources/config/routing/errors.xml'
|
||||
prefix: /_error
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
# Expose your documentation as JSON swagger compliant
|
||||
app.swagger:
|
||||
path: /api/doc.json
|
||||
methods: GET
|
||||
defaults: { _controller: nelmio_api_doc.controller.swagger }
|
||||
|
||||
## Requires the Asset component and the Twig bundle
|
||||
## $ composer require twig asset
|
||||
#app.swagger_ui:
|
||||
# path: /api/doc
|
||||
# methods: GET
|
||||
# defaults: { _controller: nelmio_api_doc.controller.swagger_ui }
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
# This file is the entry point to configure your own services.
|
||||
# Files in the packages/ subdirectory configure your dependencies.
|
||||
|
||||
# Put parameters here that don't need to change on each machine where the app is deployed
|
||||
# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration
|
||||
parameters:
|
||||
|
||||
services:
|
||||
# default configuration for services in *this* file
|
||||
_defaults:
|
||||
autowire: true # Automatically injects dependencies in your services.
|
||||
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
|
||||
|
||||
# makes classes in src/ available to be used as services
|
||||
# this creates a service per class whose id is the fully-qualified class name
|
||||
DMD\LaLigaApi\:
|
||||
resource: '../src/'
|
||||
exclude:
|
||||
- '../src/DependencyInjection/'
|
||||
- '../src/Entity/'
|
||||
- '../src/Kernel.php'
|
||||
|
||||
# add more service definitions when explicit configuration is needed
|
||||
# please note that last definitions always *replace* previous ones
|
||||
DMD\LaLigaApi\Exception\ExceptionListener:
|
||||
tags:
|
||||
- { name: kernel.event_listener, event: kernel.exception }
|
||||
|
||||
DMD\LaLigaApi\Service\User\Handlers\login\AuthenticationSuccessListener:
|
||||
tags:
|
||||
- { name: kernel.event_listener, event: lexik_jwt_authentication.on_authentication_success, method: onAuthenticationSuccessResponse }
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20230831220137 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20230918201118 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20230918202500 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('CREATE TABLE facility (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) DEFAULT NULL, address VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE file (id INT AUTO_INCREMENT NOT NULL, game_id INT DEFAULT NULL, player_id INT DEFAULT NULL, name VARCHAR(255) DEFAULT NULL, type VARCHAR(255) DEFAULT NULL, created_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_8C9F3610E48FD905 (game_id), INDEX IDX_8C9F361099E6F5DF (player_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE game (id INT AUTO_INCREMENT NOT NULL, season_id INT DEFAULT NULL, facility_id INT DEFAULT NULL, home_team_id INT DEFAULT NULL, away_team_id INT DEFAULT NULL, points_home INT DEFAULT NULL, points_away INT DEFAULT NULL, planned_date DATETIME DEFAULT NULL, game_date_time DATETIME DEFAULT NULL, notes VARCHAR(350) DEFAULT NULL, INDEX IDX_232B318C4EC001D1 (season_id), INDEX IDX_232B318CA7014910 (facility_id), INDEX IDX_232B318C9C4C13F6 (home_team_id), INDEX IDX_232B318C45185D02 (away_team_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE league (id INT AUTO_INCREMENT NOT NULL, president_id INT DEFAULT NULL, name VARCHAR(255) DEFAULT NULL, logo VARCHAR(255) DEFAULT NULL, description VARCHAR(255) DEFAULT NULL, active TINYINT(1) DEFAULT NULL, created_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', points_per_win INT DEFAULT NULL, points_per_draw INT DEFAULT NULL, UNIQUE INDEX UNIQ_3EB4C318B40A33C7 (president_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE log (id INT AUTO_INCREMENT NOT NULL, payload JSON DEFAULT NULL, code INT DEFAULT NULL, message VARCHAR(550) DEFAULT NULL, created_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE player (id INT AUTO_INCREMENT NOT NULL, team_id INT DEFAULT NULL, first_name VARCHAR(255) DEFAULT NULL, last_name VARCHAR(255) DEFAULT NULL, position VARCHAR(255) DEFAULT NULL, jersey_number SMALLINT DEFAULT NULL, is_federated TINYINT(1) DEFAULT NULL, picture_file_name VARCHAR(255) DEFAULT NULL, birthday DATE DEFAULT NULL, INDEX IDX_98197A65296CD8AE (team_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE season (id INT AUTO_INCREMENT NOT NULL, league_id INT DEFAULT NULL, date_start DATE NOT NULL, date_end DATE DEFAULT NULL, active TINYINT(1) DEFAULT NULL, created_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_F0E45BA958AFC4DE (league_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE season_team (season_id INT NOT NULL, team_id INT NOT NULL, INDEX IDX_42A93A814EC001D1 (season_id), INDEX IDX_42A93A81296CD8AE (team_id), PRIMARY KEY(season_id, team_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE season_data (id INT AUTO_INCREMENT NOT NULL, team_id INT DEFAULT NULL, season_id INT DEFAULT NULL, captain_id INT DEFAULT NULL, points INT DEFAULT NULL, INDEX IDX_2BBA6FFD296CD8AE (team_id), INDEX IDX_2BBA6FFD4EC001D1 (season_id), INDEX IDX_2BBA6FFD3346729B (captain_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE team (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) DEFAULT NULL, active TINYINT(1) DEFAULT NULL, created_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(180) NOT NULL, roles JSON NOT NULL, password VARCHAR(255) NOT NULL, first_name VARCHAR(255) DEFAULT NULL, last_name VARCHAR(255) DEFAULT NULL, phone VARCHAR(255) DEFAULT NULL, profile_picture VARCHAR(255) DEFAULT NULL, birthday DATE DEFAULT NULL, active TINYINT(1) DEFAULT NULL, created_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', UNIQUE INDEX UNIQ_8D93D649E7927C74 (email), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
|
||||
$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F3610E48FD905 FOREIGN KEY (game_id) REFERENCES game (id)');
|
||||
$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F361099E6F5DF FOREIGN KEY (player_id) REFERENCES player (id)');
|
||||
$this->addSql('ALTER TABLE game ADD CONSTRAINT FK_232B318C4EC001D1 FOREIGN KEY (season_id) REFERENCES season (id)');
|
||||
$this->addSql('ALTER TABLE game ADD CONSTRAINT FK_232B318CA7014910 FOREIGN KEY (facility_id) REFERENCES facility (id)');
|
||||
$this->addSql('ALTER TABLE game ADD CONSTRAINT FK_232B318C9C4C13F6 FOREIGN KEY (home_team_id) REFERENCES team (id)');
|
||||
$this->addSql('ALTER TABLE game ADD CONSTRAINT FK_232B318C45185D02 FOREIGN KEY (away_team_id) REFERENCES team (id)');
|
||||
$this->addSql('ALTER TABLE league ADD CONSTRAINT FK_3EB4C318B40A33C7 FOREIGN KEY (president_id) REFERENCES user (id)');
|
||||
$this->addSql('ALTER TABLE player ADD CONSTRAINT FK_98197A65296CD8AE FOREIGN KEY (team_id) REFERENCES team (id)');
|
||||
$this->addSql('ALTER TABLE season ADD CONSTRAINT FK_F0E45BA958AFC4DE FOREIGN KEY (league_id) REFERENCES league (id)');
|
||||
$this->addSql('ALTER TABLE season_team ADD CONSTRAINT FK_42A93A814EC001D1 FOREIGN KEY (season_id) REFERENCES season (id) ON DELETE CASCADE');
|
||||
$this->addSql('ALTER TABLE season_team ADD CONSTRAINT FK_42A93A81296CD8AE FOREIGN KEY (team_id) REFERENCES team (id) ON DELETE CASCADE');
|
||||
$this->addSql('ALTER TABLE season_data ADD CONSTRAINT FK_2BBA6FFD296CD8AE FOREIGN KEY (team_id) REFERENCES team (id)');
|
||||
$this->addSql('ALTER TABLE season_data ADD CONSTRAINT FK_2BBA6FFD4EC001D1 FOREIGN KEY (season_id) REFERENCES season (id)');
|
||||
$this->addSql('ALTER TABLE season_data ADD CONSTRAINT FK_2BBA6FFD3346729B FOREIGN KEY (captain_id) REFERENCES user (id)');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE file DROP FOREIGN KEY FK_8C9F3610E48FD905');
|
||||
$this->addSql('ALTER TABLE file DROP FOREIGN KEY FK_8C9F361099E6F5DF');
|
||||
$this->addSql('ALTER TABLE game DROP FOREIGN KEY FK_232B318C4EC001D1');
|
||||
$this->addSql('ALTER TABLE game DROP FOREIGN KEY FK_232B318CA7014910');
|
||||
$this->addSql('ALTER TABLE game DROP FOREIGN KEY FK_232B318C9C4C13F6');
|
||||
$this->addSql('ALTER TABLE game DROP FOREIGN KEY FK_232B318C45185D02');
|
||||
$this->addSql('ALTER TABLE league DROP FOREIGN KEY FK_3EB4C318B40A33C7');
|
||||
$this->addSql('ALTER TABLE player DROP FOREIGN KEY FK_98197A65296CD8AE');
|
||||
$this->addSql('ALTER TABLE season DROP FOREIGN KEY FK_F0E45BA958AFC4DE');
|
||||
$this->addSql('ALTER TABLE season_team DROP FOREIGN KEY FK_42A93A814EC001D1');
|
||||
$this->addSql('ALTER TABLE season_team DROP FOREIGN KEY FK_42A93A81296CD8AE');
|
||||
$this->addSql('ALTER TABLE season_data DROP FOREIGN KEY FK_2BBA6FFD296CD8AE');
|
||||
$this->addSql('ALTER TABLE season_data DROP FOREIGN KEY FK_2BBA6FFD4EC001D1');
|
||||
$this->addSql('ALTER TABLE season_data DROP FOREIGN KEY FK_2BBA6FFD3346729B');
|
||||
$this->addSql('DROP TABLE facility');
|
||||
$this->addSql('DROP TABLE file');
|
||||
$this->addSql('DROP TABLE game');
|
||||
$this->addSql('DROP TABLE league');
|
||||
$this->addSql('DROP TABLE log');
|
||||
$this->addSql('DROP TABLE player');
|
||||
$this->addSql('DROP TABLE season');
|
||||
$this->addSql('DROP TABLE season_team');
|
||||
$this->addSql('DROP TABLE season_data');
|
||||
$this->addSql('DROP TABLE team');
|
||||
$this->addSql('DROP TABLE user');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20231007212245 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE user ADD note_list LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\'');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE user DROP note_list');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20231007221519 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE season_data DROP FOREIGN KEY FK_2BBA6FFD3346729B');
|
||||
$this->addSql('DROP INDEX IDX_2BBA6FFD3346729B ON season_data');
|
||||
$this->addSql('ALTER TABLE season_data DROP captain_id');
|
||||
$this->addSql('ALTER TABLE team ADD captain_id INT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE team ADD CONSTRAINT FK_CAPTAIN_ID FOREIGN KEY (captain_id) REFERENCES user (id)');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_CAPTAIN_ID ON team (captain_id)');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE season_data ADD captain_id INT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE season_data ADD CONSTRAINT FK_2BBA6FFD3346729B FOREIGN KEY (captain_id) REFERENCES user (id)');
|
||||
$this->addSql('CREATE INDEX IDX_2BBA6FFD3346729B ON season_data (captain_id)');
|
||||
$this->addSql('ALTER TABLE team DROP FOREIGN KEY FK_C4E0A61F3346729B');
|
||||
$this->addSql('DROP INDEX UNIQ_C4E0A61F3346729B ON team');
|
||||
$this->addSql('ALTER TABLE team DROP captain_id');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20231007222620 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE league ADD city VARCHAR(255) DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE team RENAME INDEX uniq_captain_id TO UNIQ_C4E0A61F3346729B');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE league DROP city');
|
||||
$this->addSql('ALTER TABLE team RENAME INDEX uniq_c4e0a61f3346729b TO UNIQ_CAPTAIN_ID');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20231007223332 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE league ADD points_per_loss INT DEFAULT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE league DROP points_per_loss');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20231108232033 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE facility ADD season_id INT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE facility ADD CONSTRAINT FK_105994B24EC001D1 FOREIGN KEY (season_id) REFERENCES season (id)');
|
||||
$this->addSql('CREATE INDEX IDX_105994B24EC001D1 ON facility (season_id)');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE facility DROP FOREIGN KEY FK_105994B24EC001D1');
|
||||
$this->addSql('DROP INDEX IDX_105994B24EC001D1 ON facility');
|
||||
$this->addSql('ALTER TABLE facility DROP season_id');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20231109001241 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE facility ADD created_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\'');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE facility DROP created_at');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20240208210630 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('CREATE TABLE notification (id INT AUTO_INCREMENT NOT NULL, requesting_user_id INT DEFAULT NULL, league_id INT DEFAULT NULL, type VARCHAR(255) DEFAULT NULL, message VARCHAR(280) DEFAULT NULL, is_accepted TINYINT(1) DEFAULT NULL, created_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', team_id INT DEFAULT NULL, INDEX IDX_BF5476CA2A841BBC (requesting_user_id), INDEX IDX_BF5476CA58AFC4DE (league_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
|
||||
$this->addSql('ALTER TABLE notification ADD CONSTRAINT FK_NOTIFICATION_REQUESTING_USER_ID FOREIGN KEY (requesting_user_id) REFERENCES user (id)');
|
||||
$this->addSql('ALTER TABLE notification ADD CONSTRAINT FK_NOTIFICATION_LEAGUE_ID FOREIGN KEY (league_id) REFERENCES league (id)');
|
||||
$this->addSql('ALTER TABLE league ADD matches_between_teams INT DEFAULT NULL, ADD blocked_match_dates JSON DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE log CHANGE payload payload LONGTEXT DEFAULT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE notification DROP FOREIGN KEY FK_NOTIFICATION_REQUESTING_USER_ID');
|
||||
$this->addSql('ALTER TABLE notification DROP FOREIGN KEY FK_NOTIFICATION_LEAGUE_ID');
|
||||
$this->addSql('DROP TABLE notification');
|
||||
$this->addSql('ALTER TABLE league DROP matches_between_teams, DROP blocked_match_dates');
|
||||
$this->addSql('ALTER TABLE log CHANGE payload payload JSON DEFAULT NULL');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20240210215035 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE season DROP date_end');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE season ADD date_end DATE DEFAULT NULL');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20240210230354 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('CREATE TABLE custom_role (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, name VARCHAR(255) DEFAULT NULL, created_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_USER_ID (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
|
||||
$this->addSql('ALTER TABLE custom_role ADD CONSTRAINT FK_CUSTOM_ROLE_USER FOREIGN KEY (user_id) REFERENCES user (id)');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE custom_role DROP FOREIGN KEY FK_CUSTOM_ROLE_USER');
|
||||
$this->addSql('DROP TABLE custom_role');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20240210231643 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE custom_role RENAME INDEX idx_user_id TO IDX_561F4297A76ED395');
|
||||
$this->addSql('ALTER TABLE season ADD updated_at DATETIME DEFAULT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE custom_role RENAME INDEX idx_561f4297a76ed395 TO IDX_USER_ID');
|
||||
$this->addSql('ALTER TABLE season DROP updated_at');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20240307211223 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE league DROP FOREIGN KEY FK_3EB4C318B40A33C7');
|
||||
$this->addSql('DROP INDEX UNIQ_3EB4C318B40A33C7 ON league');
|
||||
$this->addSql('ALTER TABLE league DROP president_id');
|
||||
$this->addSql('ALTER TABLE notification DROP FOREIGN KEY FK_NOTIFICATION_REQUESTING_USER_ID');
|
||||
$this->addSql('DROP INDEX IDX_BF5476CA2A841BBC ON notification');
|
||||
$this->addSql('ALTER TABLE notification ADD user_to_notify_id INT NOT NULL, CHANGE requesting_user_id user_who_fired_event_id INT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE notification ADD CONSTRAINT FK_BF5476CA6EEF4E6F FOREIGN KEY (user_who_fired_event_id) REFERENCES user (id)');
|
||||
$this->addSql('ALTER TABLE notification ADD CONSTRAINT FK_BF5476CA64958C8F FOREIGN KEY (user_to_notify_id) REFERENCES user (id)');
|
||||
$this->addSql('CREATE INDEX IDX_BF5476CA6EEF4E6F ON notification (user_who_fired_event_id)');
|
||||
$this->addSql('CREATE INDEX IDX_BF5476CA64958C8F ON notification (user_to_notify_id)');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE league ADD president_id INT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE league ADD CONSTRAINT FK_3EB4C318B40A33C7 FOREIGN KEY (president_id) REFERENCES user (id)');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_3EB4C318B40A33C7 ON league (president_id)');
|
||||
$this->addSql('ALTER TABLE notification DROP FOREIGN KEY FK_BF5476CA6EEF4E6F');
|
||||
$this->addSql('ALTER TABLE notification DROP FOREIGN KEY FK_BF5476CA64958C8F');
|
||||
$this->addSql('DROP INDEX IDX_BF5476CA6EEF4E6F ON notification');
|
||||
$this->addSql('DROP INDEX IDX_BF5476CA64958C8F ON notification');
|
||||
$this->addSql('ALTER TABLE notification DROP user_to_notify_id, CHANGE user_who_fired_event_id requesting_user_id INT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE notification ADD CONSTRAINT FK_NOTIFICATION_REQUESTING_USER_ID FOREIGN KEY (requesting_user_id) REFERENCES user (id)');
|
||||
$this->addSql('CREATE INDEX IDX_BF5476CA2A841BBC ON notification (requesting_user_id)');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20240310082537 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE notification ADD read_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', CHANGE is_accepted is_read TINYINT(1) DEFAULT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE notification DROP read_at, CHANGE is_read is_accepted TINYINT(1) DEFAULT NULL');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20240403225038 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE game ADD created_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', ADD updated_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\'');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE game DROP created_at, DROP updated_at');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20240516234124 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE file ADD season_id INT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F36104EC001D1 FOREIGN KEY (season_id) REFERENCES season (id)');
|
||||
$this->addSql('CREATE INDEX IDX_8C9F36104EC001D1 ON file (season_id)');
|
||||
$this->addSql('ALTER TABLE league ADD is_public TINYINT(1) DEFAULT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE file DROP FOREIGN KEY FK_8C9F36104EC001D1');
|
||||
$this->addSql('DROP INDEX IDX_8C9F36104EC001D1 ON file');
|
||||
$this->addSql('ALTER TABLE file DROP season_id');
|
||||
$this->addSql('ALTER TABLE league DROP is_public');
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,11 +0,0 @@
|
|||
AuthUserFile "/etc/apache2/passwd.pass"
|
||||
AuthName "Please Enter Password"
|
||||
AuthType Basic
|
||||
Require valid-user
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteCond %{HTTP:Authorization} .+
|
||||
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%0]
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^(.*)$ index.php [QSA,L]
|
||||
</IfModule>
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
// This file is part of the API Platform project.
|
||||
//
|
||||
// (c) Kévin Dunglas <dunglas@gmail.com>
|
||||
//
|
||||
// For the full copyright and license information, please view the LICENSE
|
||||
// file that was distributed with this source code.
|
||||
|
||||
function loadSwaggerUI(userOptions = {}) {
|
||||
const data = JSON.parse(document.getElementById('swagger-data').innerText);
|
||||
const defaultOptions = {
|
||||
spec: data.spec,
|
||||
dom_id: '#swagger-ui',
|
||||
validatorUrl: null,
|
||||
presets: [
|
||||
SwaggerUIBundle.presets.apis,
|
||||
SwaggerUIStandalonePreset
|
||||
],
|
||||
plugins: [
|
||||
SwaggerUIBundle.plugins.DownloadUrl
|
||||
],
|
||||
layout: 'StandaloneLayout'
|
||||
};
|
||||
const options = Object.assign({}, defaultOptions, userOptions);
|
||||
const ui = SwaggerUIBundle(options);
|
||||
|
||||
const storageKey = 'nelmio_api_auth';
|
||||
|
||||
// if we have auth in storage use it
|
||||
if (sessionStorage.getItem(storageKey)) {
|
||||
try {
|
||||
ui.authActions.authorize(JSON.parse(sessionStorage.getItem(storageKey)));
|
||||
} catch (ignored) {
|
||||
// catch any errors here so it does not stop script execution
|
||||
}
|
||||
}
|
||||
|
||||
// hook into authorize to store the auth in local storage when user performs authorization
|
||||
const currentAuthorize = ui.authActions.authorize;
|
||||
ui.authActions.authorize = function (payload) {
|
||||
sessionStorage.setItem(storageKey, JSON.stringify(payload));
|
||||
return currentAuthorize(payload);
|
||||
};
|
||||
|
||||
// hook into logout to clear auth from storage if user logs out
|
||||
const currentLogout = ui.authActions.logout;
|
||||
ui.authActions.logout = function (payload) {
|
||||
sessionStorage.removeItem(storageKey);
|
||||
return currentLogout(payload);
|
||||
};
|
||||
|
||||
window.ui = ui;
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 9.0 KiB |
|
|
@ -1,297 +0,0 @@
|
|||
html {
|
||||
box-sizing: border-box;
|
||||
overflow: -moz-scrollbars-vertical;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
*,
|
||||
*:before,
|
||||
*:after {
|
||||
box-sizing: inherit;
|
||||
}
|
||||
|
||||
body {
|
||||
margin:70px 0 0;
|
||||
background: #f0f0f0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/** HEADER **/
|
||||
|
||||
header:before {
|
||||
content:"";
|
||||
background-color:#27848E;
|
||||
height:70px;
|
||||
width:100%;
|
||||
text-align:center;
|
||||
position:fixed;
|
||||
top:0;
|
||||
z-index:100;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
|
||||
}
|
||||
|
||||
header #logo {
|
||||
position:fixed;
|
||||
top : 35px;
|
||||
right:40px;
|
||||
z-index:102;
|
||||
transform:translateY(-50%);
|
||||
}
|
||||
|
||||
header #logo img {
|
||||
height:48px;
|
||||
background-color:rgba(40, 134, 144, 0.4)
|
||||
}
|
||||
|
||||
/** INCREASE WRAPPER BLOC PADDING **/
|
||||
|
||||
#swagger-ui.api-platform .wrapper {
|
||||
padding:0px 60px;
|
||||
}
|
||||
|
||||
|
||||
/** INFORMATIONS BLOC **/
|
||||
|
||||
#swagger-ui.api-platform .information-container.wrapper {
|
||||
margin:0;
|
||||
padding:10px 0 0;
|
||||
width:100%;
|
||||
max-width:100%;
|
||||
background-color:white;
|
||||
border-bottom:1px solid #ccc;
|
||||
margin-bottom:30px;
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform .info .title {
|
||||
color:#3caab5;
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform .info {
|
||||
width: 100%;
|
||||
max-width: 1460px;
|
||||
padding: 0px 50px;
|
||||
margin: 0px auto;
|
||||
}
|
||||
|
||||
/** METHODS BLOCS **/
|
||||
|
||||
#swagger-ui.api-platform .opblock.opblock-get .opblock-summary-method {
|
||||
background-color:#3CAAB5;
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform .opblock.opblock-put .opblock-summary-method {
|
||||
background-color:#E6C229;
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform .opblock.opblock-post .opblock-summary-method {
|
||||
background-color:#78BC61;
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform .opblock.opblock-delete .opblock-summary-method {
|
||||
background-color:#ED6A5A;
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform .opblock.opblock-deprecated .opblock-summary-method {
|
||||
background-color:#ebebeb;
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform .opblock.opblock-get .opblock-summary {
|
||||
border-color:#3CAAB5;
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform .opblock.opblock-put .opblock-summary {
|
||||
border-color:#E6C229;
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform .opblock.opblock-post .opblock-summary {
|
||||
border-color:#78BC61;
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform .opblock.opblock-delete .opblock-summary {
|
||||
border-color:#ED6A5A;
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform .opblock.opblock-deprecated .opblock-summary {
|
||||
border-color:#ebebeb;
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform .opblock-summary-method {
|
||||
border-radius:0;
|
||||
padding:10px;
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform .opblock-summary {
|
||||
padding:0;
|
||||
}
|
||||
#swagger-ui.api-platform .opblock-tag {
|
||||
padding:5px 0;
|
||||
margin:0 0 10px;
|
||||
}
|
||||
#swagger-ui.api-platform .opblock-tag:hover {
|
||||
background-color:rgba(0,0,0,.1);
|
||||
transform:scale(1.01);
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform .opblock-section-header, #swagger-ui.api-platform .opblock.opblock-get .opblock-section-header {
|
||||
background-color:rgba(60,170,181,0.1);
|
||||
box-shadow:none;
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform .opblock.opblock-post .opblock-section-header {
|
||||
background-color:rgba(120,188,97,0.1);
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform .opblock.opblock-put .opblock-section-header {
|
||||
background-color:rgba(230, 194, 41, 0.1);
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform .opblock.opblock-delete .opblock-section-header {
|
||||
background-color:rgba(237,106,90,0.1);
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform .opblock.opblock-deprecated .opblock-section-header {
|
||||
background-color:rgba(235,235,235,0.1);
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform .opblock {
|
||||
border-radius:0;
|
||||
background-color:white;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
|
||||
margin:0 0 10px;
|
||||
padding:0;
|
||||
border:none!important;
|
||||
}
|
||||
|
||||
#swagger-ui .topbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/** FORMATS **/
|
||||
|
||||
#formats {
|
||||
text-align:right;
|
||||
font-family: sans-serif;
|
||||
width: 100%;
|
||||
max-width: 1460px;
|
||||
padding: 0px 60px;
|
||||
margin:0 auto;
|
||||
}
|
||||
|
||||
|
||||
/** BUTTONS **/
|
||||
|
||||
#swagger-ui.api-platform .btn.execute {
|
||||
background-color:#3CAAB5;
|
||||
border-color:#3CAAB5;
|
||||
animation:none;
|
||||
transition:all ease 0.3s;
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform .btn.execute:hover {
|
||||
background-color:#288690;
|
||||
border-color:#288690;
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform .execute-wrapper {
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform .execute-wrapper .btn {
|
||||
width:auto;
|
||||
padding:10px 40px;
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform .btn-group {
|
||||
max-width: 500px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform .btn-group .btn {
|
||||
padding:10px 40px;
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform .btn {
|
||||
transition:all ease 0.2s;
|
||||
box-shadow:none;
|
||||
background-color: #f7f7f7
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform .btn:hover {
|
||||
background-color:rgba(65,68,78,0.1);
|
||||
border-color:transparent;
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform .btn.cancel:hover {
|
||||
background-color:rgba(237,106,90,0.1);
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform .btn.authorize:hover {
|
||||
background-color:rgba(120,188,97,0.1);
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform select {
|
||||
box-shadow:none;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
|
||||
/** FIX TABS SEPARATOR **/
|
||||
|
||||
#swagger-ui.api-platform .tab li:first-of-type:after {
|
||||
content : none;
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform .tab li {
|
||||
padding:0px 5px;
|
||||
border-right:1px solid rgba(0,0,0,.2);
|
||||
}
|
||||
|
||||
#swagger-ui.api-platform .tab li:last-of-type {
|
||||
border-right:none;
|
||||
}
|
||||
|
||||
|
||||
/** REMOVE HIGHLIGHTS FOCUS INPUTS **/
|
||||
|
||||
#swagger-ui.api-platform input:focus,
|
||||
#swagger-ui.api-platform select:focus,
|
||||
#swagger-ui.api-platform textarea:focus,
|
||||
#swagger-ui.api-platform button:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
|
||||
/** REMOVE TITILIUM FONT **/
|
||||
|
||||
.swagger-ui .opblock-tag,
|
||||
.swagger-ui .opblock .opblock-section-header label,
|
||||
.swagger-ui .opblock .opblock-section-header h4,
|
||||
.swagger-ui .opblock .opblock-summary-method,
|
||||
.swagger-ui .tab li,
|
||||
.swagger-ui .scheme-container .schemes>label,
|
||||
.swagger-ui .loading-container .loading:after,
|
||||
.swagger-ui .btn,
|
||||
.swagger-ui .btn.cancel,
|
||||
.swagger-ui select,
|
||||
.swagger-ui label,
|
||||
.swagger-ui .dialog-ux .modal-ux-content h4,
|
||||
.swagger-ui .dialog-ux .modal-ux-header h3,
|
||||
.swagger-ui section.models h4,
|
||||
.swagger-ui section.models h5,
|
||||
.swagger-ui .model-title,
|
||||
.swagger-ui .parameter__name,
|
||||
.swagger-ui .topbar a,
|
||||
.swagger-ui .topbar .download-url-wrapper .download-url-button,
|
||||
.swagger-ui .info .title small pre,
|
||||
.swagger-ui .scopes h2,
|
||||
.swagger-ui .errors-wrapper hgroup h4 {
|
||||
font-family: sans-serif !important;
|
||||
}
|
||||
|
||||
#swagger-ui-logos {
|
||||
position: absolute;
|
||||
width:0;
|
||||
height:0;
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
|
||||
use DMD\LaLigaApi\Kernel;
|
||||
|
||||
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
|
||||
|
||||
return function (array $context) {
|
||||
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
|
||||
};
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Controller;
|
||||
|
||||
use DMD\LaLigaApi\Service\League\acceptJoinLeagueRequest\HandleAcceptJoinLeagueRequest;
|
||||
use DMD\LaLigaApi\Service\League\createLeague\HandleCreateLeague;
|
||||
use DMD\LaLigaApi\Service\League\declineJoinLeagueRequest\HandleDeclineJoinLeagueRequest;
|
||||
use DMD\LaLigaApi\Service\League\getAllLeagues\HandleGetAllLeagues;
|
||||
use DMD\LaLigaApi\Service\League\getLeagueById\HandleGetLeagueById;
|
||||
use DMD\LaLigaApi\Service\League\newJoinLeagueRequest\HandleNewJoinLeagueRequest;
|
||||
use DMD\LaLigaApi\Service\League\joinTeam\HandleCaptainRequest;
|
||||
use DMD\LaLigaApi\Service\League\updateLeague\HandleUpdateLeague;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Mailer\Exception\TransportExceptionInterface;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class LeagueController extends AbstractController
|
||||
{
|
||||
#[Route('/api/league/new', name: 'app_league', methods: ['POST'])]
|
||||
public function createLeague(Request $request, HandleCreateLeague $handleCreateLeague): JsonResponse
|
||||
{
|
||||
return $handleCreateLeague($request);
|
||||
}
|
||||
#[Route('/api/league/{$leagueId}', name: 'app_update_league', methods: ['PUT'])]
|
||||
public function updateLeague(Request $request, HandleUpdateLeague $handleUpdateLeague, int $leagueId): JsonResponse
|
||||
{
|
||||
return $handleUpdateLeague($request, $leagueId);
|
||||
}
|
||||
|
||||
#[Route('/api/league/{leagueId}/join', name: 'app_join_league', methods: ['PUT'])]
|
||||
public function joinLeague(Request $request, HandleNewJoinLeagueRequest $handleJoinLeague, int $leagueId): JsonResponse
|
||||
{
|
||||
return $handleJoinLeague($request, $leagueId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws TransportExceptionInterface
|
||||
*/
|
||||
#[Route('/api/league/{leagueId}/team/{teamId}', name: 'app_join_team', methods: ['PUT'])]
|
||||
public function joinTeam(Request $request, HandleCaptainRequest $handleCaptainRequest, int $leagueId, int $teamId): JsonResponse
|
||||
{
|
||||
return $handleCaptainRequest($request, $leagueId, $teamId);
|
||||
}
|
||||
|
||||
#[Route('/api/league/{leagueId}', name: 'app_get_league', methods: ['GET'])]
|
||||
public function getLeagueById(Request $request, HandleGetLeagueById $handleGetLeagueById, int $leagueId): JsonResponse
|
||||
{
|
||||
return $handleGetLeagueById($request, $leagueId);
|
||||
}
|
||||
#[Route('/api/public/league', name: 'app_get_all_leagues', methods: ['GET'])]
|
||||
public function getAllLeagues(HandleGetAllLeagues $handleGetAllLeagues): JsonResponse
|
||||
{
|
||||
return $handleGetAllLeagues();
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws TransportExceptionInterface
|
||||
*/
|
||||
#[Route('api/league/{leagueId}/user/{userId}/accept', name: 'app_accept_join_request', methods: ['GET'])]
|
||||
public function acceptJoinRequest(
|
||||
Request $request,
|
||||
HandleAcceptJoinLeagueRequest $handleAcceptJoinLeagueRequest,
|
||||
int $leagueId,
|
||||
int $userId
|
||||
): JsonResponse
|
||||
{
|
||||
return $handleAcceptJoinLeagueRequest($request, $leagueId, $userId);
|
||||
}
|
||||
|
||||
#[Route('api/league/{leagueId}/decline/{captainId}', name: 'app_decline_join_request', methods: ['GET'])]
|
||||
public function declineJoinRequest(Request $request, HandleDeclineJoinLeagueRequest $handleDeclineJoinRequest, int $leagueId, int $captainId): JsonResponse
|
||||
{
|
||||
return $handleDeclineJoinRequest($request, $leagueId, $captainId);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Controller;
|
||||
|
||||
use DMD\LaLigaApi\Service\User\Handlers\getNotifications\HandleGetNotifications;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class NotificationController extends AbstractController
|
||||
{
|
||||
#[Route('/api/notifications', name: 'app_get_notifications')]
|
||||
public function getAllNotifications(HandleGetNotifications $handleGetNotifications): Response
|
||||
{
|
||||
return $handleGetNotifications();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Controller;
|
||||
|
||||
use DMD\LaLigaApi\Service\Season\addTeam\HandleAddTeam;
|
||||
use DMD\LaLigaApi\Service\Season\createGameCalendar\HandleCreateGameCalendarRequest;
|
||||
use DMD\LaLigaApi\Service\Season\createSeason\HandleCreateSeason;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class SeasonController extends AbstractController
|
||||
{
|
||||
#[Route('/api/league/{leagueId}/season/create', name: 'app_add_season', methods: ['POST'])]
|
||||
public function addSeason(Request $request, HandleCreateSeason $handleCreateSeason, int $leagueId): JsonResponse
|
||||
{
|
||||
return $handleCreateSeason($request, $leagueId);
|
||||
}
|
||||
|
||||
#[Route('/api/league/{leagueId}/season/{seasonId}/team', name: 'app_add_team', methods: ['POST'])]
|
||||
public function addTeam(Request $request, HandleAddTeam $handleAddTeam, int $leagueId, int $seasonId): JsonResponse
|
||||
{
|
||||
return $handleAddTeam($request, $leagueId, $seasonId);
|
||||
}
|
||||
|
||||
#[Route('/api/league/{leagueId}/season/{seasonId}/calendar', name: 'app_create_calendar', methods: ['POST'])]
|
||||
public function createCalendar(Request $request, HandleCreateGameCalendarRequest $handleCreateGameCalendarRequest, int $leagueId, int $seasonId): JsonResponse
|
||||
{
|
||||
return $handleCreateGameCalendarRequest($request, $leagueId, $seasonId);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Controller;
|
||||
|
||||
use DMD\LaLigaApi\Repository\UserRepository;
|
||||
use DMD\LaLigaApi\Service\User\Handlers\delete\HandleDeleteUser;
|
||||
use DMD\LaLigaApi\Service\User\Handlers\update\HandleUpdateUser;
|
||||
use DMD\LaLigaApi\Service\User\Handlers\register\HandleRegistration;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class UserController extends AbstractController
|
||||
{
|
||||
#[Route('/api/register', name: 'app_user_register', methods: ['POST'])]
|
||||
public function createUser(Request $request, HandleRegistration $handleRegistration): JsonResponse
|
||||
{
|
||||
return $handleRegistration($request);
|
||||
}
|
||||
#[Route('/api/user/', name: 'app_user_delete', methods: ['DELETE'])]
|
||||
public function deleteUser(Request $request, HandleDeleteUser $handleDeleteUser): JsonResponse
|
||||
{
|
||||
return $handleDeleteUser($request);
|
||||
}
|
||||
|
||||
#[Route('/api/user/edit', name: 'app_update_user', methods: ['PUT'])]
|
||||
public function updateUser(Request $request, HandleUpdateUser $handleUpdateUser): JsonResponse
|
||||
{
|
||||
return $handleUpdateUser($request);
|
||||
}
|
||||
|
||||
#[Route('/api/user/password', name: 'app_user_change_password', methods: ['PUT'])]
|
||||
public function changePassword(
|
||||
Request $request,
|
||||
UserRepository $userRepository,
|
||||
UserPasswordHasherInterface $passwordHasher,
|
||||
EntityManagerInterface $entityManager
|
||||
): JsonResponse
|
||||
{
|
||||
$user = $userRepository->findOneBy([
|
||||
'email' => ($request->toArray())['username']
|
||||
]);
|
||||
if (is_null($user))
|
||||
{
|
||||
throw new HttpException(
|
||||
Response::HTTP_NOT_FOUND,
|
||||
'User not found.'
|
||||
);
|
||||
}
|
||||
$hashedPassword = $passwordHasher->hashPassword($user, ($request->toArray())['newPassword']);
|
||||
$user->setPassword($hashedPassword);
|
||||
$entityManager->persist($user);
|
||||
$entityManager->flush($user);
|
||||
$entityManager->clear();
|
||||
return new JsonResponse([
|
||||
'success' => true
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Dto;
|
||||
|
||||
use DMD\LaLigaApi\Entity\CustomRole;
|
||||
|
||||
class CustomRoleDto
|
||||
{
|
||||
public int $id;
|
||||
public string $name;
|
||||
public \DateTimeImmutable $createdAt;
|
||||
public int $userId;
|
||||
|
||||
public function toArray(): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id ?? '',
|
||||
'name' => $this->name ?? '',
|
||||
'userId' => $this->userId ?? '',
|
||||
'createdAt' => $this->createdAt ? $this->createdAt->format('Y-m-d H:i:s') : ''
|
||||
];
|
||||
}
|
||||
|
||||
public function fillFromArray(array $dataList): void
|
||||
{
|
||||
if (isset($dataList['id']))
|
||||
{
|
||||
$this->id = $dataList['id'];
|
||||
}
|
||||
if (!empty($dataList['name']))
|
||||
{
|
||||
$this->name = $dataList['name'];
|
||||
}
|
||||
if (!empty($dataList['createdAt']))
|
||||
{
|
||||
$this->createdAt = \DateTimeImmutable::createFromFormat('Y-m-d H:i:s', $dataList['createdAt']);
|
||||
}
|
||||
}
|
||||
public function fillFromObject(CustomRole $customRole): void
|
||||
{
|
||||
if (!is_null($customRole->getId()))
|
||||
{
|
||||
$this->id = $customRole->getId();
|
||||
}
|
||||
if (!is_null($customRole->getName()))
|
||||
{
|
||||
$this->name = $customRole->getName();
|
||||
}
|
||||
if (!is_null($customRole->getCreatedAt()))
|
||||
{
|
||||
$this->name = $customRole->getCreatedAt();
|
||||
}
|
||||
if (!is_null(($customRole->getUser())->getId()))
|
||||
{
|
||||
$this->userId = ($customRole->getUser())->getId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Dto;
|
||||
|
||||
use DMD\LaLigaApi\Entity\Facility;
|
||||
use phpDocumentor\Reflection\Types\Integer;
|
||||
|
||||
class FacilityDto
|
||||
{
|
||||
public int $id;
|
||||
public string $name;
|
||||
public string $address;
|
||||
public bool $active;
|
||||
public array $gameDtoList;
|
||||
public array $seasonDtoList;
|
||||
public \DateTime $createdAt;
|
||||
|
||||
public function toArray(): array
|
||||
{
|
||||
$seasonList = [];
|
||||
if (!empty($this->seasonDtoList))
|
||||
{
|
||||
foreach ($this->seasonDtoList as $seasonDto)
|
||||
{
|
||||
$seasonList = $seasonDto->toArray();
|
||||
}
|
||||
}
|
||||
return [
|
||||
'id' => $this->id ?? '',
|
||||
'name' => $this->name ?? '',
|
||||
'address' => $this->address ?? '',
|
||||
'seasonList' => $seasonList,
|
||||
'createdAt' => !empty($this->createdAt) ? $this->createdAt->format('Y-m-d H:i:s') : ''
|
||||
];
|
||||
}
|
||||
|
||||
public function fillFromArray(array $dataList): void
|
||||
{
|
||||
if (isset($dataList['id']))
|
||||
{
|
||||
$this->id = $dataList['id'];
|
||||
}
|
||||
if (!empty($dataList['name']))
|
||||
{
|
||||
$this->name = $dataList['name'];
|
||||
}
|
||||
if (!empty($dataList['address']))
|
||||
{
|
||||
$this->address = $dataList['address'];
|
||||
}
|
||||
if (isset($dataList['active']))
|
||||
{
|
||||
$this->active = $dataList['active'];
|
||||
}
|
||||
if (!empty($dataList['seasonList']))
|
||||
{
|
||||
foreach ($dataList['seasonList'] as $seasonItem)
|
||||
{
|
||||
$seasonDto = new SeasonDto();
|
||||
$seasonDto->fillFromArray($seasonItem);
|
||||
$this->seasonDtoList[] = $seasonDto;
|
||||
}
|
||||
}
|
||||
if (!empty($dataList['createdAt']))
|
||||
{
|
||||
$this->createdAt = \DateTime::createFromFormat('Y-m-d H:i:s', $dataList['createdAt'], new \DateTimeZone('Europe/Madrid'));
|
||||
}
|
||||
}
|
||||
|
||||
public function fillFromObject(Facility $facilityEntity): void
|
||||
{
|
||||
if ($facilityEntity->getId() !== null)
|
||||
{
|
||||
$this->id = $facilityEntity->getId();
|
||||
}
|
||||
if ($facilityEntity->getName() !== null)
|
||||
{
|
||||
$this->name = $facilityEntity->getName();
|
||||
}
|
||||
if ($facilityEntity->getAddress() !== null)
|
||||
{
|
||||
$this->address = $facilityEntity->getAddress();
|
||||
}
|
||||
if ($facilityEntity->getCreatedAt() !== null)
|
||||
{
|
||||
$this->createdAt = new \DateTime($facilityEntity->getCreatedAt(), new \DateTimeZone('Europe/Madrid'));
|
||||
}
|
||||
}
|
||||
|
||||
public function validate(): void
|
||||
{
|
||||
// if (empty($this->name))
|
||||
// {
|
||||
// $this->validationErrors[] = 'El nombre del equipo no puede estar vacío.';
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Dto;
|
||||
|
||||
use DMD\LaLigaApi\Entity\File;
|
||||
|
||||
class FileDto
|
||||
{
|
||||
public int $id;
|
||||
public string $name;
|
||||
public string $type;
|
||||
public \DateTime $createdAt;
|
||||
public GameDto $gameDto;
|
||||
public PlayerDto $playerDto;
|
||||
public SeasonDto $seasonDto;
|
||||
|
||||
public function fillFromArray(array $dataList): void
|
||||
{
|
||||
if (isset($dataList['id']))
|
||||
{
|
||||
$this->id = $dataList['id'];
|
||||
}
|
||||
if (!empty($dataList['name']))
|
||||
{
|
||||
$this->name = $dataList['name'];
|
||||
}
|
||||
if (!empty($dataList['type']))
|
||||
{
|
||||
$this->type = $dataList['type'];
|
||||
}
|
||||
if (!empty($dataList['createdAt']))
|
||||
{
|
||||
$this->createdAt = \DateTime::createFromFormat('Y-m-d H:i:s', $dataList['createdAt']);
|
||||
}
|
||||
}
|
||||
|
||||
public function fillFromObject(File $fileEntity): void
|
||||
{
|
||||
if ($fileEntity->getId() !== null)
|
||||
{
|
||||
$this->id = $fileEntity->getId();
|
||||
}
|
||||
if ($fileEntity->getName() !== null)
|
||||
{
|
||||
$this->name = $fileEntity->getName();
|
||||
}
|
||||
if ($fileEntity->getPlayer() !== null)
|
||||
{
|
||||
$playerDto = new PlayerDto();
|
||||
$playerDto->fillFromObject($fileEntity->getPlayer());
|
||||
$this->playerDto = $playerDto;
|
||||
}
|
||||
if ($fileEntity->getSeason() !== null)
|
||||
{
|
||||
$seasonDto = new SeasonDto();
|
||||
$seasonDto->fillFromObject($fileEntity->getSeason());
|
||||
$this->seasonDto = $seasonDto;
|
||||
}
|
||||
if ($fileEntity->getGame() !== null)
|
||||
{
|
||||
$gameDto = new GameDto();
|
||||
$gameDto->fillFromObject($fileEntity->getGame());
|
||||
$this->gameDto = $gameDto;
|
||||
}
|
||||
}
|
||||
|
||||
public function validate(): void
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,194 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Dto;
|
||||
|
||||
use DMD\LaLigaApi\Entity\Game;
|
||||
|
||||
class GameDto
|
||||
{
|
||||
public int $id;
|
||||
public TeamDto $homeTeamDto;
|
||||
public TeamDto $awayTeamDto;
|
||||
public \DateTime $plannedDate;
|
||||
public \DateTime $gameDateTime;
|
||||
public string $notes;
|
||||
public array $fileDtoList;
|
||||
public SeasonDto $seasonDto;
|
||||
public FacilityDto $facilityDto;
|
||||
public int $pointsHome;
|
||||
public int $pointsAway;
|
||||
public \DateTimeImmutable $createdAt;
|
||||
public \DateTimeImmutable $updatedAt;
|
||||
public array $validationErrors;
|
||||
|
||||
public function toArray(): array
|
||||
{
|
||||
$cleanResponseArray = [];
|
||||
$responseArray = [
|
||||
'id' => $this->id ?? null,
|
||||
'homeTeam' => $this->homeTeamDto->toArray() ?? [],
|
||||
'awayTeam' => $this->awayTeamDto->toArray() ?? [],
|
||||
'plannedDate' => !empty($this->plannedDate) ? $this->plannedDate->format('Y-m-d H:i:s') : null,
|
||||
'gameDateTime' => !empty($this->gameDateTime) ? $this->gameDateTime->format('Y-m-d H:i:s') : null,
|
||||
'season' => $this->seasonDto->toArray() ?? [],
|
||||
'notes' => $this->notes ?? null,
|
||||
'facility' => $this->facilityDto->toArray() ?? [],
|
||||
'pointsHome' => $this->pointsHome ?? 0,
|
||||
'pointsAway' => $this->pointsAway ?? 0,
|
||||
'createdAt' => !empty($this->createdAt) ? $this->createdAt->format('Y-m-d H:i:s') : null,
|
||||
'updatedAt' => !empty($this->updatedAt) ? $this->updatedAt->format('Y-m-d H:i:s') : null
|
||||
];
|
||||
foreach ($responseArray as $key => $value)
|
||||
{
|
||||
if ($value !== null)
|
||||
{
|
||||
$cleanResponseArray[$key] = $value;
|
||||
}
|
||||
}
|
||||
return $cleanResponseArray;
|
||||
}
|
||||
|
||||
public function fillFromArray(array $dataList): void
|
||||
{
|
||||
if (!empty($dataList['id']))
|
||||
{
|
||||
$this->id = $dataList['id'];
|
||||
}
|
||||
if (!empty($dataList['plannedDate']))
|
||||
{
|
||||
$this->plannedDate = new \DateTime($dataList['plannedDate']);
|
||||
}
|
||||
if (!empty($dataList['gameDateTime']))
|
||||
{
|
||||
$this->gameDateTime = new \DateTime($dataList['gameDateTime']);
|
||||
}
|
||||
if (!empty($dataList['notes']))
|
||||
{
|
||||
$this->notes = $dataList['notes'];
|
||||
}
|
||||
if (!empty($dataList['pointsHome']))
|
||||
{
|
||||
$this->pointsHome = $dataList['pointsHome'];
|
||||
}
|
||||
if (!empty($dataList['pointsAway']))
|
||||
{
|
||||
$this->pointsAway = $dataList['pointsAway'];
|
||||
}
|
||||
if (!empty($dataList['createdAt']))
|
||||
{
|
||||
$this->createdAt = new \DateTimeImmutable($dataList['createdAt'], new \DateTimeZone('Europe/Madrid'));
|
||||
}
|
||||
if (!empty($dataList['updatedAt']))
|
||||
{
|
||||
$this->updatedAt = new \DateTimeImmutable($dataList['updatedAt'], new \DateTimeZone('Europe/Madrid'));
|
||||
}
|
||||
}
|
||||
|
||||
public function fillFromObject(Game $gameEntity): void
|
||||
{
|
||||
if ($gameEntity->getId() !== null)
|
||||
{
|
||||
$this->id = $gameEntity->getId();
|
||||
}
|
||||
if ($gameEntity->getSeason() !== null)
|
||||
{
|
||||
$seasonDto = new SeasonDto();
|
||||
$seasonDto->fillFromObject($gameEntity->getSeason());
|
||||
$this->seasonDto = $seasonDto;
|
||||
}
|
||||
if ($gameEntity->getFacility() !== null)
|
||||
{
|
||||
$facilityDto = new FacilityDto();
|
||||
$facilityDto->fillFromObject($gameEntity->getFacility());
|
||||
$this->facilityDto = $facilityDto;
|
||||
}
|
||||
if ($gameEntity->getHomeTeam() !== null)
|
||||
{
|
||||
$teamDto = new TeamDto();
|
||||
$teamDto->fillFromObject($gameEntity->getHomeTeam());
|
||||
$this->homeTeamDto = $teamDto;
|
||||
}
|
||||
if ($gameEntity->getAwayTeam() !== null)
|
||||
{
|
||||
$teamDto = new TeamDto();
|
||||
$teamDto->fillFromObject($gameEntity->getAwayTeam());
|
||||
$this->awayTeamDto = $teamDto;
|
||||
}
|
||||
if ($gameEntity->getFiles() !== null)
|
||||
{
|
||||
$fileIterator = $gameEntity->getFiles()->getIterator();
|
||||
foreach ($fileIterator as $fileEntity)
|
||||
{
|
||||
$fileDto = new FileDto();
|
||||
$fileDto->fillFromObject($fileEntity);
|
||||
$this->fileDtoList[] = $fileDto;
|
||||
}
|
||||
}
|
||||
if ($gameEntity->getGameDateTime() !== null)
|
||||
{
|
||||
$this->gameDateTime = new \DateTime($gameEntity->getGameDateTime()->format('Y-m-d H:i:s'));
|
||||
}
|
||||
if ($gameEntity->getCreatedAt() !== null)
|
||||
{
|
||||
$this->createdAt = $gameEntity->getCreatedAt();
|
||||
}
|
||||
if ($gameEntity->getUpdatedAt() !== null)
|
||||
{
|
||||
$this->createdAt = $gameEntity->getUpdatedAt();
|
||||
}
|
||||
if ($gameEntity->getPlannedDate() !== null)
|
||||
{
|
||||
$this->plannedDate = new \DateTime($gameEntity->getPlannedDate()->format('Y-m-d H:i:s'));
|
||||
}
|
||||
if ($gameEntity->getNotes() !== null)
|
||||
{
|
||||
$this->notes = $gameEntity->getNotes();
|
||||
}
|
||||
if ($gameEntity->getNotes() !== null)
|
||||
{
|
||||
$this->notes = $gameEntity->getNotes();
|
||||
}
|
||||
if ($gameEntity->getPointsAway() !== null)
|
||||
{
|
||||
$this->pointsAway = $gameEntity->getPointsAway();
|
||||
}
|
||||
if ($gameEntity->getPointsHome() !== null)
|
||||
{
|
||||
$this->pointsAway = $gameEntity->getPointsHome();
|
||||
}
|
||||
}
|
||||
|
||||
public function validate(): void
|
||||
{
|
||||
if (empty($this->name))
|
||||
{
|
||||
$this->validationErrors[] = 'El nombre no puede estar vacío.';
|
||||
}
|
||||
if (
|
||||
empty($this->pointsPerWin)
|
||||
)
|
||||
{
|
||||
$this->validationErrors[] = 'Los puntos por partido ganado no pueden estar vacíos.';
|
||||
}
|
||||
if (
|
||||
isset($this->pointsPerDraw, $this->pointsPerWin, $this->pointsPerLoss) &&
|
||||
(($this->pointsPerWin <= $this->pointsPerDraw) ||
|
||||
($this->pointsPerWin <= $this->pointsPerLoss))
|
||||
)
|
||||
{
|
||||
$this->validationErrors[] = 'Los puntos por partido ganado deben ser superiores a los puntos por empate y por perdida.';
|
||||
}
|
||||
if (($this->pointsPerDraw > $this->pointsPerWin))
|
||||
{
|
||||
$this->validationErrors[] = 'Los puntos por empate deben ser inferiores a los puntos por partido ganado.';
|
||||
}
|
||||
if (($this->pointsPerDraw < $this->pointsPerLoss))
|
||||
{
|
||||
$this->validationErrors[] = 'Los puntos por empate deben ser superiores a los puntos por partido perdido.';
|
||||
}
|
||||
if ($this->pointsPerWin + $this->pointsPerDraw + $this->pointsPerLoss > 20)
|
||||
{
|
||||
$this->validationErrors[] = 'La suma de los puntos por partidos ganados, perdidos y empatados no puede ser superior a 20.';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,220 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Dto;
|
||||
|
||||
use DMD\LaLigaApi\Exception\ValidationException;
|
||||
use DMD\LaLigaApi\Entity\League;
|
||||
|
||||
class LeagueDto
|
||||
{
|
||||
|
||||
public int $id;
|
||||
public string $name;
|
||||
public string $city;
|
||||
public string $logo;
|
||||
public string $description;
|
||||
public int $pointsPerWin;
|
||||
public int $pointsPerDraw;
|
||||
public int $pointsPerLoss;
|
||||
public int $matchesBetweenTeams;
|
||||
public array $blockedMatchDates;
|
||||
public bool $active;
|
||||
public array $seasonDtoList;
|
||||
public int $presidentId;
|
||||
public bool $isPublic;
|
||||
public \DateTimeImmutable $createdAt;
|
||||
public array $validationErrors;
|
||||
|
||||
public function toArray(): array
|
||||
{
|
||||
$seasonIdList = [];
|
||||
if (!empty($this->seasonDtoList))
|
||||
{
|
||||
foreach ($this->seasonDtoList as $seasonDto)
|
||||
{
|
||||
$seasonIdList[] = $seasonDto->id;
|
||||
}
|
||||
}
|
||||
return [
|
||||
'id' => $this->id ?? null,
|
||||
'name' => $this->name ?? null,
|
||||
'logo' => $this->logo ?? null,
|
||||
'description' => $this->description ?? null,
|
||||
'pointsPerWin' => $this->pointsPerWin ?? null,
|
||||
'pointsPerDraw' => $this->pointsPerDraw ?? null,
|
||||
'pointsPerLoss' => $this->pointsPerLoss ?? null,
|
||||
'matchesBetweenTeams' => $this->matchesBetweenTeams ?? [],
|
||||
'blockedMatchDates' => $this->blockedMatchDates ?? [],
|
||||
'active' => $this->active ?? null,
|
||||
'isPublic' => $this->isPublic ?? null,
|
||||
'seasonIdList' => $seasonIdList,
|
||||
'presidentId' => $this->presidentId ?? null,
|
||||
'createdAt' => !empty($this->createdAt) ? $this->createdAt->format('Y-m-d H:i:s') : null
|
||||
];
|
||||
}
|
||||
|
||||
public function fillFromArray(array $dataList): void
|
||||
{
|
||||
if (isset($dataList['id']))
|
||||
{
|
||||
$this->id = $dataList['id'];
|
||||
}
|
||||
if (!empty($dataList['name']))
|
||||
{
|
||||
$this->name = $dataList['name'];
|
||||
}
|
||||
if (!empty($dataList['city']))
|
||||
{
|
||||
$this->city = $dataList['city'];
|
||||
}
|
||||
if (!empty($dataList['logo']))
|
||||
{
|
||||
$this->logo = $dataList['logo'];
|
||||
}
|
||||
if (!empty($dataList['description']))
|
||||
{
|
||||
$this->description = $dataList['description'];
|
||||
}
|
||||
if (isset($dataList['pointsPerWin']))
|
||||
{
|
||||
$this->pointsPerWin = (int) $dataList['pointsPerWin'];
|
||||
}
|
||||
if (isset($dataList['pointsPerDraw']))
|
||||
{
|
||||
$this->pointsPerDraw = (int) $dataList['pointsPerDraw'];
|
||||
}
|
||||
if (isset($dataList['pointsPerLoss']))
|
||||
{
|
||||
$this->pointsPerLoss = (int) $dataList['pointsPerLoss'];
|
||||
}
|
||||
if (isset($dataList['matchesBetweenTeams']))
|
||||
{
|
||||
$this->matchesBetweenTeams = (int) $dataList['matchesBetweenTeams'];
|
||||
}
|
||||
if (isset($dataList['blockedMatchDates']))
|
||||
{
|
||||
$this->blockedMatchDates = $dataList['blockedMatchDates'];
|
||||
}
|
||||
if (!empty($dataList['seasonList']))
|
||||
{
|
||||
foreach ($dataList['seasonList'] as $seasonItem)
|
||||
{
|
||||
$seasonDto = new SeasonDto();
|
||||
$seasonDto->fillFromArray($seasonItem);
|
||||
$this->seasonDtoList[] = $seasonDto;
|
||||
}
|
||||
}
|
||||
if (isset($dataList['isPublic']))
|
||||
{
|
||||
$this->isPublic = (bool) $dataList['isPublic'];
|
||||
}
|
||||
if (!empty($dataList['createdAt']))
|
||||
{
|
||||
$this->createdAt = \DateTimeImmutable::createFromFormat('Y-m-d H:i:s', $dataList['createdAt']);
|
||||
}
|
||||
}
|
||||
|
||||
public function fillFromObject(League $leagueObj): void
|
||||
{
|
||||
if ($leagueObj->getId() !== null)
|
||||
{
|
||||
$this->id = $leagueObj->getId();
|
||||
}
|
||||
if ($leagueObj->getName() !== null)
|
||||
{
|
||||
$this->name = $leagueObj->getName();
|
||||
}
|
||||
if ($leagueObj->getCity() !== null)
|
||||
{
|
||||
$this->city = $leagueObj->getCity();
|
||||
}
|
||||
if ($leagueObj->getDescription() !== null)
|
||||
{
|
||||
$this->description = $leagueObj->getDescription();
|
||||
}
|
||||
if ($leagueObj->getLogo() !== null)
|
||||
{
|
||||
$this->logo = $leagueObj->getLogo();
|
||||
}
|
||||
if ($leagueObj->getPointsPerWin() !== null)
|
||||
{
|
||||
$this->pointsPerWin = $leagueObj->getPointsPerWin();
|
||||
}
|
||||
if ($leagueObj->getPointsPerDraw() !== null)
|
||||
{
|
||||
$this->pointsPerDraw = $leagueObj->getPointsPerDraw();
|
||||
}
|
||||
if ($leagueObj->getPointsPerLoss() !== null)
|
||||
{
|
||||
$this->pointsPerLoss = $leagueObj->getPointsPerLoss();
|
||||
}
|
||||
if ($leagueObj->getMatchesBetweenTeams() !== null)
|
||||
{
|
||||
$this->matchesBetweenTeams = $leagueObj->getMatchesBetweenTeams();
|
||||
}
|
||||
if ($leagueObj->getBlockedMatchDates() !== null)
|
||||
{
|
||||
$this->blockedMatchDates = $leagueObj->getBlockedMatchDates();
|
||||
}
|
||||
if ($leagueObj->getCreatedAt() !== null)
|
||||
{
|
||||
$this->createdAt = $leagueObj->getCreatedAt();
|
||||
}
|
||||
if ($leagueObj->isPublic() !== null)
|
||||
{
|
||||
$this->isPublic = $leagueObj->isPublic();
|
||||
}
|
||||
if ($leagueObj->getSeasons() !== null)
|
||||
{
|
||||
foreach ($leagueObj->getSeasons() as $seasonObj)
|
||||
{
|
||||
$seasonDto = new SeasonDto();
|
||||
$seasonDto->fillFromObject($seasonObj);
|
||||
$this->seasonDtoList[] = $seasonDto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws ValidationException
|
||||
*/
|
||||
public function validate(): void
|
||||
{
|
||||
if (empty($this->name))
|
||||
{
|
||||
$this->validationErrors[] = 'El nombre no puede estar vacío.';
|
||||
}
|
||||
if (empty($this->city))
|
||||
{
|
||||
$this->validationErrors[] = 'La localidad no puede estar vacía.';
|
||||
}
|
||||
if (empty($this->pointsPerWin))
|
||||
{
|
||||
$this->validationErrors[] = 'Los puntos por partido ganado no pueden estar vacíos.';
|
||||
}
|
||||
if (
|
||||
isset($this->pointsPerDraw, $this->pointsPerWin, $this->pointsPerLoss) &&
|
||||
(($this->pointsPerWin <= $this->pointsPerDraw) ||
|
||||
($this->pointsPerWin <= $this->pointsPerLoss))
|
||||
)
|
||||
{
|
||||
$this->validationErrors[] = 'Los puntos por partido ganado deben ser superiores a los puntos por empate y por perdida.';
|
||||
}
|
||||
if (($this->pointsPerDraw > $this->pointsPerWin))
|
||||
{
|
||||
$this->validationErrors[] = 'Los puntos por empate deben ser inferiores a los puntos por partido ganado.';
|
||||
}
|
||||
if (($this->pointsPerDraw < $this->pointsPerLoss))
|
||||
{
|
||||
$this->validationErrors[] = 'Los puntos por empate deben ser superiores a los puntos por partido perdido.';
|
||||
}
|
||||
if ($this->pointsPerWin + $this->pointsPerDraw + $this->pointsPerLoss > 20)
|
||||
{
|
||||
$this->validationErrors[] = 'La suma de los puntos por partidos ganados, perdidos y empatados no puede ser superior a 20.';
|
||||
}
|
||||
if (!empty($this->validationErrors))
|
||||
{
|
||||
throw new ValidationException($this->validationErrors);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,137 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Dto;
|
||||
|
||||
use DMD\LaLigaApi\Entity\Notification;
|
||||
|
||||
class NotificationDto
|
||||
{
|
||||
public static string $TYPE_JOIN_LEAGUE = 'joinLeague';
|
||||
public static string $TYPE_JOIN_TEAM = 'joinTeam';
|
||||
public static string $TYPE_CAPTAIN_REQUEST = 'captainRequest';
|
||||
|
||||
public int $id;
|
||||
public string $type;
|
||||
public string $message;
|
||||
|
||||
public int $teamId;
|
||||
public int $leagueId;
|
||||
public int $userWhoFiredEventId;
|
||||
public int $userToNotifyId;
|
||||
public bool $isRead;
|
||||
public \DateTimeImmutable $readAt;
|
||||
public \DateTimeImmutable $createdAt;
|
||||
|
||||
public function toArray(): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id ?? '',
|
||||
'type' => $this->type ?? '',
|
||||
'message' => $this->message ?? '',
|
||||
'teamId' => $this->teamId ?? '',
|
||||
'leagueId' => $this->leagueId ?? '',
|
||||
'isRead' => $this->isRead ?? false,
|
||||
'readAt' => !empty($this->readAt) ? $this->readAt->format('Y-m-d H:i:s') : '',
|
||||
'createdAt' => !empty($this->createdAt) ? $this->createdAt->format('Y-m-d H:i:s') : ''
|
||||
];
|
||||
}
|
||||
|
||||
public function fillFromArray(array $dataList): void
|
||||
{
|
||||
if (isset($dataList['id']))
|
||||
{
|
||||
$this->id = $dataList['id'];
|
||||
}
|
||||
if (!empty($dataList['type']))
|
||||
{
|
||||
$this->type = match($dataList['type']) {
|
||||
self::$TYPE_JOIN_LEAGUE => 'JOIN_LEAGUE',
|
||||
self::$TYPE_JOIN_TEAM => 'JOIN_TEAM',
|
||||
self::$TYPE_CAPTAIN_REQUEST => 'CAPTAIN_REQUEST',
|
||||
default => null
|
||||
};
|
||||
}
|
||||
if (!empty($dataList['message']))
|
||||
{
|
||||
$this->message = $dataList['message'];
|
||||
}
|
||||
if (!empty($dataList['isRead']))
|
||||
{
|
||||
$this->isRead = $dataList['isRead'];
|
||||
}
|
||||
if (!empty($dataList['readAt']))
|
||||
{
|
||||
$this->readAt = \DateTimeImmutable::createFromFormat('Y-m-d H:i:s', $dataList['readAt']);
|
||||
}
|
||||
if (!empty($dataList['createdAt']))
|
||||
{
|
||||
$this->createdAt = \DateTimeImmutable::createFromFormat('Y-m-d H:i:s', $dataList['createdAt']);
|
||||
}
|
||||
if (isset($dataList['teamId']))
|
||||
{
|
||||
$this->teamId = (int) $dataList['teamId'];
|
||||
}
|
||||
if (isset($dataList['userWhoFiredEventId']))
|
||||
{
|
||||
$this->userWhoFiredEventId = $dataList['userWhoFiredEventId'];
|
||||
}
|
||||
if (isset($dataList['userToNotifyId']))
|
||||
{
|
||||
$this->userToNotifyId = $dataList['userToNotifyId'];
|
||||
}
|
||||
if (isset($dataList['leagueId']))
|
||||
{
|
||||
$this->leagueId = $dataList['leagueId'];
|
||||
}
|
||||
}
|
||||
|
||||
public function fillFromObj(Notification $notificationObj): self
|
||||
{
|
||||
if ($notificationObj->getId() !== null)
|
||||
{
|
||||
$this->id = $notificationObj->getId();
|
||||
}
|
||||
if ($notificationObj->getType() !== null)
|
||||
{
|
||||
$this->type = $notificationObj->getType();
|
||||
}
|
||||
if ($notificationObj->getMessage() !== null)
|
||||
{
|
||||
$this->message = $notificationObj->getMessage();
|
||||
}
|
||||
if ($notificationObj->getUserWhoFiredEvent() !== null)
|
||||
{
|
||||
$this->userWhoFiredEventId = ($notificationObj->getUserWhoFiredEvent())->getId();
|
||||
}
|
||||
if ($notificationObj->getUserToNotify() !== null)
|
||||
{
|
||||
$this->userToNotifyId = ($notificationObj->getUserToNotify())->getId();
|
||||
}
|
||||
if ($notificationObj->getLeague() !== null)
|
||||
{
|
||||
$this->leagueId = ($notificationObj->getLeague())->getId();
|
||||
}
|
||||
if ($notificationObj->getTeamId() !== null)
|
||||
{
|
||||
$this->teamId = $notificationObj->getTeamId();
|
||||
}
|
||||
if ($notificationObj->isIsRead() !== null)
|
||||
{
|
||||
$this->isRead = $notificationObj->isIsRead();
|
||||
}
|
||||
if ($notificationObj->getReadAt() !== null)
|
||||
{
|
||||
$this->readAt = $notificationObj->getReadAt();
|
||||
}
|
||||
if ($notificationObj->getCreatedAt() !== null)
|
||||
{
|
||||
$this->createdAt = $notificationObj->getCreatedAt();
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function validate(): void
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,127 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Dto;
|
||||
|
||||
use DMD\LaLigaApi\Entity\Player;
|
||||
|
||||
class PlayerDto
|
||||
{
|
||||
public int $id;
|
||||
public string $firstName;
|
||||
public string $lastName;
|
||||
public string $position;
|
||||
public int $jerseyNumber;
|
||||
public bool $isFederated;
|
||||
public string $pictureFileName;
|
||||
public \DateTime $birthday;
|
||||
public array $fileDtoList;
|
||||
public TeamDto $teamDto;
|
||||
public \DateTime $createdAt;
|
||||
|
||||
public function fillFromArray(array $dataList): void
|
||||
{
|
||||
if (isset($dataList['id']))
|
||||
{
|
||||
$this->id = $dataList['id'];
|
||||
}
|
||||
if (!empty($dataList['firstName']))
|
||||
{
|
||||
$this->firstName = $dataList['firstName'];
|
||||
}
|
||||
if (!empty($dataList['lastName']))
|
||||
{
|
||||
$this->lastName = $dataList['lastName'];
|
||||
}
|
||||
if (!empty($dataList['position']))
|
||||
{
|
||||
$this->position = $dataList['position'];
|
||||
}
|
||||
if (!isset($dataList['jerseyNumber']))
|
||||
{
|
||||
$this->jerseyNumber = (int) $dataList['jerseyNumber'];
|
||||
}
|
||||
if (isset($dataList['isFederated']))
|
||||
{
|
||||
$this->isFederated = (bool) $dataList['isFederated'];
|
||||
}
|
||||
if (isset($dataList['pictureFileName']))
|
||||
{
|
||||
$this->pictureFileName = $dataList['pictureFileName'];
|
||||
}
|
||||
if (!empty($dataList['birthday']))
|
||||
{
|
||||
$this->birthday = \DateTime::createFromFormat('Y-m-d', $dataList['birthday']);
|
||||
}
|
||||
if (!empty($dataList['fileList']))
|
||||
{
|
||||
foreach ($dataList['fileList'] as $fileItem)
|
||||
{
|
||||
$fileDto = new FileDto();
|
||||
$fileDto->fillFromArray($fileItem);
|
||||
$this->fileDtoList[] = $fileDto;
|
||||
}
|
||||
}
|
||||
if (!empty($dataList['team']))
|
||||
{
|
||||
$teamDto = new TeamDto();
|
||||
$teamDto->fillFromArray($dataList['team']);
|
||||
$this->teamDto = $teamDto;
|
||||
}
|
||||
if (!empty($dataList['createdAt']))
|
||||
{
|
||||
$this->createdAt = \DateTime::createFromFormat('Y-m-d H:i:s', $dataList['createdAt']);
|
||||
}
|
||||
}
|
||||
|
||||
public function fillFromObject(Player $playerEntity): void
|
||||
{
|
||||
if ($playerEntity->getId() !== null)
|
||||
{
|
||||
$this->id = $playerEntity->getId();
|
||||
}
|
||||
if ($playerEntity->getFirstName() !== null)
|
||||
{
|
||||
$this->firstName = $playerEntity->getFirstName();
|
||||
}
|
||||
if ($playerEntity->getLastName() !== null)
|
||||
{
|
||||
$this->lastName = $playerEntity->getLastName();
|
||||
}
|
||||
if ($playerEntity->getBirthday() !== null)
|
||||
{
|
||||
$this->birthday = new \DateTime($playerEntity->getBirthday()->format('Y-m-d'),new \DateTimeZone('Europe/Madrid'));
|
||||
}
|
||||
if ($playerEntity->getJerseyNumber() !== null)
|
||||
{
|
||||
$this->jerseyNumber = $playerEntity->getJerseyNumber();
|
||||
}
|
||||
if ($playerEntity->getPosition() !== null)
|
||||
{
|
||||
$this->position = $playerEntity->getPosition();
|
||||
}
|
||||
if ($playerEntity->getPictureFileName() !== null)
|
||||
{
|
||||
$this->pictureFileName = $playerEntity->getPictureFileName();
|
||||
}
|
||||
if ($playerEntity->getTeam() !== null)
|
||||
{
|
||||
$teamDto = new TeamDto();
|
||||
$teamDto->fillFromObject($playerEntity->getTeam());
|
||||
$this->teamDto = $teamDto;
|
||||
}
|
||||
if ($playerEntity->getFiles() !== null)
|
||||
{
|
||||
foreach ($playerEntity->getFiles() as $fileEntity)
|
||||
{
|
||||
$fileDto = new FileDto();
|
||||
$fileDto->fillFromObject($fileEntity);
|
||||
$this->fileDtoList[] = $fileDto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function validate(): void
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Dto;
|
||||
|
||||
class SeasonDataDto
|
||||
{
|
||||
public int $id;
|
||||
public int $teamId;
|
||||
public int $points;
|
||||
public int $seasonId;
|
||||
|
||||
public function fillFromArray(array $dataList): void
|
||||
{
|
||||
if (isset($dataList['id']))
|
||||
{
|
||||
$this->id = (int) $dataList['id'];
|
||||
}
|
||||
if (isset($dataList['teamId']))
|
||||
{
|
||||
$this->teamId = $dataList['teamId'];
|
||||
}
|
||||
if (isset($dataList['points']))
|
||||
{
|
||||
$this->points = $dataList['points'];
|
||||
}
|
||||
if (isset($dataList['seasonId']))
|
||||
{
|
||||
$this->seasonId = $dataList['seasonId'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,126 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Dto;
|
||||
|
||||
use DMD\LaLigaApi\Entity\Season;
|
||||
use DMD\LaLigaApi\Exception\ValidationException;
|
||||
|
||||
class SeasonDto
|
||||
{
|
||||
public int $id;
|
||||
public \DateTime $dateStart;
|
||||
public array $teamDtoList;
|
||||
public array $facilityDtoList;
|
||||
public int $leagueId;
|
||||
public array $gameDtoList;
|
||||
public array $seasonDataDtoList;
|
||||
public bool $active;
|
||||
public array $validationErrors;
|
||||
|
||||
public function toArray(): array
|
||||
{
|
||||
$teamList = [];
|
||||
$facilityList = [];
|
||||
if (!empty($this->teamDtoList))
|
||||
{
|
||||
foreach ($this->teamDtoList as $teamDto)
|
||||
{
|
||||
$teamList[] = $teamDto->toArray();
|
||||
}
|
||||
}
|
||||
if (!empty($this->facilityDtoList))
|
||||
{
|
||||
foreach ($this->facilityDtoList as $facilityDto)
|
||||
{
|
||||
$facilityList[] = $facilityDto->toArray();
|
||||
}
|
||||
}
|
||||
return [
|
||||
'id' => $this->id ?? null,
|
||||
'dateStart' => !empty($this->dateStart) ? $this->dateStart->format('Y-m'): null,
|
||||
'leagueId' => $this->leagueId ?? null,
|
||||
'teamList' => $teamList,
|
||||
'facilityList' => $facilityList,
|
||||
'active' => $this->active ?? null
|
||||
];
|
||||
}
|
||||
|
||||
public function fillFromArray(array $dataList): void
|
||||
{
|
||||
if (isset($dataList['id']))
|
||||
{
|
||||
$this->id = (int) $dataList['id'];
|
||||
}
|
||||
if (!empty($dataList['dateStart']))
|
||||
{
|
||||
$dateStart = \DateTime::createFromFormat('Y-m' ,$dataList['dateStart']);
|
||||
if ($dateStart)
|
||||
{
|
||||
$this->dateStart = $dateStart;
|
||||
}
|
||||
}
|
||||
if (isset($dataList['active']))
|
||||
{
|
||||
$this->active = $dataList['active'];
|
||||
}
|
||||
if (isset($dataList['teamList']))
|
||||
{
|
||||
foreach ($dataList['teamList'] as $teamName)
|
||||
{
|
||||
$teamDto = new TeamDto();
|
||||
$teamDto->name = $teamName;
|
||||
$this->teamDtoList[] = $teamDto;
|
||||
}
|
||||
}
|
||||
if (!empty($dataList['facilityList']))
|
||||
{
|
||||
foreach ($dataList['facilityList'] as $facilityItem)
|
||||
{
|
||||
$facilityDto = new FacilityDto();
|
||||
$facilityDto->fillFromArray($facilityItem);
|
||||
$this->facilityDtoList[] = $facilityDto;
|
||||
}
|
||||
}
|
||||
if (isset($dataList['gameList']))
|
||||
{
|
||||
foreach ($dataList['gameList'] as $gameItem)
|
||||
{
|
||||
$gameDto = new GameDto();
|
||||
$gameDto->fillFromArray($gameItem);
|
||||
$this->gameDtoList[] = $gameDto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function fillFromObject(Season $seasonObj): void
|
||||
{
|
||||
if ($seasonObj->getId() !== null)
|
||||
{
|
||||
$this->id = $seasonObj->getId();
|
||||
}
|
||||
if ($seasonObj->getDateStart() !== null)
|
||||
{
|
||||
$this->dateStart = $seasonObj->getDateStart();
|
||||
}
|
||||
$leagueObj = $seasonObj->getLeague();
|
||||
if ($leagueObj !== null)
|
||||
{
|
||||
$this->leagueId = $leagueObj->getId();
|
||||
}
|
||||
if ($leagueObj->isActive() !== null)
|
||||
{
|
||||
$this->active = $leagueObj->isActive();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws ValidationException
|
||||
*/
|
||||
public function validate(): void
|
||||
{
|
||||
if (!empty($this->validationErrors))
|
||||
{
|
||||
throw new ValidationException($this->validationErrors);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,127 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Dto;
|
||||
|
||||
use DMD\LaLigaApi\Entity\Facility;
|
||||
use DMD\LaLigaApi\Entity\Team;
|
||||
use DMD\LaLigaApi\Exception\ValidationException;
|
||||
|
||||
class TeamDto
|
||||
{
|
||||
public int $id;
|
||||
public string $name;
|
||||
public bool $active;
|
||||
public array $seasonDtoList;
|
||||
public array $playerDtoList;
|
||||
public array $validationErrors;
|
||||
public UserDto $captainDto;
|
||||
public \DateTimeImmutable $createdAt;
|
||||
|
||||
public function toArray(): array
|
||||
{
|
||||
$seasonList = [];
|
||||
$playerList = [];
|
||||
if (!empty($this->seasonDtoList))
|
||||
{
|
||||
foreach ($this->seasonDtoList as $seasonDto)
|
||||
{
|
||||
$seasonList = $seasonDto->toArray();
|
||||
}
|
||||
}
|
||||
if (!empty($this->playerDtoList))
|
||||
{
|
||||
foreach ($this->playerDtoList as $playerDto)
|
||||
{
|
||||
$playerList = $playerDto->toArray();
|
||||
}
|
||||
}
|
||||
return [
|
||||
'name' => $this->name ?? '',
|
||||
'playerList' => $playerList,
|
||||
'seasonList' => $seasonList,
|
||||
'captainId' => $this->captainDto?->id,
|
||||
'createdAt' => $this->createdAt->format('Y-m-d')
|
||||
];
|
||||
}
|
||||
|
||||
public function fillFromArray(array $dataList): void
|
||||
{
|
||||
if (isset($dataList['id']))
|
||||
{
|
||||
$this->id = $dataList['id'];
|
||||
}
|
||||
if (!empty($dataList['name']))
|
||||
{
|
||||
$this->name = $dataList['name'];
|
||||
}
|
||||
if (isset($dataList['active']))
|
||||
{
|
||||
$this->active = $dataList['active'];
|
||||
}
|
||||
if (!empty($dataList['seasonList']))
|
||||
{
|
||||
foreach ($dataList['seasonList'] as $seasonItem)
|
||||
{
|
||||
$seasonDto = new SeasonDto();
|
||||
$seasonDto->fillFromArray($seasonItem);
|
||||
$this->seasonDtoList[] = $seasonDto;
|
||||
}
|
||||
}
|
||||
if (!empty($dataList['playerList']))
|
||||
{
|
||||
foreach ($dataList['playerList'] as $playerItem)
|
||||
{
|
||||
$playerDto = new PlayerDto();
|
||||
$playerDto->fillFromArray($playerItem);
|
||||
$this->playerDtoList[] = $playerDto;
|
||||
}
|
||||
}
|
||||
if (!empty($dataList['captain']))
|
||||
{
|
||||
$captainDto = new UserDto();
|
||||
$captainDto->fillFromArray($dataList['captain']);
|
||||
$this->captainDto = $captainDto;
|
||||
}
|
||||
if (!empty($dataList['createdAt']))
|
||||
{
|
||||
$this->createdAt = \DateTimeImmutable::createFromFormat('Y-m-d H:i:s', $dataList['createdAt'], new \DateTimeZone('Europe/Madrid'));
|
||||
}
|
||||
}
|
||||
|
||||
public function fillFromObject(Team $teamEntity): void
|
||||
{
|
||||
if ($teamEntity->getId())
|
||||
{
|
||||
$this->id = $teamEntity->getId();
|
||||
}
|
||||
if ($teamEntity->getName())
|
||||
{
|
||||
$this->name = $teamEntity->getName();
|
||||
}
|
||||
if ($teamEntity->getPlayers())
|
||||
{
|
||||
foreach ($teamEntity->getPlayers() as $playerEntity)
|
||||
{
|
||||
$playerDto = new PlayerDto();
|
||||
$playerDto->fillFromObject($playerEntity);
|
||||
$this->playerDtoList[] = $playerDto;
|
||||
}
|
||||
}
|
||||
if ($teamEntity->getCreatedAt())
|
||||
{
|
||||
$this->createdAt = $teamEntity->getCreatedAt();
|
||||
}
|
||||
}
|
||||
|
||||
public function validate(): void
|
||||
{
|
||||
if (empty($this->name))
|
||||
{
|
||||
$this->validationErrors[] = 'El nombre del equipo no puede estar vacío.';
|
||||
}
|
||||
if (!empty($this->validationErrors))
|
||||
{
|
||||
throw new ValidationException($this->validationErrors);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,164 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Dto;
|
||||
|
||||
use DMD\LaLigaApi\Entity\User;
|
||||
|
||||
class UserDto
|
||||
{
|
||||
public int $id;
|
||||
public array $roles;
|
||||
public string $email;
|
||||
public string $password;
|
||||
public string $firstName;
|
||||
public string $lastName;
|
||||
public string $phone;
|
||||
public string $profilePicture;
|
||||
public \DateTimeInterface $birthday;
|
||||
public array $noteList;
|
||||
public bool $active;
|
||||
public array $notificationDtoList;
|
||||
public array $validationErrors;
|
||||
|
||||
public function toArray(): array
|
||||
{
|
||||
if (!empty($this->notificationDtoList))
|
||||
{
|
||||
foreach ($this->notificationDtoList as $notificationDto)
|
||||
{
|
||||
$notificationArray[] = $notificationDto->toArray();
|
||||
}
|
||||
}
|
||||
return [
|
||||
'id' => $this->id ?? null,
|
||||
'email' => $this->email ?? null,
|
||||
'firstName' => $this->firstName ?? null,
|
||||
'lastName' => $this->lastName ?? null,
|
||||
'phone' => $this->phone,
|
||||
'profilePicture' => $this->profilePicture ?? null,
|
||||
'birthday' => $this->birthday->format('Y-m-d'),
|
||||
'noteList' => $this->noteList ?? [],
|
||||
'notificationList' => $notificationArray ?? []
|
||||
];
|
||||
}
|
||||
|
||||
public function fillFromObject(User $userObj): void
|
||||
{
|
||||
if ($userObj->getId() !== null)
|
||||
{
|
||||
$this->id = $userObj->getId();
|
||||
}
|
||||
if ($userObj->getEmail() !== null)
|
||||
{
|
||||
$this->email = $userObj->getEmail();
|
||||
}
|
||||
if ($userObj->getFirstName() !== null)
|
||||
{
|
||||
$this->firstName = $userObj->getFirstName();
|
||||
}
|
||||
if ($userObj->getLastName() !== null)
|
||||
{
|
||||
$this->lastName = $userObj->getLastName();
|
||||
}
|
||||
if ($userObj->getPhone() !== null)
|
||||
{
|
||||
$this->phone = $userObj->getPhone();
|
||||
}
|
||||
if ($userObj->getProfilePicture() !== null)
|
||||
{
|
||||
$this->profilePicture = $userObj->getProfilePicture();
|
||||
}
|
||||
if ($userObj->getBirthday() !== null)
|
||||
{
|
||||
$this->birthday = $userObj->getBirthday();
|
||||
}
|
||||
if ($userObj->getNoteList() !== null)
|
||||
{
|
||||
$this->noteList = $userObj->getNoteList();
|
||||
}
|
||||
}
|
||||
|
||||
public function fillFromArray(array $dataList): void
|
||||
{
|
||||
if (!empty($dataList['id']))
|
||||
{
|
||||
$this->id = $dataList['id'];
|
||||
}
|
||||
if (!empty($dataList['email']))
|
||||
{
|
||||
$this->email = trim($dataList['email']);
|
||||
}
|
||||
if (!empty($dataList['password']))
|
||||
{
|
||||
$this->password = trim($dataList['password']);
|
||||
}
|
||||
if (!empty($dataList['firstName']))
|
||||
{
|
||||
$this->firstName = $dataList['firstName'];
|
||||
}
|
||||
if (!empty($dataList['lastName']))
|
||||
{
|
||||
$this->lastName = $dataList['lastName'];
|
||||
}
|
||||
if (!empty($dataList['phone']))
|
||||
{
|
||||
$this->phone = $dataList['phone'];
|
||||
}
|
||||
if (!empty($dataList['profilePicture']))
|
||||
{
|
||||
$this->profilePicture = $dataList['profilePicture'];
|
||||
}
|
||||
if (!empty($dataList['birthday']))
|
||||
{
|
||||
$this->birthday = \DateTime::createFromFormat('Y-m-d', $dataList['birthday']);
|
||||
}
|
||||
if (!empty($dataList['notes']))
|
||||
{
|
||||
$this->noteList = $dataList['notes'];
|
||||
}
|
||||
if (isset($dataList['active']))
|
||||
{
|
||||
$this->active = $dataList['active'];
|
||||
}
|
||||
}
|
||||
|
||||
public function validate(): void
|
||||
{
|
||||
if (empty($this->email))
|
||||
{
|
||||
$this->validationErrors[] = 'El correo no puede estar vacío.';
|
||||
}
|
||||
if (!empty($this->email) && !(filter_var($this->email, FILTER_VALIDATE_EMAIL)))
|
||||
{
|
||||
$this->validationErrors[] = 'El correo no está en un formato válido.';
|
||||
}
|
||||
if (empty($this->firstName))
|
||||
{
|
||||
$this->validationErrors[] = 'El nombre no puede estar vacío';
|
||||
}
|
||||
if (empty($this->lastName))
|
||||
{
|
||||
$this->validationErrors[] = 'El apellido no puede estar vacío';
|
||||
}
|
||||
if (strlen($this->phone) !== 9)
|
||||
{
|
||||
$this->validationErrors[] = 'El número de teléfono debe tener 9 dígitos.';
|
||||
}
|
||||
if (!preg_match('@[A-Z]@', $this->password))
|
||||
{
|
||||
$this->validationErrors[] = 'La contraseña debe contener al menos una letra mayúscula.';
|
||||
}
|
||||
if (!preg_match('@[0-9]@', $this->password))
|
||||
{
|
||||
$this->validationErrors[] = 'La contraseña debe contener al menos un número.';
|
||||
}
|
||||
if (!preg_match('@\W@', $this->password))
|
||||
{
|
||||
$this->validationErrors[] = 'La contraseña debe contener al menos un caracter especial.';
|
||||
}
|
||||
if (strlen($this->password) < 8)
|
||||
{
|
||||
$this->validationErrors[] = 'La contraseña debe contener al menos 8 caracteres.';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Entity;
|
||||
|
||||
use DMD\LaLigaApi\Repository\CustomRoleRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: CustomRoleRepository::class)]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
class CustomRole
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $name = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'customRoles')]
|
||||
private ?User $user = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?\DateTimeImmutable $createdAt = null;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getName(): ?string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function setName(?string $name): static
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getUser(): ?User
|
||||
{
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
public function setUser(?User $user): static
|
||||
{
|
||||
$this->user = $user;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCreatedAt(): ?\DateTimeImmutable
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
||||
#[ORM\PrePersist]
|
||||
public function setCreatedAt(): static
|
||||
{
|
||||
$this->createdAt = new \DateTimeImmutable('now', new \DateTimeZone('Europe/Madrid'));
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,122 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Entity;
|
||||
|
||||
use DMD\LaLigaApi\Repository\FacilityRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: FacilityRepository::class)]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
class Facility
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $name = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $address = null;
|
||||
|
||||
#[ORM\OneToMany(mappedBy: 'facility', targetEntity: Game::class)]
|
||||
private Collection $games;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'facilities')]
|
||||
private ?Season $season = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?\DateTimeImmutable $createdAt = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->games = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getName(): ?string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function setName(?string $name): static
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAddress(): ?string
|
||||
{
|
||||
return $this->address;
|
||||
}
|
||||
|
||||
public function setAddress(?string $address): static
|
||||
{
|
||||
$this->address = $address;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Game>
|
||||
*/
|
||||
public function getGames(): Collection
|
||||
{
|
||||
return $this->games;
|
||||
}
|
||||
|
||||
public function addGame(Game $game): static
|
||||
{
|
||||
if (!$this->games->contains($game)) {
|
||||
$this->games->add($game);
|
||||
$game->setFacility($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeGame(Game $game): static
|
||||
{
|
||||
if ($this->games->removeElement($game)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($game->getFacility() === $this) {
|
||||
$game->setFacility(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSeason(): ?Season
|
||||
{
|
||||
return $this->season;
|
||||
}
|
||||
|
||||
public function setSeason(?Season $season): static
|
||||
{
|
||||
$this->season = $season;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCreatedAt(): ?\DateTimeImmutable
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
||||
#[ORM\PrePersist]
|
||||
public function setCreatedAt(): void
|
||||
{
|
||||
$timezone = new \DateTimeZone('Europe/Madrid');
|
||||
$this->createdAt = new \DateTimeImmutable('now', $timezone);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,111 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Entity;
|
||||
|
||||
use DMD\LaLigaApi\Repository\FileRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: FileRepository::class)]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
class File
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $name = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $type = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?\DateTimeImmutable $createdAt = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'files')]
|
||||
private ?Game $game = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'files')]
|
||||
private ?Player $player = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'files')]
|
||||
private ?Season $season = null;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getName(): ?string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function setName(?string $name): static
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getType(): ?string
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
public function setType(?string $type): static
|
||||
{
|
||||
$this->type = $type;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCreatedAt(): ?\DateTimeImmutable
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
||||
#[ORM\PrePersist]
|
||||
public function setCreatedAt(): void
|
||||
{
|
||||
$timezone = new \DateTimeZone('Europe/Madrid');
|
||||
$this->createdAt = new \DateTimeImmutable('now', $timezone);
|
||||
}
|
||||
|
||||
public function getGame(): ?Game
|
||||
{
|
||||
return $this->game;
|
||||
}
|
||||
|
||||
public function setGame(?Game $game): static
|
||||
{
|
||||
$this->game = $game;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPlayer(): ?Player
|
||||
{
|
||||
return $this->player;
|
||||
}
|
||||
|
||||
public function setPlayer(?Player $player): static
|
||||
{
|
||||
$this->player = $player;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSeason(): ?Season
|
||||
{
|
||||
return $this->season;
|
||||
}
|
||||
|
||||
public function setSeason(?Season $season): static
|
||||
{
|
||||
$this->season = $season;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,227 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Entity;
|
||||
|
||||
use DMD\LaLigaApi\Repository\GameRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: GameRepository::class)]
|
||||
class Game
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?int $pointsHome = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?int $pointsAway = null;
|
||||
|
||||
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
|
||||
private ?\DateTimeInterface $plannedDate = null;
|
||||
|
||||
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
|
||||
private ?\DateTimeInterface $gameDateTime = null;
|
||||
|
||||
#[ORM\Column(length: 350, nullable: true)]
|
||||
private ?string $notes = null;
|
||||
|
||||
#[ORM\OneToMany(mappedBy: 'game', targetEntity: File::class)]
|
||||
private Collection $files;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'games')]
|
||||
private ?Season $season = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'games')]
|
||||
private ?Facility $facility = null;
|
||||
|
||||
#[ORM\ManyToOne]
|
||||
private ?Team $homeTeam = null;
|
||||
|
||||
#[ORM\ManyToOne]
|
||||
private ?Team $awayTeam = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?\DateTimeImmutable $createdAt = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?\DateTimeImmutable $updatedAt = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->files = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getPointsHome(): ?int
|
||||
{
|
||||
return $this->pointsHome;
|
||||
}
|
||||
|
||||
public function setPointsHome(?int $pointsHome): static
|
||||
{
|
||||
$this->pointsHome = $pointsHome;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPointsAway(): ?int
|
||||
{
|
||||
return $this->pointsAway;
|
||||
}
|
||||
|
||||
public function setPointsAway(?int $pointsAway): static
|
||||
{
|
||||
$this->pointsAway = $pointsAway;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPlannedDate(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->plannedDate;
|
||||
}
|
||||
|
||||
public function setPlannedDate(?\DateTimeInterface $plannedDate): static
|
||||
{
|
||||
$this->plannedDate = $plannedDate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getGameDateTime(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->gameDateTime;
|
||||
}
|
||||
|
||||
public function setGameDateTime(?\DateTimeInterface $gameDateTime): static
|
||||
{
|
||||
$this->gameDateTime = $gameDateTime;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getNotes(): ?string
|
||||
{
|
||||
return $this->notes;
|
||||
}
|
||||
|
||||
public function setNotes(?string $notes): static
|
||||
{
|
||||
$this->notes = $notes;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, File>
|
||||
*/
|
||||
public function getFiles(): Collection
|
||||
{
|
||||
return $this->files;
|
||||
}
|
||||
|
||||
public function addFile(File $file): static
|
||||
{
|
||||
if (!$this->files->contains($file)) {
|
||||
$this->files->add($file);
|
||||
$file->setGame($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeFile(File $file): static
|
||||
{
|
||||
if ($this->files->removeElement($file)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($file->getGame() === $this) {
|
||||
$file->setGame(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSeason(): ?Season
|
||||
{
|
||||
return $this->season;
|
||||
}
|
||||
|
||||
public function setSeason(?Season $season): static
|
||||
{
|
||||
$this->season = $season;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFacility(): ?Facility
|
||||
{
|
||||
return $this->facility;
|
||||
}
|
||||
|
||||
public function setFacility(?Facility $facility): static
|
||||
{
|
||||
$this->facility = $facility;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getHomeTeam(): ?Team
|
||||
{
|
||||
return $this->homeTeam;
|
||||
}
|
||||
|
||||
public function setHomeTeam(?Team $homeTeam): static
|
||||
{
|
||||
$this->homeTeam = $homeTeam;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAwayTeam(): ?Team
|
||||
{
|
||||
return $this->awayTeam;
|
||||
}
|
||||
|
||||
public function setAwayTeam(?Team $awayTeam): static
|
||||
{
|
||||
$this->awayTeam = $awayTeam;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCreatedAt(): ?\DateTimeImmutable
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
||||
#[ORM\PrePersist]
|
||||
public function setCreatedAt(): static
|
||||
{
|
||||
$this->createdAt = new \DateTimeImmutable('now');
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getUpdatedAt(): ?\DateTimeImmutable
|
||||
{
|
||||
return $this->updatedAt;
|
||||
}
|
||||
|
||||
public function setUpdatedAt(?\DateTimeImmutable $updatedAt): static
|
||||
{
|
||||
$this->updatedAt = $updatedAt;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,244 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Entity;
|
||||
|
||||
use DMD\LaLigaApi\Repository\LeagueRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: LeagueRepository::class)]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
class League
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $name = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $logo = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $description = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?bool $active = null;
|
||||
|
||||
#[ORM\OneToMany(mappedBy: 'league', targetEntity: Season::class)]
|
||||
private Collection $seasons;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?\DateTimeImmutable $createdAt = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?int $pointsPerWin = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?int $pointsPerDraw = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $city = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?int $pointsPerLoss = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?int $matchesBetweenTeams = null;
|
||||
|
||||
#[ORM\Column(type: Types::JSON, nullable: true)]
|
||||
private ?array $blockedMatchDates = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?bool $isPublic = null;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->seasons = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getName(): ?string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function setName(?string $name): static
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLogo(): ?string
|
||||
{
|
||||
return $this->logo;
|
||||
}
|
||||
|
||||
public function setLogo(?string $logo): static
|
||||
{
|
||||
$this->logo = $logo;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDescription(): ?string
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
public function setDescription(?string $description): static
|
||||
{
|
||||
$this->description = $description;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isActive(): ?bool
|
||||
{
|
||||
return $this->active;
|
||||
}
|
||||
|
||||
public function setActive(?bool $active): static
|
||||
{
|
||||
$this->active = $active;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Season>
|
||||
*/
|
||||
public function getSeasons(): Collection
|
||||
{
|
||||
return $this->seasons;
|
||||
}
|
||||
|
||||
public function addSeason(Season $season): static
|
||||
{
|
||||
if (!$this->seasons->contains($season)) {
|
||||
$this->seasons->add($season);
|
||||
$season->setLeague($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeSeason(Season $season): static
|
||||
{
|
||||
if ($this->seasons->removeElement($season)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($season->getLeague() === $this) {
|
||||
$season->setLeague(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCreatedAt(): ?\DateTimeImmutable
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
||||
|
||||
#[ORM\PrePersist]
|
||||
public function setCreatedAt(): void
|
||||
{
|
||||
$timezone = new \DateTimeZone('Europe/Madrid');
|
||||
$this->createdAt = new \DateTimeImmutable('now', $timezone);
|
||||
}
|
||||
|
||||
public function getPointsPerWin(): ?int
|
||||
{
|
||||
return $this->pointsPerWin;
|
||||
}
|
||||
|
||||
public function setPointsPerWin(?int $pointsPerWin): static
|
||||
{
|
||||
$this->pointsPerWin = $pointsPerWin;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPointsPerDraw(): ?int
|
||||
{
|
||||
return $this->pointsPerDraw;
|
||||
}
|
||||
|
||||
public function setPointsPerDraw(?int $pointsPerDraw): static
|
||||
{
|
||||
$this->pointsPerDraw = $pointsPerDraw;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCity(): ?string
|
||||
{
|
||||
return $this->city;
|
||||
}
|
||||
|
||||
public function setCity(?string $city): static
|
||||
{
|
||||
$this->city = $city;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPointsPerLoss(): ?int
|
||||
{
|
||||
return $this->pointsPerLoss;
|
||||
}
|
||||
|
||||
public function setPointsPerLoss(?int $pointsPerLoss): static
|
||||
{
|
||||
$this->pointsPerLoss = $pointsPerLoss;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getMatchesBetweenTeams(): ?int
|
||||
{
|
||||
return $this->matchesBetweenTeams;
|
||||
}
|
||||
|
||||
public function setMatchesBetweenTeams(?int $matchesBetweenTeams): static
|
||||
{
|
||||
$this->matchesBetweenTeams = $matchesBetweenTeams;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBlockedMatchDates(): ?array
|
||||
{
|
||||
return $this->blockedMatchDates;
|
||||
}
|
||||
|
||||
public function setBlockedMatchDates(?array $blockedMatchDates): static
|
||||
{
|
||||
$this->blockedMatchDates = $blockedMatchDates;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isPublic(): ?bool
|
||||
{
|
||||
return $this->isPublic;
|
||||
}
|
||||
|
||||
public function setIsPublic(?bool $isPublic): static
|
||||
{
|
||||
$this->isPublic = $isPublic;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Entity;
|
||||
|
||||
use DMD\LaLigaApi\Repository\LogRepository;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: LogRepository::class)]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
class Log
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(type: Types::TEXT, nullable: true)]
|
||||
private ?string $payload = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?int $code = null;
|
||||
|
||||
#[ORM\Column(length: 550, nullable: true)]
|
||||
private ?string $message = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?\DateTimeImmutable $createdAt = null;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getPayload(): ?string
|
||||
{
|
||||
return $this->payload;
|
||||
}
|
||||
|
||||
public function setPayload(?string $payload): static
|
||||
{
|
||||
$this->payload = $payload;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCode(): ?int
|
||||
{
|
||||
return $this->code;
|
||||
}
|
||||
|
||||
public function setCode(?int $code): static
|
||||
{
|
||||
$this->code = $code;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getMessage(): ?string
|
||||
{
|
||||
return $this->message;
|
||||
}
|
||||
|
||||
public function setMessage(?string $message): static
|
||||
{
|
||||
$this->message = $message;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCreatedAt(): ?\DateTimeImmutable
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
||||
#[ORM\PrePersist]
|
||||
public function setCreatedAt(): void
|
||||
{
|
||||
$timezone = new \DateTimeZone('Europe/Madrid');
|
||||
$this->createdAt = new \DateTimeImmutable('now', $timezone);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,160 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Entity;
|
||||
|
||||
use DMD\LaLigaApi\Repository\NotificationRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: NotificationRepository::class)]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
class Notification
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $type = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'requestsSent')]
|
||||
private ?User $userWhoFiredEvent = null;
|
||||
|
||||
#[ORM\Column(length: 280, nullable: true)]
|
||||
private ?string $message = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'notifications')]
|
||||
private ?League $league = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?\DateTimeImmutable $createdAt = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?int $teamId = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'receivedNotifications')]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private ?User $userToNotify = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?bool $isRead = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?\DateTimeImmutable $readAt = null;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getType(): ?string
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
public function setType(?string $type): static
|
||||
{
|
||||
$this->type = $type;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getUserWhoFiredEvent(): ?User
|
||||
{
|
||||
return $this->userWhoFiredEvent;
|
||||
}
|
||||
|
||||
public function setUserWhoFiredEvent(?User $userWhoFiredEvent): static
|
||||
{
|
||||
$this->userWhoFiredEvent = $userWhoFiredEvent;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getMessage(): ?string
|
||||
{
|
||||
return $this->message;
|
||||
}
|
||||
|
||||
public function setMessage(?string $message): static
|
||||
{
|
||||
$this->message = $message;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLeague(): ?League
|
||||
{
|
||||
return $this->league;
|
||||
}
|
||||
|
||||
public function setLeague(?League $league): static
|
||||
{
|
||||
$this->league = $league;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCreatedAt(): ?\DateTimeImmutable
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
#[ORM\PrePersist]
|
||||
public function setCreatedAt(): static
|
||||
{
|
||||
$this->createdAt = new \DateTimeImmutable('now', new \DateTimeZone('Europe/Madrid'));
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTeamId(): ?int
|
||||
{
|
||||
return $this->teamId;
|
||||
}
|
||||
|
||||
public function setTeamId(?int $teamId): static
|
||||
{
|
||||
$this->teamId = $teamId;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getUserToNotify(): ?User
|
||||
{
|
||||
return $this->userToNotify;
|
||||
}
|
||||
|
||||
public function setUserToNotify(?User $userToNotify): static
|
||||
{
|
||||
$this->userToNotify = $userToNotify;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isIsRead(): ?bool
|
||||
{
|
||||
return $this->isRead;
|
||||
}
|
||||
|
||||
public function setIsRead(?bool $isRead): static
|
||||
{
|
||||
$this->isRead = $isRead;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getReadAt(): ?\DateTimeImmutable
|
||||
{
|
||||
return $this->readAt;
|
||||
}
|
||||
|
||||
public function setReadAt(?\DateTimeImmutable $readAt): static
|
||||
{
|
||||
$this->readAt = $readAt;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,181 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Entity;
|
||||
|
||||
use DMD\LaLigaApi\Repository\PlayerRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: PlayerRepository::class)]
|
||||
class Player
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $firstName = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $lastName = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $position = null;
|
||||
|
||||
#[ORM\Column(type: Types::SMALLINT, nullable: true)]
|
||||
private ?int $jerseyNumber = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?bool $isFederated = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $pictureFileName = null;
|
||||
|
||||
#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]
|
||||
private ?\DateTimeInterface $birthday = null;
|
||||
|
||||
#[ORM\OneToMany(mappedBy: 'player', targetEntity: File::class)]
|
||||
private Collection $files;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'players')]
|
||||
private ?Team $team = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->files = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getFirstName(): ?string
|
||||
{
|
||||
return $this->firstName;
|
||||
}
|
||||
|
||||
public function setFirstName(?string $firstName): static
|
||||
{
|
||||
$this->firstName = $firstName;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLastName(): ?string
|
||||
{
|
||||
return $this->lastName;
|
||||
}
|
||||
|
||||
public function setLastName(?string $lastName): static
|
||||
{
|
||||
$this->lastName = $lastName;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPosition(): ?string
|
||||
{
|
||||
return $this->position;
|
||||
}
|
||||
|
||||
public function setPosition(?string $position): static
|
||||
{
|
||||
$this->position = $position;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getJerseyNumber(): ?int
|
||||
{
|
||||
return $this->jerseyNumber;
|
||||
}
|
||||
|
||||
public function setJerseyNumber(?int $jerseyNumber): static
|
||||
{
|
||||
$this->jerseyNumber = $jerseyNumber;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isIsFederated(): ?bool
|
||||
{
|
||||
return $this->isFederated;
|
||||
}
|
||||
|
||||
public function setIsFederated(?bool $isFederated): static
|
||||
{
|
||||
$this->isFederated = $isFederated;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPictureFileName(): ?string
|
||||
{
|
||||
return $this->pictureFileName;
|
||||
}
|
||||
|
||||
public function setPictureFileName(?string $pictureFileName): static
|
||||
{
|
||||
$this->pictureFileName = $pictureFileName;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBirthday(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->birthday;
|
||||
}
|
||||
|
||||
public function setBirthday(?\DateTimeInterface $birthday): static
|
||||
{
|
||||
$this->birthday = $birthday;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, File>
|
||||
*/
|
||||
public function getFiles(): Collection
|
||||
{
|
||||
return $this->files;
|
||||
}
|
||||
|
||||
public function addFile(File $file): static
|
||||
{
|
||||
if (!$this->files->contains($file)) {
|
||||
$this->files->add($file);
|
||||
$file->setPlayer($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeFile(File $file): static
|
||||
{
|
||||
if ($this->files->removeElement($file)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($file->getPlayer() === $this) {
|
||||
$file->setPlayer(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTeam(): ?Team
|
||||
{
|
||||
return $this->team;
|
||||
}
|
||||
|
||||
public function setTeam(?Team $team): static
|
||||
{
|
||||
$this->team = $team;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,245 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Entity;
|
||||
|
||||
use DMD\LaLigaApi\Repository\SeasonRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: SeasonRepository::class)]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
class Season
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(type: Types::DATE_MUTABLE)]
|
||||
private ?\DateTimeInterface $dateStart = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?bool $active = null;
|
||||
|
||||
#[ORM\ManyToMany(targetEntity: Team::class, inversedBy: 'seasons')]
|
||||
private Collection $teams;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'seasons')]
|
||||
private ?League $league = null;
|
||||
|
||||
#[ORM\OneToMany(mappedBy: 'season', targetEntity: Game::class)]
|
||||
private Collection $games;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?\DateTimeImmutable $createdAt = null;
|
||||
|
||||
#[ORM\OneToMany(mappedBy: 'season', targetEntity: Facility::class)]
|
||||
private Collection $facilities;
|
||||
|
||||
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
|
||||
private ?\DateTimeInterface $updatedAt = null;
|
||||
|
||||
#[ORM\OneToMany(mappedBy: 'season', targetEntity: File::class)]
|
||||
private Collection $files;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->teams = new ArrayCollection();
|
||||
$this->games = new ArrayCollection();
|
||||
$this->facilities = new ArrayCollection();
|
||||
$this->files = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Team>
|
||||
*/
|
||||
public function getTeams(): Collection
|
||||
{
|
||||
return $this->teams;
|
||||
}
|
||||
|
||||
public function addTeam(Team $team): static
|
||||
{
|
||||
if (!$this->teams->contains($team)) {
|
||||
$this->teams->add($team);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeTeam(Team $team): static
|
||||
{
|
||||
$this->teams->removeElement($team);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDateStart(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->dateStart;
|
||||
}
|
||||
|
||||
public function setDateStart(\DateTimeInterface $dateStart): static
|
||||
{
|
||||
$this->dateStart = $dateStart;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDateEnd(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->dateEnd;
|
||||
}
|
||||
|
||||
public function setDateEnd(?\DateTimeInterface $dateEnd): static
|
||||
{
|
||||
$this->dateEnd = $dateEnd;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isActive(): ?bool
|
||||
{
|
||||
return $this->active;
|
||||
}
|
||||
|
||||
public function setActive(?bool $active): static
|
||||
{
|
||||
$this->active = $active;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCreatedAt(): ?\DateTimeImmutable
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
||||
#[ORM\PrePersist]
|
||||
public function setCreatedAt(): void
|
||||
{
|
||||
$timezone = new \DateTimeZone('Europe/Madrid');
|
||||
$this->createdAt = new \DateTimeImmutable('now', $timezone);
|
||||
}
|
||||
|
||||
public function getLeague(): ?League
|
||||
{
|
||||
return $this->league;
|
||||
}
|
||||
|
||||
public function setLeague(?League $league): static
|
||||
{
|
||||
$this->league = $league;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Game>
|
||||
*/
|
||||
public function getGames(): Collection
|
||||
{
|
||||
return $this->games;
|
||||
}
|
||||
|
||||
public function addGame(Game $game): static
|
||||
{
|
||||
if (!$this->games->contains($game)) {
|
||||
$this->games->add($game);
|
||||
$game->setSeason($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeGame(Game $game): static
|
||||
{
|
||||
if ($this->games->removeElement($game)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($game->getSeason() === $this) {
|
||||
$game->setSeason(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Facility>
|
||||
*/
|
||||
public function getFacilities(): Collection
|
||||
{
|
||||
return $this->facilities;
|
||||
}
|
||||
|
||||
public function addFacility(Facility $facility): static
|
||||
{
|
||||
if (!$this->facilities->contains($facility)) {
|
||||
$this->facilities->add($facility);
|
||||
$facility->setSeason($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeFacility(Facility $facility): static
|
||||
{
|
||||
if ($this->facilities->removeElement($facility)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($facility->getSeason() === $this) {
|
||||
$facility->setSeason(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getUpdatedAt(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->updatedAt;
|
||||
}
|
||||
|
||||
public function setUpdatedAt(?\DateTimeInterface $updatedAt): static
|
||||
{
|
||||
$this->updatedAt = $updatedAt;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, File>
|
||||
*/
|
||||
public function getFiles(): Collection
|
||||
{
|
||||
return $this->files;
|
||||
}
|
||||
|
||||
public function addFile(File $file): static
|
||||
{
|
||||
if (!$this->files->contains($file)) {
|
||||
$this->files->add($file);
|
||||
$file->setSeason($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeFile(File $file): static
|
||||
{
|
||||
if ($this->files->removeElement($file)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($file->getSeason() === $this) {
|
||||
$file->setSeason(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Entity;
|
||||
|
||||
use DMD\LaLigaApi\Repository\SeasonDataRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: SeasonDataRepository::class)]
|
||||
class SeasonData
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'seasonData')]
|
||||
private ?Team $team = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?int $points = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'seasonData')]
|
||||
private ?Season $season = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getTeam(): ?Team
|
||||
{
|
||||
return $this->team;
|
||||
}
|
||||
|
||||
public function setTeam(?Team $team): static
|
||||
{
|
||||
$this->team = $team;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPoints(): ?int
|
||||
{
|
||||
return $this->points;
|
||||
}
|
||||
|
||||
public function setSeasonPoints(?int $points): static
|
||||
{
|
||||
$this->points = $points;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSeason(): ?Season
|
||||
{
|
||||
return $this->season;
|
||||
}
|
||||
|
||||
public function setSeason(?Season $season): static
|
||||
{
|
||||
$this->season = $season;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setPoints(?int $points): static
|
||||
{
|
||||
$this->points = $points;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,187 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Entity;
|
||||
|
||||
use DMD\LaLigaApi\Repository\TeamRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: TeamRepository::class)]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
class Team
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $name = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?bool $active = null;
|
||||
|
||||
#[ORM\ManyToMany(targetEntity: Season::class, mappedBy: 'teams')]
|
||||
private Collection $seasons;
|
||||
|
||||
#[ORM\OneToMany(mappedBy: 'team', targetEntity: SeasonData::class)]
|
||||
private Collection $seasonData;
|
||||
|
||||
#[ORM\OneToMany(mappedBy: 'team', targetEntity: Player::class)]
|
||||
private Collection $players;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?\DateTimeImmutable $createdAt = null;
|
||||
|
||||
#[ORM\OneToOne(inversedBy: 'team', cascade: ['persist', 'remove'])]
|
||||
private ?User $captain = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->seasons = new ArrayCollection();
|
||||
$this->seasonData = new ArrayCollection();
|
||||
$this->players = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getName(): ?string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function setName(?string $name): static
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isActive(): ?bool
|
||||
{
|
||||
return $this->active;
|
||||
}
|
||||
|
||||
public function setActive(?bool $active): static
|
||||
{
|
||||
$this->active = $active;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCreatedAt(): ?\DateTimeImmutable
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
||||
#[ORM\PrePersist]
|
||||
public function setCreatedAt(): void
|
||||
{
|
||||
$this->createdAt = new \DateTimeImmutable();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Season>
|
||||
*/
|
||||
public function getSeasons(): Collection
|
||||
{
|
||||
return $this->seasons;
|
||||
}
|
||||
|
||||
public function addSeason(Season $season): static
|
||||
{
|
||||
if (!$this->seasons->contains($season)) {
|
||||
$this->seasons->add($season);
|
||||
$season->addTeam($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeSeason(Season $season): static
|
||||
{
|
||||
if ($this->seasons->removeElement($season)) {
|
||||
$season->removeTeam($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return Collection<int, SeasonData>
|
||||
*/
|
||||
public function getSeasonData(): Collection
|
||||
{
|
||||
return $this->seasonData;
|
||||
}
|
||||
|
||||
public function addSeasonData(SeasonData $seasonData): static
|
||||
{
|
||||
if (!$this->seasonData->contains($seasonData)) {
|
||||
$this->seasonData->add($seasonData);
|
||||
$seasonData->setTeam($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeSeasonData(SeasonData $seasonData): static
|
||||
{
|
||||
if ($this->seasonData->removeElement($seasonData)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($seasonData->getTeam() === $this) {
|
||||
$seasonData->setTeam(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Player>
|
||||
*/
|
||||
public function getPlayers(): Collection
|
||||
{
|
||||
return $this->players;
|
||||
}
|
||||
|
||||
public function addPlayer(Player $player): static
|
||||
{
|
||||
if (!$this->players->contains($player)) {
|
||||
$this->players->add($player);
|
||||
$player->setTeam($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removePlayer(Player $player): static
|
||||
{
|
||||
if ($this->players->removeElement($player)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($player->getTeam() === $this) {
|
||||
$player->setTeam(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCaptain(): ?User
|
||||
{
|
||||
return $this->captain;
|
||||
}
|
||||
|
||||
public function setCaptain(?User $captain): static
|
||||
{
|
||||
$this->captain = $captain;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,352 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Entity;
|
||||
|
||||
use DMD\LaLigaApi\Repository\UserRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
|
||||
#[ORM\Entity(repositoryClass: UserRepository::class)]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 180, unique: true)]
|
||||
private ?string $email = null;
|
||||
|
||||
#[ORM\Column]
|
||||
private array $roles = [];
|
||||
|
||||
#[ORM\Column]
|
||||
private ?string $password = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $firstName = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $lastName = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $phone = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $profilePicture = null;
|
||||
|
||||
#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]
|
||||
private ?\DateTimeInterface $birthday = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?bool $active = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?\DateTimeImmutable $createdAt = null;
|
||||
|
||||
#[ORM\Column(type: Types::ARRAY, nullable: true)]
|
||||
private ?array $noteList = null;
|
||||
|
||||
#[ORM\OneToOne(mappedBy: 'captain', cascade: ['persist', 'remove'])]
|
||||
private ?Team $team = null;
|
||||
|
||||
#[ORM\OneToMany(mappedBy: 'userWhoFiredEvent', targetEntity: Notification::class)]
|
||||
private Collection $sentNotifications;
|
||||
|
||||
#[ORM\OneToMany(mappedBy: 'user', targetEntity: CustomRole::class, cascade: ['persist', 'remove'])]
|
||||
private Collection $customRoles;
|
||||
|
||||
#[ORM\OneToMany(mappedBy: 'userToNotify', targetEntity: Notification::class, orphanRemoval: true)]
|
||||
private Collection $receivedNotifications;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->sentNotifications = new ArrayCollection();
|
||||
$this->customRoles = new ArrayCollection();
|
||||
$this->receivedNotifications = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getEmail(): ?string
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
public function setEmail(string $email): static
|
||||
{
|
||||
$this->email = $email;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A visual identifier that represents this user.
|
||||
*
|
||||
* @see UserInterface
|
||||
*/
|
||||
public function getUserIdentifier(): string
|
||||
{
|
||||
return (string) $this->email;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see UserInterface
|
||||
*/
|
||||
public function getRoles(): array
|
||||
{
|
||||
$roles = $this->roles;
|
||||
// guarantee every user at least has ROLE_USER
|
||||
$roles[] = 'ROLE_USER';
|
||||
|
||||
return array_unique($roles);
|
||||
}
|
||||
|
||||
public function setRoles(array $roles): static
|
||||
{
|
||||
$this->roles = $roles;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see PasswordAuthenticatedUserInterface
|
||||
*/
|
||||
public function getPassword(): string
|
||||
{
|
||||
return $this->password;
|
||||
}
|
||||
|
||||
public function setPassword(string $password): static
|
||||
{
|
||||
$this->password = $password;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see UserInterface
|
||||
*/
|
||||
public function eraseCredentials(): void
|
||||
{
|
||||
// If you store any temporary, sensitive data on the user, clear it here
|
||||
// $this->plainPassword = null;
|
||||
}
|
||||
|
||||
public function getFirstName(): ?string
|
||||
{
|
||||
return $this->firstName;
|
||||
}
|
||||
|
||||
public function setFirstName(?string $firstName): static
|
||||
{
|
||||
$this->firstName = $firstName;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLastName(): ?string
|
||||
{
|
||||
return $this->lastName;
|
||||
}
|
||||
|
||||
public function setLastName(?string $lastName): static
|
||||
{
|
||||
$this->lastName = $lastName;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPhone(): ?string
|
||||
{
|
||||
return $this->phone;
|
||||
}
|
||||
|
||||
public function setPhone(?string $phone): static
|
||||
{
|
||||
$this->phone = $phone;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getProfilePicture(): ?string
|
||||
{
|
||||
return $this->profilePicture;
|
||||
}
|
||||
|
||||
public function setProfilePicture(?string $profilePicture): static
|
||||
{
|
||||
$this->profilePicture = $profilePicture;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBirthday(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->birthday;
|
||||
}
|
||||
|
||||
public function setBirthday(?\DateTimeInterface $birthday): static
|
||||
{
|
||||
$this->birthday = $birthday;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isActive(): ?bool
|
||||
{
|
||||
return $this->active;
|
||||
}
|
||||
|
||||
public function setActive(?bool $active): static
|
||||
{
|
||||
$this->active = $active;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCreatedAt(): ?\DateTimeImmutable
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
||||
#[ORM\PrePersist]
|
||||
public function setCreatedAt(): void
|
||||
{
|
||||
$timezone = new \DateTimeZone('Europe/Madrid');
|
||||
$this->createdAt = new \DateTimeImmutable('now', $timezone);
|
||||
}
|
||||
|
||||
public function getNoteList(): ?array
|
||||
{
|
||||
return $this->noteList;
|
||||
}
|
||||
|
||||
public function setNoteList(?array $noteList): static
|
||||
{
|
||||
$this->noteList = $noteList;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTeam(): ?Team
|
||||
{
|
||||
return $this->team;
|
||||
}
|
||||
|
||||
public function setTeam(?Team $team): static
|
||||
{
|
||||
// unset the owning side of the relation if necessary
|
||||
if ($team === null && $this->team !== null) {
|
||||
$this->team->setCaptain(null);
|
||||
}
|
||||
|
||||
// set the owning side of the relation if necessary
|
||||
if ($team !== null && $team->getCaptain() !== $this) {
|
||||
$team->setCaptain($this);
|
||||
}
|
||||
|
||||
$this->team = $team;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Notification>
|
||||
*/
|
||||
public function getSentNotifications(): Collection
|
||||
{
|
||||
return $this->sentNotifications;
|
||||
}
|
||||
|
||||
public function addSentNotifications(Notification $sentNotifications): static
|
||||
{
|
||||
if (!$this->sentNotifications->contains($sentNotifications)) {
|
||||
$this->sentNotifications->add($sentNotifications);
|
||||
$sentNotifications->setUserWhoFiredEvent($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeSentNotifications(Notification $sentNotifications): static
|
||||
{
|
||||
if ($this->sentNotifications->removeElement($sentNotifications)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($sentNotifications->getUserWhoFiredEvent() === $this) {
|
||||
$sentNotifications->setUserWhoFiredEvent(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, CustomRole>
|
||||
*/
|
||||
public function getCustomRoles(): Collection
|
||||
{
|
||||
return $this->customRoles;
|
||||
}
|
||||
|
||||
public function addCustomRole(CustomRole $customRole): static
|
||||
{
|
||||
if (!$this->customRoles->contains($customRole)) {
|
||||
$this->customRoles->add($customRole);
|
||||
$customRole->setUser($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeCustomRole(CustomRole $customRole): static
|
||||
{
|
||||
if ($this->customRoles->removeElement($customRole)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($customRole->getUser() === $this) {
|
||||
$customRole->setUser(null);
|
||||
}
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Notification>
|
||||
*/
|
||||
public function getReceivedNotifications(): Collection
|
||||
{
|
||||
return $this->receivedNotifications;
|
||||
}
|
||||
|
||||
public function addReceivedNotification(Notification $receivedNotification): static
|
||||
{
|
||||
if (!$this->receivedNotifications->contains($receivedNotification)) {
|
||||
$this->receivedNotifications->add($receivedNotification);
|
||||
$receivedNotification->setUserToNotify($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeReceivedNotification(Notification $receivedNotification): static
|
||||
{
|
||||
if ($this->receivedNotifications->removeElement($receivedNotification)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($receivedNotification->getUserToNotify() === $this) {
|
||||
$receivedNotification->setUserToNotify(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Enum;
|
||||
|
||||
enum NotificationType
|
||||
{
|
||||
case NEW_JOIN_LEAGUE_REQUEST;
|
||||
case DECLINED_JOIN_LEAGUE_REQUEST;
|
||||
case NEW_JOIN_TEAM_REQUEST;
|
||||
case NEW_CAPTAIN_REQUEST;
|
||||
case DECLINED_CAPTAIN_REQUEST;
|
||||
case ACCEPTED_CAPTAIN_REQUEST;
|
||||
|
||||
public function getMessage(?string $requestingUserFullName, string $entityName): string
|
||||
{
|
||||
return match ($this){
|
||||
self::NEW_JOIN_LEAGUE_REQUEST, self::NEW_JOIN_TEAM_REQUEST => "$requestingUserFullName , quiere unirse a $entityName.",
|
||||
self::NEW_CAPTAIN_REQUEST => "$requestingUserFullName quiere ser capitán del equipo $entityName.",
|
||||
self::DECLINED_JOIN_LEAGUE_REQUEST => "Han rechazado tu solicitud para unirte a la liga $entityName.",
|
||||
self::DECLINED_CAPTAIN_REQUEST => "Han rechazado tu solicitud para ser capitán del equipo $entityName.",
|
||||
self::ACCEPTED_CAPTAIN_REQUEST => "Han aceptado tu solicitud para ser capitán del equipo $entityName."
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Enum;
|
||||
|
||||
enum Role: string
|
||||
{
|
||||
case LEAGUE_PRESIDENT = '_LEAGUE_PRESIDENT';
|
||||
|
||||
case TEAM_CAPTAIN = '_TEAM_CAPTAIN';
|
||||
case LEAGUE_MEMBER = '_LEAGUE_MEMBER';
|
||||
}
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Exception;
|
||||
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\Exception\ORMException;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Event\ExceptionEvent;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
|
||||
use DMD\LaLigaApi\Entity\Log;
|
||||
|
||||
class ExceptionListener
|
||||
{
|
||||
public function __construct(public EntityManagerInterface $entityManager){}
|
||||
|
||||
public function onKernelException(ExceptionEvent $event): void
|
||||
{
|
||||
$exception = $event->getThrowable();
|
||||
$log = new Log();
|
||||
$log->setPayload($event->getRequest()->getContent());
|
||||
if ($exception instanceof HttpExceptionInterface)
|
||||
{
|
||||
$log->setCode($exception->getStatusCode());
|
||||
$log->setMessage($exception->getMessage());
|
||||
$response = new JsonResponse([
|
||||
'error'=> [
|
||||
'code' => $exception->getStatusCode(),
|
||||
'message' => $exception->getMessage()
|
||||
]
|
||||
]);
|
||||
$response->headers->set('Content-Type', 'application/json');
|
||||
$response->setStatusCode($exception->getStatusCode());
|
||||
}
|
||||
elseif($exception instanceof ValidationException)
|
||||
{
|
||||
$response = new JsonResponse(
|
||||
data: [
|
||||
'success' => false,
|
||||
'validationErrors' => $exception->getValidationErrors()
|
||||
],
|
||||
status: $exception->getCode()
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$log->setCode(Response::HTTP_INTERNAL_SERVER_ERROR);
|
||||
$log->setMessage($exception->getMessage());
|
||||
$response = new JsonResponse([
|
||||
'error'=> [
|
||||
'code' => Response::HTTP_INTERNAL_SERVER_ERROR,
|
||||
'message' => $exception->getMessage()
|
||||
]
|
||||
]);
|
||||
$response->headers->set('Content-Type', 'application/json');
|
||||
$response->setStatusCode(Response::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
if (!($exception instanceof ORMException))
|
||||
{
|
||||
$this->entityManager->persist($log);
|
||||
$this->entityManager->flush();
|
||||
$this->entityManager->clear();
|
||||
}
|
||||
$event->setResponse($response);
|
||||
$event->allowCustomResponseCode();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Exception;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Throwable;
|
||||
|
||||
class ValidationException extends \Exception
|
||||
{
|
||||
public function __construct(
|
||||
private readonly array $validationErrors,
|
||||
string $message = "",
|
||||
int $code = Response::HTTP_BAD_REQUEST,
|
||||
?Throwable $previous = null,
|
||||
)
|
||||
{
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
|
||||
public function getValidationErrors(): array
|
||||
{
|
||||
return $this->validationErrors;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
|
||||
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
|
||||
|
||||
class Kernel extends BaseKernel
|
||||
{
|
||||
use MicroKernelTrait;
|
||||
}
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Repository;
|
||||
|
||||
use DMD\LaLigaApi\Entity\CustomRole;
|
||||
use DMD\LaLigaApi\Entity\User;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<CustomRole>
|
||||
*
|
||||
* @method CustomRole|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method CustomRole|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method CustomRole[] findAll()
|
||||
* @method CustomRole[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class CustomRoleRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, CustomRole::class);
|
||||
}
|
||||
|
||||
public function findUserByRoleName(string $roleName): User
|
||||
{
|
||||
return $this->createQueryBuilder('r')
|
||||
->select('u')
|
||||
->join('r.user', 'u')
|
||||
->where('r.name = :roleName')
|
||||
->setParameter('roleName', $roleName)
|
||||
->setMaxResults(1)
|
||||
->getQuery()
|
||||
->getResult();
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return CustomRole[] Returns an array of CustomRole objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('c')
|
||||
// ->andWhere('c.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('c.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?CustomRole
|
||||
// {
|
||||
// return $this->createQueryBuilder('c')
|
||||
// ->andWhere('c.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Repository;
|
||||
|
||||
use DMD\LaLigaApi\Entity\Facility;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<Facility>
|
||||
*
|
||||
* @method Facility|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method Facility|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method Facility[] findAll()
|
||||
* @method Facility[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class FacilityRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Facility::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Facility[] Returns an array of Facility objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('f')
|
||||
// ->andWhere('f.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('f.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?Facility
|
||||
// {
|
||||
// return $this->createQueryBuilder('f')
|
||||
// ->andWhere('f.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Repository;
|
||||
|
||||
use DMD\LaLigaApi\Entity\File;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<File>
|
||||
*
|
||||
* @method File|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method File|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method File[] findAll()
|
||||
* @method File[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class FileRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, File::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return File[] Returns an array of File objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('f')
|
||||
// ->andWhere('f.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('f.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?File
|
||||
// {
|
||||
// return $this->createQueryBuilder('f')
|
||||
// ->andWhere('f.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Repository;
|
||||
|
||||
use DMD\LaLigaApi\Entity\Game;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<Game>
|
||||
*
|
||||
* @method Game|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method Game|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method Game[] findAll()
|
||||
* @method Game[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class GameRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Game::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Game[] Returns an array of Game objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('g')
|
||||
// ->andWhere('g.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('g.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?Game
|
||||
// {
|
||||
// return $this->createQueryBuilder('g')
|
||||
// ->andWhere('g.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Repository;
|
||||
|
||||
use DMD\LaLigaApi\Entity\League;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<League>
|
||||
*
|
||||
* @method League|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method League|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method League[] findAll()
|
||||
* @method League[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class LeagueRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, League::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return League[] Returns an array of League objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('l')
|
||||
// ->andWhere('l.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('l.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?League
|
||||
// {
|
||||
// return $this->createQueryBuilder('l')
|
||||
// ->andWhere('l.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Repository;
|
||||
|
||||
use DMD\LaLigaApi\Entity\Log;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<Log>
|
||||
*
|
||||
* @method Log|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method Log|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method Log[] findAll()
|
||||
* @method Log[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class LogRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Log::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Log[] Returns an array of Log objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('l')
|
||||
// ->andWhere('l.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('l.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?Log
|
||||
// {
|
||||
// return $this->createQueryBuilder('l')
|
||||
// ->andWhere('l.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace DMD\LaLigaApi\Repository;
|
||||
|
||||
use DMD\LaLigaApi\Entity\Notification;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<Notification>
|
||||
*
|
||||
* @method Notification|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method Notification|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method Notification[] findAll()
|
||||
* @method Notification[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class NotificationRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Notification::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Notification[] Returns an array of Notification objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('n')
|
||||
// ->andWhere('n.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('n.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?Notification
|
||||
// {
|
||||
// return $this->createQueryBuilder('n')
|
||||
// ->andWhere('n.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue