├── .env.dist ├── .gitignore ├── LICENSE ├── README.md ├── bin └── console ├── composer.json ├── composer.lock ├── config ├── bootstrap.php ├── bundles.php ├── packages │ ├── api_platform.yaml │ ├── cache.yaml │ ├── doctrine.yaml │ ├── doctrine_migrations.yaml │ ├── framework.yaml │ ├── lexik_jwt_authentication.yaml │ ├── nelmio_cors.yaml │ ├── prod │ │ ├── doctrine.yaml │ │ └── routing.yaml │ ├── routing.yaml │ ├── security.yaml │ ├── test │ │ ├── framework.yaml │ │ ├── twig.yaml │ │ └── validator.yaml │ ├── twig.yaml │ └── validator.yaml ├── routes.yaml ├── routes │ ├── annotations.yaml │ ├── api_platform.yaml │ └── dev │ │ ├── framework.yaml │ │ └── web_profiler.yaml ├── secrets │ └── prod │ │ └── .gitignore └── services.yaml ├── public └── index.php ├── resources └── screenshots │ ├── screenshot_001.png │ ├── screenshot_002.png │ ├── screenshot_003.png │ └── screenshot_004.png ├── src ├── Controller │ ├── .gitignore │ ├── HomeController.php │ └── SecurityController.php ├── DataFixtures │ ├── AppFixtures.php │ └── UserFixtures.php ├── Entity │ ├── .gitignore │ ├── MigrationVersions.php │ ├── ModxAccessActiondom.php │ ├── ModxAccessActions.php │ ├── ModxAccessCategory.php │ ├── ModxAccessContext.php │ ├── ModxAccessElements.php │ ├── ModxAccessMediaSource.php │ ├── ModxAccessMenus.php │ ├── ModxAccessNamespace.php │ ├── ModxAccessPermissions.php │ ├── ModxAccessPolicies.php │ ├── ModxAccessPolicyTemplateGroups.php │ ├── ModxAccessPolicyTemplates.php │ ├── ModxAccessResourceGroups.php │ ├── ModxAccessResources.php │ ├── ModxAccessTemplatevars.php │ ├── ModxActiondom.php │ ├── ModxActions.php │ ├── ModxActionsFields.php │ ├── ModxActiveUsers.php │ ├── ModxCategories.php │ ├── ModxCategoriesClosure.php │ ├── ModxClassMap.php │ ├── ModxContentType.php │ ├── ModxContext.php │ ├── ModxContextResource.php │ ├── ModxContextSetting.php │ ├── ModxDashboard.php │ ├── ModxDashboardWidget.php │ ├── ModxDashboardWidgetPlacement.php │ ├── ModxDocumentGroups.php │ ├── ModxDocumentgroupNames.php │ ├── ModxElementPropertySets.php │ ├── ModxExtensionPackages.php │ ├── ModxFcProfiles.php │ ├── ModxFcProfilesUsergroups.php │ ├── ModxFcSets.php │ ├── ModxLexiconEntries.php │ ├── ModxManagerLog.php │ ├── ModxMediaSources.php │ ├── ModxMediaSourcesContexts.php │ ├── ModxMediaSourcesElements.php │ ├── ModxMemberGroups.php │ ├── ModxMembergroupNames.php │ ├── ModxMenus.php │ ├── ModxNamespaces.php │ ├── ModxPropertySet.php │ ├── ModxRegisterMessages.php │ ├── ModxRegisterQueues.php │ ├── ModxRegisterTopics.php │ ├── ModxSession.php │ ├── ModxSiteContent.php │ ├── ModxSiteHtmlsnippets.php │ ├── ModxSitePluginEvents.php │ ├── ModxSitePlugins.php │ ├── ModxSiteSnippets.php │ ├── ModxSiteTemplates.php │ ├── ModxSiteTmplvarAccess.php │ ├── ModxSiteTmplvarContentvalues.php │ ├── ModxSiteTmplvarTemplates.php │ ├── ModxSiteTmplvars.php │ ├── ModxSystemEventnames.php │ ├── ModxSystemSettings.php │ ├── ModxTransportPackages.php │ ├── ModxTransportProviders.php │ ├── ModxUserAttributes.php │ ├── ModxUserGroupRoles.php │ ├── ModxUserGroupSettings.php │ ├── ModxUserMessages.php │ ├── ModxUserSettings.php │ ├── ModxUsers.php │ ├── ModxWorkspaces.php │ └── User.php ├── Form │ └── Type │ │ ├── LoginType.php │ │ └── UpdateProfileType.php ├── Kernel.php ├── Migrations │ ├── .gitignore │ └── Version20191207091956.php ├── Repository │ ├── .gitignore │ └── UserRepository.php └── Security │ └── LoginFormAuthenticator.php ├── symfony.lock └── templates ├── base.html.twig ├── homepage.twig └── security ├── login.html.twig └── profile.html.twig /.env.dist: -------------------------------------------------------------------------------- 1 | # In all environments, the following files are loaded if they exist, 2 | # the latter taking precedence over the former: 3 | # 4 | # * .env contains default values for the environment variables needed by the app 5 | # * .env.local uncommitted file with local overrides 6 | # * .env.$APP_ENV committed environment-specific defaults 7 | # * .env.$APP_ENV.local uncommitted environment-specific overrides 8 | # 9 | # Real environment variables win over .env files. 10 | # 11 | # DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES. 12 | # 13 | # Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2). 14 | # https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration 15 | 16 | ###> symfony/framework-bundle ### 17 | APP_ENV=prod 18 | APP_SECRET=2d2f954703258dda7ab38c7850a96f1f 19 | #TRUSTED_PROXIES=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 20 | #TRUSTED_HOSTS='^localhost|example\.com$' 21 | ###< symfony/framework-bundle ### 22 | 23 | ###> nelmio/cors-bundle ### 24 | CORS_ALLOW_ORIGIN=^https?://(localhost|127\.0\.0\.1)(:[0-9]+)?$ 25 | ###< nelmio/cors-bundle ### 26 | 27 | ###> doctrine/doctrine-bundle ### 28 | # Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url 29 | # For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db" 30 | # For a PostgreSQL database, use: "postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=11&charset=utf8" 31 | # IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml 32 | DATABASE_URL=mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7 33 | ###< doctrine/doctrine-bundle ### 34 | 35 | ###> lexik/jwt-authentication-bundle ### 36 | JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem 37 | JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem 38 | JWT_PASSPHRASE=MY_SECRET_CODE 39 | ###< lexik/jwt-authentication-bundle ### 40 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | ###> symfony/framework-bundle ### 3 | /.env.local 4 | /.env.local.php 5 | /.env.*.local 6 | /public/bundles/ 7 | /var/ 8 | /vendor/ 9 | ###< symfony/framework-bundle ### 10 | /.env 11 | 12 | ###> lexik/jwt-authentication-bundle ### 13 | /config/jwt/*.pem 14 | ###< lexik/jwt-authentication-bundle ### 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 andchir 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MODX Revolution RESTful API 2 | 3 | Used: 4 | - https://symfony.com/ 5 | - https://api-platform.com/ 6 | 7 | ## Screenshots 8 | 9 | ![MODX API - screenshot #1](https://github.com/andchir/modx2-api/blob/master/resources/screenshots/screenshot_001.png?raw=true "MODX API - screenshot #1") 10 | 11 | ![MODX API - screenshot #4](https://github.com/andchir/modx2-api/blob/master/resources/screenshots/screenshot_004.png?raw=true "MODX API - screenshot #4") 12 | 13 | ![MODX API - screenshot #2](https://github.com/andchir/modx2-api/blob/master/resources/screenshots/screenshot_002.png?raw=true "MODX API - screenshot #2") 14 | 15 | ![MODX API - screenshot #3](https://github.com/andchir/modx2-api/blob/master/resources/screenshots/screenshot_003.png?raw=true "MODX API - screenshot #3") 16 | 17 | ## How to install 18 | 19 | 1. Download and upload to your server or clone the repository. 20 | 21 | 2. ~~~ 22 | composer install 23 | ~~~ 24 | 25 | 3. Open ".env" file and set DB connection parameters in ``DATABASE_URL=mysql://db_user:db_password@127.0.0.1:3306/db_name`` 26 | 27 | 4. Clear cache: 28 | ~~~ 29 | php bin/console cache:clear 30 | ~~~ 31 | 32 | 5. Configure a Web Server: 33 | [https://symfony.com/doc/current/setup/web_server_configuration.html](https://symfony.com/doc/current/setup/web_server_configuration.html) 34 | 35 | 6. Create users table in DB: 36 | ~~~ 37 | bin/console doctrine:schema:create 38 | ~~~ 39 | Create an administrator with the email "admin@admin.com" and the password "admin" (you can change it later): 40 | ~~~ 41 | php bin/console doctrine:fixtures:load --append --group=UserFixtures 42 | ~~~ 43 | 44 | 7. Generate JWT keys in folder "config/jwt": 45 | ~~~ 46 | jwt_passhrase=$(grep ''^JWT_PASSPHRASE='' .env | cut -f 2 -d ''='') 47 | echo "$jwt_passhrase" | openssl genpkey -out config/jwt/private.pem -pass stdin -aes256 -algorithm rsa -pkeyopt rsa_keygen_bits:4096 48 | echo "$jwt_passhrase" | openssl pkey -in config/jwt/private.pem -passin stdin -out config/jwt/public.pem -pubout 49 | setfacl -R -m u:www-data:rX -m u:"$(whoami)":rwX config/jwt 50 | setfacl -dR -m u:www-data:rX -m u:"$(whoami)":rwX config/jwt 51 | ~~~ 52 | 53 | 8. Get token: 54 | ~~~ 55 | curl -X POST -H "Content-Type: application/json" http://localhost:8000/authentication_token -d '{"email":"admin@admin.com","password":"admin"}' 56 | ~~~ 57 | 58 | Token usage on API page. Click "Authorize" button. Paste string with token: 59 | ~~~ 60 | Bearer MY_TOKEN 61 | ~~~ 62 | -------------------------------------------------------------------------------- /bin/console: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | getParameterOption(['--env', '-e'], null, true)) { 23 | putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env); 24 | } 25 | 26 | if ($input->hasParameterOption('--no-debug', true)) { 27 | putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0'); 28 | } 29 | 30 | require dirname(__DIR__).'/config/bootstrap.php'; 31 | 32 | if ($_SERVER['APP_DEBUG']) { 33 | umask(0000); 34 | 35 | if (class_exists(Debug::class)) { 36 | Debug::enable(); 37 | } 38 | } 39 | 40 | $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']); 41 | $application = new Application($kernel); 42 | $application->run($input); 43 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "project", 3 | "license": "proprietary", 4 | "require": { 5 | "php": "^7.2.5", 6 | "ext-ctype": "*", 7 | "ext-iconv": "*", 8 | "api-platform/api-pack": "^1.2", 9 | "doctrine/doctrine-migrations-bundle": "^2.1", 10 | "lexik/jwt-authentication-bundle": "^2.6", 11 | "symfony/console": "5.0.*", 12 | "symfony/dotenv": "5.0.*", 13 | "symfony/flex": "^1.3.1", 14 | "symfony/form": "5.0.*", 15 | "symfony/framework-bundle": "5.0.*", 16 | "symfony/yaml": "5.0.*" 17 | }, 18 | "require-dev": { 19 | "doctrine/doctrine-fixtures-bundle": "^3.3", 20 | "symfony/maker-bundle": "^1.14", 21 | "symfony/profiler-pack": "^1.0" 22 | }, 23 | "config": { 24 | "preferred-install": { 25 | "*": "dist" 26 | }, 27 | "sort-packages": true 28 | }, 29 | "autoload": { 30 | "psr-4": { 31 | "App\\": "src/" 32 | } 33 | }, 34 | "autoload-dev": { 35 | "psr-4": { 36 | "App\\Tests\\": "tests/" 37 | } 38 | }, 39 | "replace": { 40 | "paragonie/random_compat": "2.*", 41 | "symfony/polyfill-ctype": "*", 42 | "symfony/polyfill-iconv": "*", 43 | "symfony/polyfill-php72": "*", 44 | "symfony/polyfill-php71": "*", 45 | "symfony/polyfill-php70": "*", 46 | "symfony/polyfill-php56": "*" 47 | }, 48 | "scripts": { 49 | "auto-scripts": { 50 | "cache:clear": "symfony-cmd", 51 | "assets:install %PUBLIC_DIR%": "symfony-cmd" 52 | }, 53 | "post-install-cmd": [ 54 | "@auto-scripts" 55 | ], 56 | "post-update-cmd": [ 57 | "@auto-scripts" 58 | ] 59 | }, 60 | "conflict": { 61 | "symfony/symfony": "*" 62 | }, 63 | "extra": { 64 | "symfony": { 65 | "allow-contrib": false, 66 | "require": "5.0.*" 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /config/bootstrap.php: -------------------------------------------------------------------------------- 1 | =1.2) 9 | if (is_array($env = @include dirname(__DIR__).'/.env.local.php') && ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV']) { 10 | foreach ($env as $k => $v) { 11 | $_ENV[$k] = $_ENV[$k] ?? (isset($_SERVER[$k]) && 0 !== strpos($k, 'HTTP_') ? $_SERVER[$k] : $v); 12 | } 13 | } elseif (!class_exists(Dotenv::class)) { 14 | throw new RuntimeException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.'); 15 | } else { 16 | // load all the .env files 17 | (new Dotenv(false))->loadEnv(dirname(__DIR__).'/.env'); 18 | } 19 | 20 | $_SERVER += $_ENV; 21 | $_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev'; 22 | $_SERVER['APP_DEBUG'] = $_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV']; 23 | $_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], FILTER_VALIDATE_BOOLEAN) ? '1' : '0'; 24 | -------------------------------------------------------------------------------- /config/bundles.php: -------------------------------------------------------------------------------- 1 | ['all' => true], 5 | Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], 6 | Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], 7 | Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true], 8 | Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], 9 | ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true], 10 | Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], 11 | Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true], 12 | Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true], 13 | Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true], 14 | Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true], 15 | ]; 16 | -------------------------------------------------------------------------------- /config/packages/api_platform.yaml: -------------------------------------------------------------------------------- 1 | api_platform: 2 | description: 'MODX Revolution API' 3 | version: '1.0.0' 4 | show_webby: true 5 | mapping: 6 | paths: ['%kernel.project_dir%/src/Entity'] 7 | patch_formats: 8 | json: ['application/merge-patch+json'] 9 | swagger: 10 | versions: [3] 11 | api_keys: 12 | apiKey: 13 | name: Authorization 14 | type: header 15 | -------------------------------------------------------------------------------- /config/packages/cache.yaml: -------------------------------------------------------------------------------- 1 | framework: 2 | cache: 3 | # Unique name of your app: used to compute stable namespaces for cache keys. 4 | #prefix_seed: your_vendor_name/app_name 5 | 6 | # The "app" cache stores to the filesystem by default. 7 | # The data in this cache should persist between deploys. 8 | # Other options include: 9 | 10 | # Redis 11 | #app: cache.adapter.redis 12 | #default_redis_provider: redis://localhost 13 | 14 | # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues) 15 | #app: cache.adapter.apcu 16 | 17 | # Namespaced pools use the above "app" backend by default 18 | #pools: 19 | #my.dedicated.cache: null 20 | -------------------------------------------------------------------------------- /config/packages/doctrine.yaml: -------------------------------------------------------------------------------- 1 | doctrine: 2 | dbal: 3 | url: '%env(resolve:DATABASE_URL)%' 4 | 5 | # IMPORTANT: You MUST configure your server version, 6 | # either here or in the DATABASE_URL env var (see .env file) 7 | #server_version: '5.7' 8 | orm: 9 | auto_generate_proxy_classes: true 10 | naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware 11 | auto_mapping: true 12 | mappings: 13 | App: 14 | is_bundle: false 15 | type: annotation 16 | dir: '%kernel.project_dir%/src/Entity' 17 | prefix: 'App\Entity' 18 | alias: App 19 | -------------------------------------------------------------------------------- /config/packages/doctrine_migrations.yaml: -------------------------------------------------------------------------------- 1 | doctrine_migrations: 2 | dir_name: '%kernel.project_dir%/src/Migrations' 3 | # namespace is arbitrary but should be different from App\Migrations 4 | # as migrations classes should NOT be autoloaded 5 | namespace: DoctrineMigrations 6 | -------------------------------------------------------------------------------- /config/packages/framework.yaml: -------------------------------------------------------------------------------- 1 | framework: 2 | secret: '%env(APP_SECRET)%' 3 | #csrf_protection: true 4 | #http_method_override: true 5 | 6 | # Enables session support. Note that the session will ONLY be started if you read or write from it. 7 | # Remove or comment this section to explicitly disable session support. 8 | session: 9 | handler_id: null 10 | cookie_secure: auto 11 | cookie_samesite: lax 12 | 13 | #esi: true 14 | #fragments: true 15 | php_errors: 16 | log: true 17 | -------------------------------------------------------------------------------- /config/packages/lexik_jwt_authentication.yaml: -------------------------------------------------------------------------------- 1 | lexik_jwt_authentication: 2 | secret_key: '%env(resolve:JWT_SECRET_KEY)%' 3 | public_key: '%env(resolve:JWT_PUBLIC_KEY)%' 4 | pass_phrase: '%env(JWT_PASSPHRASE)%' 5 | -------------------------------------------------------------------------------- /config/packages/nelmio_cors.yaml: -------------------------------------------------------------------------------- 1 | nelmio_cors: 2 | defaults: 3 | origin_regex: true 4 | allow_origin: ['%env(CORS_ALLOW_ORIGIN)%'] 5 | allow_methods: ['GET', 'OPTIONS', 'POST', 'PUT', 'PATCH', 'DELETE'] 6 | allow_headers: ['Content-Type', 'Authorization'] 7 | expose_headers: ['Link'] 8 | max_age: 3600 9 | paths: 10 | '^/': null 11 | -------------------------------------------------------------------------------- /config/packages/prod/doctrine.yaml: -------------------------------------------------------------------------------- 1 | doctrine: 2 | orm: 3 | auto_generate_proxy_classes: false 4 | metadata_cache_driver: 5 | type: pool 6 | pool: doctrine.system_cache_pool 7 | query_cache_driver: 8 | type: pool 9 | pool: doctrine.system_cache_pool 10 | result_cache_driver: 11 | type: pool 12 | pool: doctrine.result_cache_pool 13 | 14 | framework: 15 | cache: 16 | pools: 17 | doctrine.result_cache_pool: 18 | adapter: cache.app 19 | doctrine.system_cache_pool: 20 | adapter: cache.system 21 | -------------------------------------------------------------------------------- /config/packages/prod/routing.yaml: -------------------------------------------------------------------------------- 1 | framework: 2 | router: 3 | strict_requirements: null 4 | -------------------------------------------------------------------------------- /config/packages/routing.yaml: -------------------------------------------------------------------------------- 1 | framework: 2 | router: 3 | utf8: true 4 | -------------------------------------------------------------------------------- /config/packages/security.yaml: -------------------------------------------------------------------------------- 1 | security: 2 | encoders: 3 | App\Entity\User: 4 | algorithm: argon2i 5 | 6 | # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers 7 | providers: 8 | # used to reload user from session & other features (e.g. switch_user) 9 | app_user_provider: 10 | entity: 11 | class: App\Entity\User 12 | property: email 13 | firewalls: 14 | dev: 15 | pattern: ^/_(profiler|wdt) 16 | security: false 17 | api: 18 | pattern: ^/api/ 19 | stateless: true 20 | anonymous: false 21 | provider: app_user_provider 22 | guard: 23 | authenticators: 24 | - lexik_jwt_authentication.jwt_token_authenticator 25 | main: 26 | anonymous: true 27 | json_login: 28 | check_path: /authentication_token 29 | username_path: email 30 | password_path: password 31 | success_handler: lexik_jwt_authentication.handler.authentication_success 32 | failure_handler: lexik_jwt_authentication.handler.authentication_failure 33 | guard: 34 | authenticators: 35 | - App\Security\LoginFormAuthenticator 36 | logout: 37 | path: app_logout 38 | 39 | remember_me: 40 | secret: '%kernel.secret%' 41 | lifetime: 604800 42 | path: / 43 | 44 | # activate different ways to authenticate 45 | # https://symfony.com/doc/current/security.html#firewalls-authentication 46 | 47 | # https://symfony.com/doc/current/security/impersonating_user.html 48 | # switch_user: true 49 | 50 | # Easy way to control access for large sections of your site 51 | # Note: Only the *first* access control that matches will be used 52 | access_control: 53 | - { path: ^/admin, roles: ROLE_ADMIN } 54 | - { path: ^/api, roles: ROLE_USER } 55 | -------------------------------------------------------------------------------- /config/packages/test/framework.yaml: -------------------------------------------------------------------------------- 1 | framework: 2 | test: true 3 | session: 4 | storage_id: session.storage.mock_file 5 | -------------------------------------------------------------------------------- /config/packages/test/twig.yaml: -------------------------------------------------------------------------------- 1 | twig: 2 | strict_variables: true 3 | -------------------------------------------------------------------------------- /config/packages/test/validator.yaml: -------------------------------------------------------------------------------- 1 | framework: 2 | validation: 3 | not_compromised_password: false 4 | -------------------------------------------------------------------------------- /config/packages/twig.yaml: -------------------------------------------------------------------------------- 1 | twig: 2 | default_path: '%kernel.project_dir%/templates' 3 | form_themes: ['bootstrap_4_layout.html.twig'] 4 | globals: 5 | app_name: '%app.name%' 6 | app_version: '%app.version%' 7 | -------------------------------------------------------------------------------- /config/packages/validator.yaml: -------------------------------------------------------------------------------- 1 | framework: 2 | validation: 3 | email_validation_mode: html5 4 | 5 | # Enables validator auto-mapping support. 6 | # For instance, basic validation constraints will be inferred from Doctrine's metadata. 7 | #auto_mapping: 8 | # App\Entity\: [] 9 | -------------------------------------------------------------------------------- /config/routes.yaml: -------------------------------------------------------------------------------- 1 | #index: 2 | # path: / 3 | # controller: App\Controller\DefaultController::index 4 | 5 | authentication_token: 6 | path: /authentication_token 7 | methods: ['POST'] -------------------------------------------------------------------------------- /config/routes/annotations.yaml: -------------------------------------------------------------------------------- 1 | controllers: 2 | resource: ../../src/Controller/ 3 | type: annotation 4 | -------------------------------------------------------------------------------- /config/routes/api_platform.yaml: -------------------------------------------------------------------------------- 1 | api_platform: 2 | resource: . 3 | type: api_platform 4 | prefix: /api 5 | -------------------------------------------------------------------------------- /config/routes/dev/framework.yaml: -------------------------------------------------------------------------------- 1 | _errors: 2 | resource: '@FrameworkBundle/Resources/config/routing/errors.xml' 3 | prefix: /_error 4 | -------------------------------------------------------------------------------- /config/routes/dev/web_profiler.yaml: -------------------------------------------------------------------------------- 1 | web_profiler_wdt: 2 | resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml' 3 | prefix: /_wdt 4 | 5 | web_profiler_profiler: 6 | resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml' 7 | prefix: /_profiler 8 | -------------------------------------------------------------------------------- /config/secrets/prod/.gitignore: -------------------------------------------------------------------------------- 1 | /prod.decrypt.private.php 2 | -------------------------------------------------------------------------------- /config/services.yaml: -------------------------------------------------------------------------------- 1 | # This file is the entry point to configure your own services. 2 | # Files in the packages/ subdirectory configure your dependencies. 3 | 4 | # Put parameters here that don't need to change on each machine where the app is deployed 5 | # https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration 6 | parameters: 7 | app.name: MODX API 8 | app.version: 1.0.0 9 | 10 | services: 11 | # default configuration for services in *this* file 12 | _defaults: 13 | autowire: true # Automatically injects dependencies in your services. 14 | autoconfigure: true # Automatically registers your services as commands, event subscribers, etc. 15 | 16 | # makes classes in src/ available to be used as services 17 | # this creates a service per class whose id is the fully-qualified class name 18 | App\: 19 | resource: '../src/*' 20 | exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}' 21 | 22 | # controllers are imported separately to make sure services can be injected 23 | # as action arguments even if you don't extend any base controller class 24 | App\Controller\: 25 | resource: '../src/Controller' 26 | tags: ['controller.service_arguments'] 27 | 28 | # add more service definitions when explicit configuration is needed 29 | # please note that last definitions always *replace* previous ones 30 | -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | handle($request); 26 | $response->send(); 27 | $kernel->terminate($request, $response); 28 | -------------------------------------------------------------------------------- /resources/screenshots/screenshot_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andchir/modx2-api/ed4a903172856bbd6e426d5727581bc87758ea68/resources/screenshots/screenshot_001.png -------------------------------------------------------------------------------- /resources/screenshots/screenshot_002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andchir/modx2-api/ed4a903172856bbd6e426d5727581bc87758ea68/resources/screenshots/screenshot_002.png -------------------------------------------------------------------------------- /resources/screenshots/screenshot_003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andchir/modx2-api/ed4a903172856bbd6e426d5727581bc87758ea68/resources/screenshots/screenshot_003.png -------------------------------------------------------------------------------- /resources/screenshots/screenshot_004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andchir/modx2-api/ed4a903172856bbd6e426d5727581bc87758ea68/resources/screenshots/screenshot_004.png -------------------------------------------------------------------------------- /src/Controller/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andchir/modx2-api/ed4a903172856bbd6e426d5727581bc87758ea68/src/Controller/.gitignore -------------------------------------------------------------------------------- /src/Controller/HomeController.php: -------------------------------------------------------------------------------- 1 | createForm(LoginType::class); 22 | 23 | $error = $authenticationUtils->getLastAuthenticationError(); 24 | $lastUsername = $authenticationUtils->getLastUsername(); 25 | 26 | return $this->render('homepage.twig', [ 27 | 'form' => $form->createView(), 28 | 'last_username' => $lastUsername, 29 | 'error' => $error 30 | ]); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Controller/SecurityController.php: -------------------------------------------------------------------------------- 1 | getUser()) { 27 | return $this->redirectToRoute('api_entrypoint'); 28 | } 29 | 30 | $form = $this->createForm(LoginType::class); 31 | 32 | $error = $authenticationUtils->getLastAuthenticationError(); 33 | $lastUsername = $authenticationUtils->getLastUsername(); 34 | 35 | return $this->render('security/login.html.twig', [ 36 | 'form' => $form->createView(), 37 | 'last_username' => $lastUsername, 38 | 'error' => $error 39 | ]); 40 | } 41 | 42 | /** 43 | * @Route("/profile", name="app_profile") 44 | * @param Request $request 45 | * @param UserPasswordEncoderInterface $passwordEncoder 46 | * @param ValidatorInterface $validator 47 | * @param EntityManagerInterface $em 48 | * @return Response 49 | */ 50 | public function updateProfileAction( 51 | Request $request, 52 | UserPasswordEncoderInterface $passwordEncoder, 53 | ValidatorInterface $validator, 54 | EntityManagerInterface $em): Response 55 | { 56 | $this->denyAccessUnlessGranted('ROLE_USER'); 57 | 58 | $form = $this->createForm(UpdateProfileType::class, [ 59 | 'email' => $this->getUser()->getEmail() 60 | ]); 61 | $form->handleRequest($request); 62 | 63 | if ($form->isSubmitted() && $form->isValid()) { 64 | 65 | /** @var User $user */ 66 | $user = $this->getUser(); 67 | 68 | $formData = $form->getData(); 69 | if (!empty($formData['email'])) { 70 | $user->setEmail($formData['email']); 71 | $errors = $validator->validate($user); 72 | if (count($errors) > 0) { 73 | $this->addFlash('error', $errors->get(0)->getMessage()); 74 | return $this->redirectToRoute('app_profile'); 75 | } 76 | } 77 | if (!empty($formData['password'])) { 78 | $user->setPassword($passwordEncoder->encodePassword( 79 | $user, 80 | $formData['password'] 81 | )); 82 | } 83 | 84 | $em->flush(); 85 | 86 | $this->addFlash( 87 | 'notice', 88 | 'Your changes were saved!' 89 | ); 90 | 91 | return $this->redirectToRoute('app_profile'); 92 | } 93 | 94 | return $this->render('security/profile.html.twig', [ 95 | 'form' => $form->createView() 96 | ]); 97 | } 98 | 99 | /** 100 | * @Route("/logout", name="app_logout") 101 | */ 102 | public function logout() 103 | { 104 | throw new \Exception('This method can be blank - it will be intercepted by the logout key on your firewall'); 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /src/DataFixtures/AppFixtures.php: -------------------------------------------------------------------------------- 1 | persist($product); 14 | 15 | $manager->flush(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/DataFixtures/UserFixtures.php: -------------------------------------------------------------------------------- 1 | passwordEncoder = $passwordEncoder; 17 | } 18 | 19 | public function load(ObjectManager $manager) 20 | { 21 | $user = new User(); 22 | $user 23 | ->setEmail('admin@admin.com') 24 | ->setRoles(['ROLE_USER', 'ROLE_ADMIN']); 25 | 26 | $user->setPassword($this->passwordEncoder->encodePassword( 27 | $user, 28 | 'admin' 29 | )); 30 | 31 | $manager->persist($user); 32 | $manager->flush(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Entity/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andchir/modx2-api/ed4a903172856bbd6e426d5727581bc87758ea68/src/Entity/.gitignore -------------------------------------------------------------------------------- /src/Entity/MigrationVersions.php: -------------------------------------------------------------------------------- 1 | version; 34 | } 35 | 36 | public function getExecutedAt(): ?\DateTimeImmutable 37 | { 38 | return $this->executedAt; 39 | } 40 | 41 | public function setExecutedAt(\DateTimeImmutable $executedAt): self 42 | { 43 | $this->executedAt = $executedAt; 44 | 45 | return $this; 46 | } 47 | 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/Entity/ModxAccessActiondom.php: -------------------------------------------------------------------------------- 1 | id; 62 | } 63 | 64 | public function getTarget(): ?string 65 | { 66 | return $this->target; 67 | } 68 | 69 | public function setTarget(string $target): self 70 | { 71 | $this->target = $target; 72 | 73 | return $this; 74 | } 75 | 76 | public function getPrincipalClass(): ?string 77 | { 78 | return $this->principalClass; 79 | } 80 | 81 | public function setPrincipalClass(string $principalClass): self 82 | { 83 | $this->principalClass = $principalClass; 84 | 85 | return $this; 86 | } 87 | 88 | public function getPrincipal(): ?int 89 | { 90 | return $this->principal; 91 | } 92 | 93 | public function setPrincipal(int $principal): self 94 | { 95 | $this->principal = $principal; 96 | 97 | return $this; 98 | } 99 | 100 | public function getAuthority(): ?int 101 | { 102 | return $this->authority; 103 | } 104 | 105 | public function setAuthority(int $authority): self 106 | { 107 | $this->authority = $authority; 108 | 109 | return $this; 110 | } 111 | 112 | public function getPolicy(): ?int 113 | { 114 | return $this->policy; 115 | } 116 | 117 | public function setPolicy(int $policy): self 118 | { 119 | $this->policy = $policy; 120 | 121 | return $this; 122 | } 123 | 124 | 125 | } 126 | -------------------------------------------------------------------------------- /src/Entity/ModxAccessActions.php: -------------------------------------------------------------------------------- 1 | id; 62 | } 63 | 64 | public function getTarget(): ?string 65 | { 66 | return $this->target; 67 | } 68 | 69 | public function setTarget(string $target): self 70 | { 71 | $this->target = $target; 72 | 73 | return $this; 74 | } 75 | 76 | public function getPrincipalClass(): ?string 77 | { 78 | return $this->principalClass; 79 | } 80 | 81 | public function setPrincipalClass(string $principalClass): self 82 | { 83 | $this->principalClass = $principalClass; 84 | 85 | return $this; 86 | } 87 | 88 | public function getPrincipal(): ?int 89 | { 90 | return $this->principal; 91 | } 92 | 93 | public function setPrincipal(int $principal): self 94 | { 95 | $this->principal = $principal; 96 | 97 | return $this; 98 | } 99 | 100 | public function getAuthority(): ?int 101 | { 102 | return $this->authority; 103 | } 104 | 105 | public function setAuthority(int $authority): self 106 | { 107 | $this->authority = $authority; 108 | 109 | return $this; 110 | } 111 | 112 | public function getPolicy(): ?int 113 | { 114 | return $this->policy; 115 | } 116 | 117 | public function setPolicy(int $policy): self 118 | { 119 | $this->policy = $policy; 120 | 121 | return $this; 122 | } 123 | 124 | 125 | } 126 | -------------------------------------------------------------------------------- /src/Entity/ModxAccessCategory.php: -------------------------------------------------------------------------------- 1 | id; 69 | } 70 | 71 | public function getTarget(): ?string 72 | { 73 | return $this->target; 74 | } 75 | 76 | public function setTarget(string $target): self 77 | { 78 | $this->target = $target; 79 | 80 | return $this; 81 | } 82 | 83 | public function getPrincipalClass(): ?string 84 | { 85 | return $this->principalClass; 86 | } 87 | 88 | public function setPrincipalClass(string $principalClass): self 89 | { 90 | $this->principalClass = $principalClass; 91 | 92 | return $this; 93 | } 94 | 95 | public function getPrincipal(): ?int 96 | { 97 | return $this->principal; 98 | } 99 | 100 | public function setPrincipal(int $principal): self 101 | { 102 | $this->principal = $principal; 103 | 104 | return $this; 105 | } 106 | 107 | public function getAuthority(): ?int 108 | { 109 | return $this->authority; 110 | } 111 | 112 | public function setAuthority(int $authority): self 113 | { 114 | $this->authority = $authority; 115 | 116 | return $this; 117 | } 118 | 119 | public function getPolicy(): ?int 120 | { 121 | return $this->policy; 122 | } 123 | 124 | public function setPolicy(int $policy): self 125 | { 126 | $this->policy = $policy; 127 | 128 | return $this; 129 | } 130 | 131 | public function getContextKey(): ?string 132 | { 133 | return $this->contextKey; 134 | } 135 | 136 | public function setContextKey(string $contextKey): self 137 | { 138 | $this->contextKey = $contextKey; 139 | 140 | return $this; 141 | } 142 | 143 | 144 | } 145 | -------------------------------------------------------------------------------- /src/Entity/ModxAccessContext.php: -------------------------------------------------------------------------------- 1 | id; 62 | } 63 | 64 | public function getTarget(): ?string 65 | { 66 | return $this->target; 67 | } 68 | 69 | public function setTarget(string $target): self 70 | { 71 | $this->target = $target; 72 | 73 | return $this; 74 | } 75 | 76 | public function getPrincipalClass(): ?string 77 | { 78 | return $this->principalClass; 79 | } 80 | 81 | public function setPrincipalClass(string $principalClass): self 82 | { 83 | $this->principalClass = $principalClass; 84 | 85 | return $this; 86 | } 87 | 88 | public function getPrincipal(): ?int 89 | { 90 | return $this->principal; 91 | } 92 | 93 | public function setPrincipal(int $principal): self 94 | { 95 | $this->principal = $principal; 96 | 97 | return $this; 98 | } 99 | 100 | public function getAuthority(): ?int 101 | { 102 | return $this->authority; 103 | } 104 | 105 | public function setAuthority(int $authority): self 106 | { 107 | $this->authority = $authority; 108 | 109 | return $this; 110 | } 111 | 112 | public function getPolicy(): ?int 113 | { 114 | return $this->policy; 115 | } 116 | 117 | public function setPolicy(int $policy): self 118 | { 119 | $this->policy = $policy; 120 | 121 | return $this; 122 | } 123 | 124 | 125 | } 126 | -------------------------------------------------------------------------------- /src/Entity/ModxAccessElements.php: -------------------------------------------------------------------------------- 1 | id; 69 | } 70 | 71 | public function getTarget(): ?string 72 | { 73 | return $this->target; 74 | } 75 | 76 | public function setTarget(string $target): self 77 | { 78 | $this->target = $target; 79 | 80 | return $this; 81 | } 82 | 83 | public function getPrincipalClass(): ?string 84 | { 85 | return $this->principalClass; 86 | } 87 | 88 | public function setPrincipalClass(string $principalClass): self 89 | { 90 | $this->principalClass = $principalClass; 91 | 92 | return $this; 93 | } 94 | 95 | public function getPrincipal(): ?int 96 | { 97 | return $this->principal; 98 | } 99 | 100 | public function setPrincipal(int $principal): self 101 | { 102 | $this->principal = $principal; 103 | 104 | return $this; 105 | } 106 | 107 | public function getAuthority(): ?int 108 | { 109 | return $this->authority; 110 | } 111 | 112 | public function setAuthority(int $authority): self 113 | { 114 | $this->authority = $authority; 115 | 116 | return $this; 117 | } 118 | 119 | public function getPolicy(): ?int 120 | { 121 | return $this->policy; 122 | } 123 | 124 | public function setPolicy(int $policy): self 125 | { 126 | $this->policy = $policy; 127 | 128 | return $this; 129 | } 130 | 131 | public function getContextKey(): ?string 132 | { 133 | return $this->contextKey; 134 | } 135 | 136 | public function setContextKey(string $contextKey): self 137 | { 138 | $this->contextKey = $contextKey; 139 | 140 | return $this; 141 | } 142 | 143 | 144 | } 145 | -------------------------------------------------------------------------------- /src/Entity/ModxAccessMediaSource.php: -------------------------------------------------------------------------------- 1 | id; 69 | } 70 | 71 | public function getTarget(): ?string 72 | { 73 | return $this->target; 74 | } 75 | 76 | public function setTarget(string $target): self 77 | { 78 | $this->target = $target; 79 | 80 | return $this; 81 | } 82 | 83 | public function getPrincipalClass(): ?string 84 | { 85 | return $this->principalClass; 86 | } 87 | 88 | public function setPrincipalClass(string $principalClass): self 89 | { 90 | $this->principalClass = $principalClass; 91 | 92 | return $this; 93 | } 94 | 95 | public function getPrincipal(): ?int 96 | { 97 | return $this->principal; 98 | } 99 | 100 | public function setPrincipal(int $principal): self 101 | { 102 | $this->principal = $principal; 103 | 104 | return $this; 105 | } 106 | 107 | public function getAuthority(): ?int 108 | { 109 | return $this->authority; 110 | } 111 | 112 | public function setAuthority(int $authority): self 113 | { 114 | $this->authority = $authority; 115 | 116 | return $this; 117 | } 118 | 119 | public function getPolicy(): ?int 120 | { 121 | return $this->policy; 122 | } 123 | 124 | public function setPolicy(int $policy): self 125 | { 126 | $this->policy = $policy; 127 | 128 | return $this; 129 | } 130 | 131 | public function getContextKey(): ?string 132 | { 133 | return $this->contextKey; 134 | } 135 | 136 | public function setContextKey(string $contextKey): self 137 | { 138 | $this->contextKey = $contextKey; 139 | 140 | return $this; 141 | } 142 | 143 | 144 | } 145 | -------------------------------------------------------------------------------- /src/Entity/ModxAccessMenus.php: -------------------------------------------------------------------------------- 1 | id; 62 | } 63 | 64 | public function getTarget(): ?string 65 | { 66 | return $this->target; 67 | } 68 | 69 | public function setTarget(string $target): self 70 | { 71 | $this->target = $target; 72 | 73 | return $this; 74 | } 75 | 76 | public function getPrincipalClass(): ?string 77 | { 78 | return $this->principalClass; 79 | } 80 | 81 | public function setPrincipalClass(string $principalClass): self 82 | { 83 | $this->principalClass = $principalClass; 84 | 85 | return $this; 86 | } 87 | 88 | public function getPrincipal(): ?int 89 | { 90 | return $this->principal; 91 | } 92 | 93 | public function setPrincipal(int $principal): self 94 | { 95 | $this->principal = $principal; 96 | 97 | return $this; 98 | } 99 | 100 | public function getAuthority(): ?int 101 | { 102 | return $this->authority; 103 | } 104 | 105 | public function setAuthority(int $authority): self 106 | { 107 | $this->authority = $authority; 108 | 109 | return $this; 110 | } 111 | 112 | public function getPolicy(): ?int 113 | { 114 | return $this->policy; 115 | } 116 | 117 | public function setPolicy(int $policy): self 118 | { 119 | $this->policy = $policy; 120 | 121 | return $this; 122 | } 123 | 124 | 125 | } 126 | -------------------------------------------------------------------------------- /src/Entity/ModxAccessNamespace.php: -------------------------------------------------------------------------------- 1 | id; 69 | } 70 | 71 | public function getTarget(): ?string 72 | { 73 | return $this->target; 74 | } 75 | 76 | public function setTarget(string $target): self 77 | { 78 | $this->target = $target; 79 | 80 | return $this; 81 | } 82 | 83 | public function getPrincipalClass(): ?string 84 | { 85 | return $this->principalClass; 86 | } 87 | 88 | public function setPrincipalClass(string $principalClass): self 89 | { 90 | $this->principalClass = $principalClass; 91 | 92 | return $this; 93 | } 94 | 95 | public function getPrincipal(): ?int 96 | { 97 | return $this->principal; 98 | } 99 | 100 | public function setPrincipal(int $principal): self 101 | { 102 | $this->principal = $principal; 103 | 104 | return $this; 105 | } 106 | 107 | public function getAuthority(): ?int 108 | { 109 | return $this->authority; 110 | } 111 | 112 | public function setAuthority(int $authority): self 113 | { 114 | $this->authority = $authority; 115 | 116 | return $this; 117 | } 118 | 119 | public function getPolicy(): ?int 120 | { 121 | return $this->policy; 122 | } 123 | 124 | public function setPolicy(int $policy): self 125 | { 126 | $this->policy = $policy; 127 | 128 | return $this; 129 | } 130 | 131 | public function getContextKey(): ?string 132 | { 133 | return $this->contextKey; 134 | } 135 | 136 | public function setContextKey(string $contextKey): self 137 | { 138 | $this->contextKey = $contextKey; 139 | 140 | return $this; 141 | } 142 | 143 | 144 | } 145 | -------------------------------------------------------------------------------- /src/Entity/ModxAccessPermissions.php: -------------------------------------------------------------------------------- 1 | id; 55 | } 56 | 57 | public function getTemplate(): ?int 58 | { 59 | return $this->template; 60 | } 61 | 62 | public function setTemplate(int $template): self 63 | { 64 | $this->template = $template; 65 | 66 | return $this; 67 | } 68 | 69 | public function getName(): ?string 70 | { 71 | return $this->name; 72 | } 73 | 74 | public function setName(string $name): self 75 | { 76 | $this->name = $name; 77 | 78 | return $this; 79 | } 80 | 81 | public function getDescription(): ?string 82 | { 83 | return $this->description; 84 | } 85 | 86 | public function setDescription(string $description): self 87 | { 88 | $this->description = $description; 89 | 90 | return $this; 91 | } 92 | 93 | public function getValue(): ?bool 94 | { 95 | return $this->value; 96 | } 97 | 98 | public function setValue(bool $value): self 99 | { 100 | $this->value = $value; 101 | 102 | return $this; 103 | } 104 | 105 | 106 | } 107 | -------------------------------------------------------------------------------- /src/Entity/ModxAccessPolicies.php: -------------------------------------------------------------------------------- 1 | id; 76 | } 77 | 78 | public function getName(): ?string 79 | { 80 | return $this->name; 81 | } 82 | 83 | public function setName(string $name): self 84 | { 85 | $this->name = $name; 86 | 87 | return $this; 88 | } 89 | 90 | public function getDescription(): ?string 91 | { 92 | return $this->description; 93 | } 94 | 95 | public function setDescription(?string $description): self 96 | { 97 | $this->description = $description; 98 | 99 | return $this; 100 | } 101 | 102 | public function getParent(): ?int 103 | { 104 | return $this->parent; 105 | } 106 | 107 | public function setParent(int $parent): self 108 | { 109 | $this->parent = $parent; 110 | 111 | return $this; 112 | } 113 | 114 | public function getTemplate(): ?int 115 | { 116 | return $this->template; 117 | } 118 | 119 | public function setTemplate(int $template): self 120 | { 121 | $this->template = $template; 122 | 123 | return $this; 124 | } 125 | 126 | public function getClass(): ?string 127 | { 128 | return $this->class; 129 | } 130 | 131 | public function setClass(string $class): self 132 | { 133 | $this->class = $class; 134 | 135 | return $this; 136 | } 137 | 138 | public function getData(): ?string 139 | { 140 | return $this->data; 141 | } 142 | 143 | public function setData(?string $data): self 144 | { 145 | $this->data = $data; 146 | 147 | return $this; 148 | } 149 | 150 | public function getLexicon(): ?string 151 | { 152 | return $this->lexicon; 153 | } 154 | 155 | public function setLexicon(string $lexicon): self 156 | { 157 | $this->lexicon = $lexicon; 158 | 159 | return $this; 160 | } 161 | 162 | 163 | } 164 | -------------------------------------------------------------------------------- /src/Entity/ModxAccessPolicyTemplateGroups.php: -------------------------------------------------------------------------------- 1 | id; 41 | } 42 | 43 | public function getName(): ?string 44 | { 45 | return $this->name; 46 | } 47 | 48 | public function setName(string $name): self 49 | { 50 | $this->name = $name; 51 | 52 | return $this; 53 | } 54 | 55 | public function getDescription(): ?string 56 | { 57 | return $this->description; 58 | } 59 | 60 | public function setDescription(?string $description): self 61 | { 62 | $this->description = $description; 63 | 64 | return $this; 65 | } 66 | 67 | 68 | } 69 | -------------------------------------------------------------------------------- /src/Entity/ModxAccessPolicyTemplates.php: -------------------------------------------------------------------------------- 1 | id; 55 | } 56 | 57 | public function getTemplateGroup(): ?int 58 | { 59 | return $this->templateGroup; 60 | } 61 | 62 | public function setTemplateGroup(int $templateGroup): self 63 | { 64 | $this->templateGroup = $templateGroup; 65 | 66 | return $this; 67 | } 68 | 69 | public function getName(): ?string 70 | { 71 | return $this->name; 72 | } 73 | 74 | public function setName(string $name): self 75 | { 76 | $this->name = $name; 77 | 78 | return $this; 79 | } 80 | 81 | public function getDescription(): ?string 82 | { 83 | return $this->description; 84 | } 85 | 86 | public function setDescription(?string $description): self 87 | { 88 | $this->description = $description; 89 | 90 | return $this; 91 | } 92 | 93 | public function getLexicon(): ?string 94 | { 95 | return $this->lexicon; 96 | } 97 | 98 | public function setLexicon(string $lexicon): self 99 | { 100 | $this->lexicon = $lexicon; 101 | 102 | return $this; 103 | } 104 | 105 | 106 | } 107 | -------------------------------------------------------------------------------- /src/Entity/ModxAccessResourceGroups.php: -------------------------------------------------------------------------------- 1 | id; 69 | } 70 | 71 | public function getTarget(): ?string 72 | { 73 | return $this->target; 74 | } 75 | 76 | public function setTarget(string $target): self 77 | { 78 | $this->target = $target; 79 | 80 | return $this; 81 | } 82 | 83 | public function getPrincipalClass(): ?string 84 | { 85 | return $this->principalClass; 86 | } 87 | 88 | public function setPrincipalClass(string $principalClass): self 89 | { 90 | $this->principalClass = $principalClass; 91 | 92 | return $this; 93 | } 94 | 95 | public function getPrincipal(): ?int 96 | { 97 | return $this->principal; 98 | } 99 | 100 | public function setPrincipal(int $principal): self 101 | { 102 | $this->principal = $principal; 103 | 104 | return $this; 105 | } 106 | 107 | public function getAuthority(): ?int 108 | { 109 | return $this->authority; 110 | } 111 | 112 | public function setAuthority(int $authority): self 113 | { 114 | $this->authority = $authority; 115 | 116 | return $this; 117 | } 118 | 119 | public function getPolicy(): ?int 120 | { 121 | return $this->policy; 122 | } 123 | 124 | public function setPolicy(int $policy): self 125 | { 126 | $this->policy = $policy; 127 | 128 | return $this; 129 | } 130 | 131 | public function getContextKey(): ?string 132 | { 133 | return $this->contextKey; 134 | } 135 | 136 | public function setContextKey(string $contextKey): self 137 | { 138 | $this->contextKey = $contextKey; 139 | 140 | return $this; 141 | } 142 | 143 | 144 | } 145 | -------------------------------------------------------------------------------- /src/Entity/ModxAccessResources.php: -------------------------------------------------------------------------------- 1 | id; 69 | } 70 | 71 | public function getTarget(): ?string 72 | { 73 | return $this->target; 74 | } 75 | 76 | public function setTarget(string $target): self 77 | { 78 | $this->target = $target; 79 | 80 | return $this; 81 | } 82 | 83 | public function getPrincipalClass(): ?string 84 | { 85 | return $this->principalClass; 86 | } 87 | 88 | public function setPrincipalClass(string $principalClass): self 89 | { 90 | $this->principalClass = $principalClass; 91 | 92 | return $this; 93 | } 94 | 95 | public function getPrincipal(): ?int 96 | { 97 | return $this->principal; 98 | } 99 | 100 | public function setPrincipal(int $principal): self 101 | { 102 | $this->principal = $principal; 103 | 104 | return $this; 105 | } 106 | 107 | public function getAuthority(): ?int 108 | { 109 | return $this->authority; 110 | } 111 | 112 | public function setAuthority(int $authority): self 113 | { 114 | $this->authority = $authority; 115 | 116 | return $this; 117 | } 118 | 119 | public function getPolicy(): ?int 120 | { 121 | return $this->policy; 122 | } 123 | 124 | public function setPolicy(int $policy): self 125 | { 126 | $this->policy = $policy; 127 | 128 | return $this; 129 | } 130 | 131 | public function getContextKey(): ?string 132 | { 133 | return $this->contextKey; 134 | } 135 | 136 | public function setContextKey(string $contextKey): self 137 | { 138 | $this->contextKey = $contextKey; 139 | 140 | return $this; 141 | } 142 | 143 | 144 | } 145 | -------------------------------------------------------------------------------- /src/Entity/ModxAccessTemplatevars.php: -------------------------------------------------------------------------------- 1 | id; 69 | } 70 | 71 | public function getTarget(): ?string 72 | { 73 | return $this->target; 74 | } 75 | 76 | public function setTarget(string $target): self 77 | { 78 | $this->target = $target; 79 | 80 | return $this; 81 | } 82 | 83 | public function getPrincipalClass(): ?string 84 | { 85 | return $this->principalClass; 86 | } 87 | 88 | public function setPrincipalClass(string $principalClass): self 89 | { 90 | $this->principalClass = $principalClass; 91 | 92 | return $this; 93 | } 94 | 95 | public function getPrincipal(): ?int 96 | { 97 | return $this->principal; 98 | } 99 | 100 | public function setPrincipal(int $principal): self 101 | { 102 | $this->principal = $principal; 103 | 104 | return $this; 105 | } 106 | 107 | public function getAuthority(): ?int 108 | { 109 | return $this->authority; 110 | } 111 | 112 | public function setAuthority(int $authority): self 113 | { 114 | $this->authority = $authority; 115 | 116 | return $this; 117 | } 118 | 119 | public function getPolicy(): ?int 120 | { 121 | return $this->policy; 122 | } 123 | 124 | public function setPolicy(int $policy): self 125 | { 126 | $this->policy = $policy; 127 | 128 | return $this; 129 | } 130 | 131 | public function getContextKey(): ?string 132 | { 133 | return $this->contextKey; 134 | } 135 | 136 | public function setContextKey(string $contextKey): self 137 | { 138 | $this->contextKey = $contextKey; 139 | 140 | return $this; 141 | } 142 | 143 | 144 | } 145 | -------------------------------------------------------------------------------- /src/Entity/ModxActions.php: -------------------------------------------------------------------------------- 1 | id; 69 | } 70 | 71 | public function getNamespace(): ?string 72 | { 73 | return $this->namespace; 74 | } 75 | 76 | public function setNamespace(string $namespace): self 77 | { 78 | $this->namespace = $namespace; 79 | 80 | return $this; 81 | } 82 | 83 | public function getController(): ?string 84 | { 85 | return $this->controller; 86 | } 87 | 88 | public function setController(string $controller): self 89 | { 90 | $this->controller = $controller; 91 | 92 | return $this; 93 | } 94 | 95 | public function getHaslayout(): ?bool 96 | { 97 | return $this->haslayout; 98 | } 99 | 100 | public function setHaslayout(bool $haslayout): self 101 | { 102 | $this->haslayout = $haslayout; 103 | 104 | return $this; 105 | } 106 | 107 | public function getLangTopics(): ?string 108 | { 109 | return $this->langTopics; 110 | } 111 | 112 | public function setLangTopics(string $langTopics): self 113 | { 114 | $this->langTopics = $langTopics; 115 | 116 | return $this; 117 | } 118 | 119 | public function getAssets(): ?string 120 | { 121 | return $this->assets; 122 | } 123 | 124 | public function setAssets(string $assets): self 125 | { 126 | $this->assets = $assets; 127 | 128 | return $this; 129 | } 130 | 131 | public function getHelpUrl(): ?string 132 | { 133 | return $this->helpUrl; 134 | } 135 | 136 | public function setHelpUrl(string $helpUrl): self 137 | { 138 | $this->helpUrl = $helpUrl; 139 | 140 | return $this; 141 | } 142 | 143 | 144 | } 145 | -------------------------------------------------------------------------------- /src/Entity/ModxActionsFields.php: -------------------------------------------------------------------------------- 1 | id; 76 | } 77 | 78 | public function getAction(): ?string 79 | { 80 | return $this->action; 81 | } 82 | 83 | public function setAction(string $action): self 84 | { 85 | $this->action = $action; 86 | 87 | return $this; 88 | } 89 | 90 | public function getName(): ?string 91 | { 92 | return $this->name; 93 | } 94 | 95 | public function setName(string $name): self 96 | { 97 | $this->name = $name; 98 | 99 | return $this; 100 | } 101 | 102 | public function getType(): ?string 103 | { 104 | return $this->type; 105 | } 106 | 107 | public function setType(string $type): self 108 | { 109 | $this->type = $type; 110 | 111 | return $this; 112 | } 113 | 114 | public function getTab(): ?string 115 | { 116 | return $this->tab; 117 | } 118 | 119 | public function setTab(string $tab): self 120 | { 121 | $this->tab = $tab; 122 | 123 | return $this; 124 | } 125 | 126 | public function getForm(): ?string 127 | { 128 | return $this->form; 129 | } 130 | 131 | public function setForm(string $form): self 132 | { 133 | $this->form = $form; 134 | 135 | return $this; 136 | } 137 | 138 | public function getOther(): ?string 139 | { 140 | return $this->other; 141 | } 142 | 143 | public function setOther(string $other): self 144 | { 145 | $this->other = $other; 146 | 147 | return $this; 148 | } 149 | 150 | public function getRank(): ?int 151 | { 152 | return $this->rank; 153 | } 154 | 155 | public function setRank(int $rank): self 156 | { 157 | $this->rank = $rank; 158 | 159 | return $this; 160 | } 161 | 162 | 163 | } 164 | -------------------------------------------------------------------------------- /src/Entity/ModxActiveUsers.php: -------------------------------------------------------------------------------- 1 | internalkey; 62 | } 63 | 64 | public function getUsername(): ?string 65 | { 66 | return $this->username; 67 | } 68 | 69 | public function setUsername(string $username): self 70 | { 71 | $this->username = $username; 72 | 73 | return $this; 74 | } 75 | 76 | public function getLasthit(): ?int 77 | { 78 | return $this->lasthit; 79 | } 80 | 81 | public function setLasthit(int $lasthit): self 82 | { 83 | $this->lasthit = $lasthit; 84 | 85 | return $this; 86 | } 87 | 88 | public function getId(): ?int 89 | { 90 | return $this->id; 91 | } 92 | 93 | public function setId(?int $id): self 94 | { 95 | $this->id = $id; 96 | 97 | return $this; 98 | } 99 | 100 | public function getAction(): ?string 101 | { 102 | return $this->action; 103 | } 104 | 105 | public function setAction(string $action): self 106 | { 107 | $this->action = $action; 108 | 109 | return $this; 110 | } 111 | 112 | public function getIp(): ?string 113 | { 114 | return $this->ip; 115 | } 116 | 117 | public function setIp(string $ip): self 118 | { 119 | $this->ip = $ip; 120 | 121 | return $this; 122 | } 123 | 124 | 125 | } 126 | -------------------------------------------------------------------------------- /src/Entity/ModxCategories.php: -------------------------------------------------------------------------------- 1 | id; 48 | } 49 | 50 | public function getParent(): ?int 51 | { 52 | return $this->parent; 53 | } 54 | 55 | public function setParent(?int $parent): self 56 | { 57 | $this->parent = $parent; 58 | 59 | return $this; 60 | } 61 | 62 | public function getCategory(): ?string 63 | { 64 | return $this->category; 65 | } 66 | 67 | public function setCategory(string $category): self 68 | { 69 | $this->category = $category; 70 | 71 | return $this; 72 | } 73 | 74 | public function getRank(): ?int 75 | { 76 | return $this->rank; 77 | } 78 | 79 | public function setRank(int $rank): self 80 | { 81 | $this->rank = $rank; 82 | 83 | return $this; 84 | } 85 | 86 | 87 | } 88 | -------------------------------------------------------------------------------- /src/Entity/ModxCategoriesClosure.php: -------------------------------------------------------------------------------- 1 | ancestor; 43 | } 44 | 45 | public function getDescendant(): ?int 46 | { 47 | return $this->descendant; 48 | } 49 | 50 | public function getDepth(): ?int 51 | { 52 | return $this->depth; 53 | } 54 | 55 | public function setDepth(int $depth): self 56 | { 57 | $this->depth = $depth; 58 | 59 | return $this; 60 | } 61 | 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/Entity/ModxClassMap.php: -------------------------------------------------------------------------------- 1 | id; 62 | } 63 | 64 | public function getClass(): ?string 65 | { 66 | return $this->class; 67 | } 68 | 69 | public function setClass(string $class): self 70 | { 71 | $this->class = $class; 72 | 73 | return $this; 74 | } 75 | 76 | public function getParentClass(): ?string 77 | { 78 | return $this->parentClass; 79 | } 80 | 81 | public function setParentClass(string $parentClass): self 82 | { 83 | $this->parentClass = $parentClass; 84 | 85 | return $this; 86 | } 87 | 88 | public function getNameField(): ?string 89 | { 90 | return $this->nameField; 91 | } 92 | 93 | public function setNameField(string $nameField): self 94 | { 95 | $this->nameField = $nameField; 96 | 97 | return $this; 98 | } 99 | 100 | public function getPath(): ?string 101 | { 102 | return $this->path; 103 | } 104 | 105 | public function setPath(?string $path): self 106 | { 107 | $this->path = $path; 108 | 109 | return $this; 110 | } 111 | 112 | public function getLexicon(): ?string 113 | { 114 | return $this->lexicon; 115 | } 116 | 117 | public function setLexicon(string $lexicon): self 118 | { 119 | $this->lexicon = $lexicon; 120 | 121 | return $this; 122 | } 123 | 124 | 125 | } 126 | -------------------------------------------------------------------------------- /src/Entity/ModxContentType.php: -------------------------------------------------------------------------------- 1 | id; 69 | } 70 | 71 | public function getName(): ?string 72 | { 73 | return $this->name; 74 | } 75 | 76 | public function setName(string $name): self 77 | { 78 | $this->name = $name; 79 | 80 | return $this; 81 | } 82 | 83 | public function getDescription(): ?string 84 | { 85 | return $this->description; 86 | } 87 | 88 | public function setDescription(?string $description): self 89 | { 90 | $this->description = $description; 91 | 92 | return $this; 93 | } 94 | 95 | public function getMimeType(): ?string 96 | { 97 | return $this->mimeType; 98 | } 99 | 100 | public function setMimeType(?string $mimeType): self 101 | { 102 | $this->mimeType = $mimeType; 103 | 104 | return $this; 105 | } 106 | 107 | public function getFileExtensions(): ?string 108 | { 109 | return $this->fileExtensions; 110 | } 111 | 112 | public function setFileExtensions(?string $fileExtensions): self 113 | { 114 | $this->fileExtensions = $fileExtensions; 115 | 116 | return $this; 117 | } 118 | 119 | public function getHeaders(): ?string 120 | { 121 | return $this->headers; 122 | } 123 | 124 | public function setHeaders(?string $headers): self 125 | { 126 | $this->headers = $headers; 127 | 128 | return $this; 129 | } 130 | 131 | public function getBinary(): ?bool 132 | { 133 | return $this->binary; 134 | } 135 | 136 | public function setBinary(bool $binary): self 137 | { 138 | $this->binary = $binary; 139 | 140 | return $this; 141 | } 142 | 143 | 144 | } 145 | -------------------------------------------------------------------------------- /src/Entity/ModxContext.php: -------------------------------------------------------------------------------- 1 | key; 48 | } 49 | 50 | public function getName(): ?string 51 | { 52 | return $this->name; 53 | } 54 | 55 | public function setName(?string $name): self 56 | { 57 | $this->name = $name; 58 | 59 | return $this; 60 | } 61 | 62 | public function getDescription(): ?string 63 | { 64 | return $this->description; 65 | } 66 | 67 | public function setDescription(?string $description): self 68 | { 69 | $this->description = $description; 70 | 71 | return $this; 72 | } 73 | 74 | public function getRank(): ?int 75 | { 76 | return $this->rank; 77 | } 78 | 79 | public function setRank(int $rank): self 80 | { 81 | $this->rank = $rank; 82 | 83 | return $this; 84 | } 85 | 86 | 87 | } 88 | -------------------------------------------------------------------------------- /src/Entity/ModxContextResource.php: -------------------------------------------------------------------------------- 1 | contextKey; 36 | } 37 | 38 | public function getResource(): ?int 39 | { 40 | return $this->resource; 41 | } 42 | 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/Entity/ModxContextSetting.php: -------------------------------------------------------------------------------- 1 | contextKey; 71 | } 72 | 73 | public function getKey(): ?string 74 | { 75 | return $this->key; 76 | } 77 | 78 | public function getValue(): ?string 79 | { 80 | return $this->value; 81 | } 82 | 83 | public function setValue(?string $value): self 84 | { 85 | $this->value = $value; 86 | 87 | return $this; 88 | } 89 | 90 | public function getXtype(): ?string 91 | { 92 | return $this->xtype; 93 | } 94 | 95 | public function setXtype(string $xtype): self 96 | { 97 | $this->xtype = $xtype; 98 | 99 | return $this; 100 | } 101 | 102 | public function getNamespace(): ?string 103 | { 104 | return $this->namespace; 105 | } 106 | 107 | public function setNamespace(string $namespace): self 108 | { 109 | $this->namespace = $namespace; 110 | 111 | return $this; 112 | } 113 | 114 | public function getArea(): ?string 115 | { 116 | return $this->area; 117 | } 118 | 119 | public function setArea(string $area): self 120 | { 121 | $this->area = $area; 122 | 123 | return $this; 124 | } 125 | 126 | public function getEditedon(): ?\DateTimeInterface 127 | { 128 | return $this->editedon; 129 | } 130 | 131 | public function setEditedon(?\DateTimeInterface $editedon): self 132 | { 133 | $this->editedon = $editedon; 134 | 135 | return $this; 136 | } 137 | 138 | 139 | } 140 | -------------------------------------------------------------------------------- /src/Entity/ModxDashboard.php: -------------------------------------------------------------------------------- 1 | id; 48 | } 49 | 50 | public function getName(): ?string 51 | { 52 | return $this->name; 53 | } 54 | 55 | public function setName(string $name): self 56 | { 57 | $this->name = $name; 58 | 59 | return $this; 60 | } 61 | 62 | public function getDescription(): ?string 63 | { 64 | return $this->description; 65 | } 66 | 67 | public function setDescription(?string $description): self 68 | { 69 | $this->description = $description; 70 | 71 | return $this; 72 | } 73 | 74 | public function getHideTrees(): ?bool 75 | { 76 | return $this->hideTrees; 77 | } 78 | 79 | public function setHideTrees(bool $hideTrees): self 80 | { 81 | $this->hideTrees = $hideTrees; 82 | 83 | return $this; 84 | } 85 | 86 | 87 | } 88 | -------------------------------------------------------------------------------- /src/Entity/ModxDashboardWidget.php: -------------------------------------------------------------------------------- 1 | id; 76 | } 77 | 78 | public function getName(): ?string 79 | { 80 | return $this->name; 81 | } 82 | 83 | public function setName(string $name): self 84 | { 85 | $this->name = $name; 86 | 87 | return $this; 88 | } 89 | 90 | public function getDescription(): ?string 91 | { 92 | return $this->description; 93 | } 94 | 95 | public function setDescription(?string $description): self 96 | { 97 | $this->description = $description; 98 | 99 | return $this; 100 | } 101 | 102 | public function getType(): ?string 103 | { 104 | return $this->type; 105 | } 106 | 107 | public function setType(string $type): self 108 | { 109 | $this->type = $type; 110 | 111 | return $this; 112 | } 113 | 114 | public function getContent(): ?string 115 | { 116 | return $this->content; 117 | } 118 | 119 | public function setContent(?string $content): self 120 | { 121 | $this->content = $content; 122 | 123 | return $this; 124 | } 125 | 126 | public function getNamespace(): ?string 127 | { 128 | return $this->namespace; 129 | } 130 | 131 | public function setNamespace(string $namespace): self 132 | { 133 | $this->namespace = $namespace; 134 | 135 | return $this; 136 | } 137 | 138 | public function getLexicon(): ?string 139 | { 140 | return $this->lexicon; 141 | } 142 | 143 | public function setLexicon(string $lexicon): self 144 | { 145 | $this->lexicon = $lexicon; 146 | 147 | return $this; 148 | } 149 | 150 | public function getSize(): ?string 151 | { 152 | return $this->size; 153 | } 154 | 155 | public function setSize(string $size): self 156 | { 157 | $this->size = $size; 158 | 159 | return $this; 160 | } 161 | 162 | 163 | } 164 | -------------------------------------------------------------------------------- /src/Entity/ModxDashboardWidgetPlacement.php: -------------------------------------------------------------------------------- 1 | dashboard; 43 | } 44 | 45 | public function getWidget(): ?int 46 | { 47 | return $this->widget; 48 | } 49 | 50 | public function getRank(): ?int 51 | { 52 | return $this->rank; 53 | } 54 | 55 | public function setRank(int $rank): self 56 | { 57 | $this->rank = $rank; 58 | 59 | return $this; 60 | } 61 | 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/Entity/ModxDocumentGroups.php: -------------------------------------------------------------------------------- 1 | id; 41 | } 42 | 43 | public function getDocumentGroup(): ?int 44 | { 45 | return $this->documentGroup; 46 | } 47 | 48 | public function setDocumentGroup(int $documentGroup): self 49 | { 50 | $this->documentGroup = $documentGroup; 51 | 52 | return $this; 53 | } 54 | 55 | public function getDocument(): ?int 56 | { 57 | return $this->document; 58 | } 59 | 60 | public function setDocument(int $document): self 61 | { 62 | $this->document = $document; 63 | 64 | return $this; 65 | } 66 | 67 | 68 | } 69 | -------------------------------------------------------------------------------- /src/Entity/ModxDocumentgroupNames.php: -------------------------------------------------------------------------------- 1 | id; 48 | } 49 | 50 | public function getName(): ?string 51 | { 52 | return $this->name; 53 | } 54 | 55 | public function setName(string $name): self 56 | { 57 | $this->name = $name; 58 | 59 | return $this; 60 | } 61 | 62 | public function getPrivateMemgroup(): ?bool 63 | { 64 | return $this->privateMemgroup; 65 | } 66 | 67 | public function setPrivateMemgroup(bool $privateMemgroup): self 68 | { 69 | $this->privateMemgroup = $privateMemgroup; 70 | 71 | return $this; 72 | } 73 | 74 | public function getPrivateWebgroup(): ?bool 75 | { 76 | return $this->privateWebgroup; 77 | } 78 | 79 | public function setPrivateWebgroup(bool $privateWebgroup): self 80 | { 81 | $this->privateWebgroup = $privateWebgroup; 82 | 83 | return $this; 84 | } 85 | 86 | 87 | } 88 | -------------------------------------------------------------------------------- /src/Entity/ModxElementPropertySets.php: -------------------------------------------------------------------------------- 1 | element; 45 | } 46 | 47 | public function getElementClass(): ?string 48 | { 49 | return $this->elementClass; 50 | } 51 | 52 | public function getPropertySet(): ?int 53 | { 54 | return $this->propertySet; 55 | } 56 | 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/Entity/ModxExtensionPackages.php: -------------------------------------------------------------------------------- 1 | id; 83 | } 84 | 85 | public function getNamespace(): ?string 86 | { 87 | return $this->namespace; 88 | } 89 | 90 | public function setNamespace(string $namespace): self 91 | { 92 | $this->namespace = $namespace; 93 | 94 | return $this; 95 | } 96 | 97 | public function getName(): ?string 98 | { 99 | return $this->name; 100 | } 101 | 102 | public function setName(string $name): self 103 | { 104 | $this->name = $name; 105 | 106 | return $this; 107 | } 108 | 109 | public function getPath(): ?string 110 | { 111 | return $this->path; 112 | } 113 | 114 | public function setPath(?string $path): self 115 | { 116 | $this->path = $path; 117 | 118 | return $this; 119 | } 120 | 121 | public function getTablePrefix(): ?string 122 | { 123 | return $this->tablePrefix; 124 | } 125 | 126 | public function setTablePrefix(string $tablePrefix): self 127 | { 128 | $this->tablePrefix = $tablePrefix; 129 | 130 | return $this; 131 | } 132 | 133 | public function getServiceClass(): ?string 134 | { 135 | return $this->serviceClass; 136 | } 137 | 138 | public function setServiceClass(string $serviceClass): self 139 | { 140 | $this->serviceClass = $serviceClass; 141 | 142 | return $this; 143 | } 144 | 145 | public function getServiceName(): ?string 146 | { 147 | return $this->serviceName; 148 | } 149 | 150 | public function setServiceName(string $serviceName): self 151 | { 152 | $this->serviceName = $serviceName; 153 | 154 | return $this; 155 | } 156 | 157 | public function getCreatedAt(): ?\DateTimeInterface 158 | { 159 | return $this->createdAt; 160 | } 161 | 162 | public function setCreatedAt(?\DateTimeInterface $createdAt): self 163 | { 164 | $this->createdAt = $createdAt; 165 | 166 | return $this; 167 | } 168 | 169 | public function getUpdatedAt(): ?\DateTimeInterface 170 | { 171 | return $this->updatedAt; 172 | } 173 | 174 | public function setUpdatedAt(?\DateTimeInterface $updatedAt): self 175 | { 176 | $this->updatedAt = $updatedAt; 177 | 178 | return $this; 179 | } 180 | 181 | 182 | } 183 | -------------------------------------------------------------------------------- /src/Entity/ModxFcProfiles.php: -------------------------------------------------------------------------------- 1 | id; 55 | } 56 | 57 | public function getName(): ?string 58 | { 59 | return $this->name; 60 | } 61 | 62 | public function setName(string $name): self 63 | { 64 | $this->name = $name; 65 | 66 | return $this; 67 | } 68 | 69 | public function getDescription(): ?string 70 | { 71 | return $this->description; 72 | } 73 | 74 | public function setDescription(string $description): self 75 | { 76 | $this->description = $description; 77 | 78 | return $this; 79 | } 80 | 81 | public function getActive(): ?bool 82 | { 83 | return $this->active; 84 | } 85 | 86 | public function setActive(bool $active): self 87 | { 88 | $this->active = $active; 89 | 90 | return $this; 91 | } 92 | 93 | public function getRank(): ?int 94 | { 95 | return $this->rank; 96 | } 97 | 98 | public function setRank(int $rank): self 99 | { 100 | $this->rank = $rank; 101 | 102 | return $this; 103 | } 104 | 105 | 106 | } 107 | -------------------------------------------------------------------------------- /src/Entity/ModxFcProfilesUsergroups.php: -------------------------------------------------------------------------------- 1 | usergroup; 36 | } 37 | 38 | public function getProfile(): ?int 39 | { 40 | return $this->profile; 41 | } 42 | 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/Entity/ModxFcSets.php: -------------------------------------------------------------------------------- 1 | id; 83 | } 84 | 85 | public function getProfile(): ?int 86 | { 87 | return $this->profile; 88 | } 89 | 90 | public function setProfile(int $profile): self 91 | { 92 | $this->profile = $profile; 93 | 94 | return $this; 95 | } 96 | 97 | public function getAction(): ?string 98 | { 99 | return $this->action; 100 | } 101 | 102 | public function setAction(string $action): self 103 | { 104 | $this->action = $action; 105 | 106 | return $this; 107 | } 108 | 109 | public function getDescription(): ?string 110 | { 111 | return $this->description; 112 | } 113 | 114 | public function setDescription(string $description): self 115 | { 116 | $this->description = $description; 117 | 118 | return $this; 119 | } 120 | 121 | public function getActive(): ?bool 122 | { 123 | return $this->active; 124 | } 125 | 126 | public function setActive(bool $active): self 127 | { 128 | $this->active = $active; 129 | 130 | return $this; 131 | } 132 | 133 | public function getTemplate(): ?int 134 | { 135 | return $this->template; 136 | } 137 | 138 | public function setTemplate(int $template): self 139 | { 140 | $this->template = $template; 141 | 142 | return $this; 143 | } 144 | 145 | public function getConstraint(): ?string 146 | { 147 | return $this->constraint; 148 | } 149 | 150 | public function setConstraint(string $constraint): self 151 | { 152 | $this->constraint = $constraint; 153 | 154 | return $this; 155 | } 156 | 157 | public function getConstraintField(): ?string 158 | { 159 | return $this->constraintField; 160 | } 161 | 162 | public function setConstraintField(string $constraintField): self 163 | { 164 | $this->constraintField = $constraintField; 165 | 166 | return $this; 167 | } 168 | 169 | public function getConstraintClass(): ?string 170 | { 171 | return $this->constraintClass; 172 | } 173 | 174 | public function setConstraintClass(string $constraintClass): self 175 | { 176 | $this->constraintClass = $constraintClass; 177 | 178 | return $this; 179 | } 180 | 181 | 182 | } 183 | -------------------------------------------------------------------------------- /src/Entity/ModxLexiconEntries.php: -------------------------------------------------------------------------------- 1 | id; 76 | } 77 | 78 | public function getName(): ?string 79 | { 80 | return $this->name; 81 | } 82 | 83 | public function setName(string $name): self 84 | { 85 | $this->name = $name; 86 | 87 | return $this; 88 | } 89 | 90 | public function getValue(): ?string 91 | { 92 | return $this->value; 93 | } 94 | 95 | public function setValue(string $value): self 96 | { 97 | $this->value = $value; 98 | 99 | return $this; 100 | } 101 | 102 | public function getTopic(): ?string 103 | { 104 | return $this->topic; 105 | } 106 | 107 | public function setTopic(string $topic): self 108 | { 109 | $this->topic = $topic; 110 | 111 | return $this; 112 | } 113 | 114 | public function getNamespace(): ?string 115 | { 116 | return $this->namespace; 117 | } 118 | 119 | public function setNamespace(string $namespace): self 120 | { 121 | $this->namespace = $namespace; 122 | 123 | return $this; 124 | } 125 | 126 | public function getLanguage(): ?string 127 | { 128 | return $this->language; 129 | } 130 | 131 | public function setLanguage(string $language): self 132 | { 133 | $this->language = $language; 134 | 135 | return $this; 136 | } 137 | 138 | public function getCreatedon(): ?\DateTimeInterface 139 | { 140 | return $this->createdon; 141 | } 142 | 143 | public function setCreatedon(?\DateTimeInterface $createdon): self 144 | { 145 | $this->createdon = $createdon; 146 | 147 | return $this; 148 | } 149 | 150 | public function getEditedon(): ?\DateTimeInterface 151 | { 152 | return $this->editedon; 153 | } 154 | 155 | public function setEditedon(?\DateTimeInterface $editedon): self 156 | { 157 | $this->editedon = $editedon; 158 | 159 | return $this; 160 | } 161 | 162 | 163 | } 164 | -------------------------------------------------------------------------------- /src/Entity/ModxManagerLog.php: -------------------------------------------------------------------------------- 1 | id; 62 | } 63 | 64 | public function getUser(): ?int 65 | { 66 | return $this->user; 67 | } 68 | 69 | public function setUser(int $user): self 70 | { 71 | $this->user = $user; 72 | 73 | return $this; 74 | } 75 | 76 | public function getOccurred(): ?\DateTimeInterface 77 | { 78 | return $this->occurred; 79 | } 80 | 81 | public function setOccurred(?\DateTimeInterface $occurred): self 82 | { 83 | $this->occurred = $occurred; 84 | 85 | return $this; 86 | } 87 | 88 | public function getAction(): ?string 89 | { 90 | return $this->action; 91 | } 92 | 93 | public function setAction(string $action): self 94 | { 95 | $this->action = $action; 96 | 97 | return $this; 98 | } 99 | 100 | public function getClasskey(): ?string 101 | { 102 | return $this->classkey; 103 | } 104 | 105 | public function setClasskey(string $classkey): self 106 | { 107 | $this->classkey = $classkey; 108 | 109 | return $this; 110 | } 111 | 112 | public function getItem(): ?string 113 | { 114 | return $this->item; 115 | } 116 | 117 | public function setItem(string $item): self 118 | { 119 | $this->item = $item; 120 | 121 | return $this; 122 | } 123 | 124 | 125 | } 126 | -------------------------------------------------------------------------------- /src/Entity/ModxMediaSources.php: -------------------------------------------------------------------------------- 1 | id; 62 | } 63 | 64 | public function getName(): ?string 65 | { 66 | return $this->name; 67 | } 68 | 69 | public function setName(string $name): self 70 | { 71 | $this->name = $name; 72 | 73 | return $this; 74 | } 75 | 76 | public function getDescription(): ?string 77 | { 78 | return $this->description; 79 | } 80 | 81 | public function setDescription(?string $description): self 82 | { 83 | $this->description = $description; 84 | 85 | return $this; 86 | } 87 | 88 | public function getClassKey(): ?string 89 | { 90 | return $this->classKey; 91 | } 92 | 93 | public function setClassKey(string $classKey): self 94 | { 95 | $this->classKey = $classKey; 96 | 97 | return $this; 98 | } 99 | 100 | public function getProperties(): ?string 101 | { 102 | return $this->properties; 103 | } 104 | 105 | public function setProperties(?string $properties): self 106 | { 107 | $this->properties = $properties; 108 | 109 | return $this; 110 | } 111 | 112 | public function getIsStream(): ?bool 113 | { 114 | return $this->isStream; 115 | } 116 | 117 | public function setIsStream(bool $isStream): self 118 | { 119 | $this->isStream = $isStream; 120 | 121 | return $this; 122 | } 123 | 124 | 125 | } 126 | -------------------------------------------------------------------------------- /src/Entity/ModxMediaSourcesContexts.php: -------------------------------------------------------------------------------- 1 | source; 36 | } 37 | 38 | public function getContextKey(): ?string 39 | { 40 | return $this->contextKey; 41 | } 42 | 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/Entity/ModxMediaSourcesElements.php: -------------------------------------------------------------------------------- 1 | source; 54 | } 55 | 56 | public function getObjectClass(): ?string 57 | { 58 | return $this->objectClass; 59 | } 60 | 61 | public function getObject(): ?int 62 | { 63 | return $this->object; 64 | } 65 | 66 | public function getContextKey(): ?string 67 | { 68 | return $this->contextKey; 69 | } 70 | 71 | 72 | } 73 | -------------------------------------------------------------------------------- /src/Entity/ModxMemberGroups.php: -------------------------------------------------------------------------------- 1 | id; 55 | } 56 | 57 | public function getUserGroup(): ?int 58 | { 59 | return $this->userGroup; 60 | } 61 | 62 | public function setUserGroup(int $userGroup): self 63 | { 64 | $this->userGroup = $userGroup; 65 | 66 | return $this; 67 | } 68 | 69 | public function getMember(): ?int 70 | { 71 | return $this->member; 72 | } 73 | 74 | public function setMember(int $member): self 75 | { 76 | $this->member = $member; 77 | 78 | return $this; 79 | } 80 | 81 | public function getRole(): ?int 82 | { 83 | return $this->role; 84 | } 85 | 86 | public function setRole(int $role): self 87 | { 88 | $this->role = $role; 89 | 90 | return $this; 91 | } 92 | 93 | public function getRank(): ?int 94 | { 95 | return $this->rank; 96 | } 97 | 98 | public function setRank(int $rank): self 99 | { 100 | $this->rank = $rank; 101 | 102 | return $this; 103 | } 104 | 105 | 106 | } 107 | -------------------------------------------------------------------------------- /src/Entity/ModxMembergroupNames.php: -------------------------------------------------------------------------------- 1 | id; 62 | } 63 | 64 | public function getName(): ?string 65 | { 66 | return $this->name; 67 | } 68 | 69 | public function setName(string $name): self 70 | { 71 | $this->name = $name; 72 | 73 | return $this; 74 | } 75 | 76 | public function getDescription(): ?string 77 | { 78 | return $this->description; 79 | } 80 | 81 | public function setDescription(?string $description): self 82 | { 83 | $this->description = $description; 84 | 85 | return $this; 86 | } 87 | 88 | public function getParent(): ?int 89 | { 90 | return $this->parent; 91 | } 92 | 93 | public function setParent(int $parent): self 94 | { 95 | $this->parent = $parent; 96 | 97 | return $this; 98 | } 99 | 100 | public function getRank(): ?int 101 | { 102 | return $this->rank; 103 | } 104 | 105 | public function setRank(int $rank): self 106 | { 107 | $this->rank = $rank; 108 | 109 | return $this; 110 | } 111 | 112 | public function getDashboard(): ?int 113 | { 114 | return $this->dashboard; 115 | } 116 | 117 | public function setDashboard(int $dashboard): self 118 | { 119 | $this->dashboard = $dashboard; 120 | 121 | return $this; 122 | } 123 | 124 | 125 | } 126 | -------------------------------------------------------------------------------- /src/Entity/ModxNamespaces.php: -------------------------------------------------------------------------------- 1 | name; 41 | } 42 | 43 | public function getPath(): ?string 44 | { 45 | return $this->path; 46 | } 47 | 48 | public function setPath(?string $path): self 49 | { 50 | $this->path = $path; 51 | 52 | return $this; 53 | } 54 | 55 | public function getAssetsPath(): ?string 56 | { 57 | return $this->assetsPath; 58 | } 59 | 60 | public function setAssetsPath(?string $assetsPath): self 61 | { 62 | $this->assetsPath = $assetsPath; 63 | 64 | return $this; 65 | } 66 | 67 | 68 | } 69 | -------------------------------------------------------------------------------- /src/Entity/ModxPropertySet.php: -------------------------------------------------------------------------------- 1 | id; 55 | } 56 | 57 | public function getName(): ?string 58 | { 59 | return $this->name; 60 | } 61 | 62 | public function setName(string $name): self 63 | { 64 | $this->name = $name; 65 | 66 | return $this; 67 | } 68 | 69 | public function getCategory(): ?int 70 | { 71 | return $this->category; 72 | } 73 | 74 | public function setCategory(int $category): self 75 | { 76 | $this->category = $category; 77 | 78 | return $this; 79 | } 80 | 81 | public function getDescription(): ?string 82 | { 83 | return $this->description; 84 | } 85 | 86 | public function setDescription(string $description): self 87 | { 88 | $this->description = $description; 89 | 90 | return $this; 91 | } 92 | 93 | public function getProperties(): ?string 94 | { 95 | return $this->properties; 96 | } 97 | 98 | public function setProperties(?string $properties): self 99 | { 100 | $this->properties = $properties; 101 | 102 | return $this; 103 | } 104 | 105 | 106 | } 107 | -------------------------------------------------------------------------------- /src/Entity/ModxRegisterMessages.php: -------------------------------------------------------------------------------- 1 | topic; 85 | } 86 | 87 | public function getId(): ?string 88 | { 89 | return $this->id; 90 | } 91 | 92 | public function getCreated(): ?\DateTimeInterface 93 | { 94 | return $this->created; 95 | } 96 | 97 | public function setCreated(\DateTimeInterface $created): self 98 | { 99 | $this->created = $created; 100 | 101 | return $this; 102 | } 103 | 104 | public function getValid(): ?\DateTimeInterface 105 | { 106 | return $this->valid; 107 | } 108 | 109 | public function setValid(\DateTimeInterface $valid): self 110 | { 111 | $this->valid = $valid; 112 | 113 | return $this; 114 | } 115 | 116 | public function getAccessed(): ?\DateTimeInterface 117 | { 118 | return $this->accessed; 119 | } 120 | 121 | public function setAccessed(?\DateTimeInterface $accessed): self 122 | { 123 | $this->accessed = $accessed; 124 | 125 | return $this; 126 | } 127 | 128 | public function getAccesses(): ?int 129 | { 130 | return $this->accesses; 131 | } 132 | 133 | public function setAccesses(int $accesses): self 134 | { 135 | $this->accesses = $accesses; 136 | 137 | return $this; 138 | } 139 | 140 | public function getExpires(): ?int 141 | { 142 | return $this->expires; 143 | } 144 | 145 | public function setExpires(int $expires): self 146 | { 147 | $this->expires = $expires; 148 | 149 | return $this; 150 | } 151 | 152 | public function getPayload(): ?string 153 | { 154 | return $this->payload; 155 | } 156 | 157 | public function setPayload(string $payload): self 158 | { 159 | $this->payload = $payload; 160 | 161 | return $this; 162 | } 163 | 164 | public function getKill(): ?bool 165 | { 166 | return $this->kill; 167 | } 168 | 169 | public function setKill(bool $kill): self 170 | { 171 | $this->kill = $kill; 172 | 173 | return $this; 174 | } 175 | 176 | 177 | } 178 | -------------------------------------------------------------------------------- /src/Entity/ModxRegisterQueues.php: -------------------------------------------------------------------------------- 1 | id; 41 | } 42 | 43 | public function getName(): ?string 44 | { 45 | return $this->name; 46 | } 47 | 48 | public function setName(string $name): self 49 | { 50 | $this->name = $name; 51 | 52 | return $this; 53 | } 54 | 55 | public function getOptions(): ?string 56 | { 57 | return $this->options; 58 | } 59 | 60 | public function setOptions(?string $options): self 61 | { 62 | $this->options = $options; 63 | 64 | return $this; 65 | } 66 | 67 | 68 | } 69 | -------------------------------------------------------------------------------- /src/Entity/ModxRegisterTopics.php: -------------------------------------------------------------------------------- 1 | id; 62 | } 63 | 64 | public function getQueue(): ?int 65 | { 66 | return $this->queue; 67 | } 68 | 69 | public function setQueue(int $queue): self 70 | { 71 | $this->queue = $queue; 72 | 73 | return $this; 74 | } 75 | 76 | public function getName(): ?string 77 | { 78 | return $this->name; 79 | } 80 | 81 | public function setName(string $name): self 82 | { 83 | $this->name = $name; 84 | 85 | return $this; 86 | } 87 | 88 | public function getCreated(): ?\DateTimeInterface 89 | { 90 | return $this->created; 91 | } 92 | 93 | public function setCreated(\DateTimeInterface $created): self 94 | { 95 | $this->created = $created; 96 | 97 | return $this; 98 | } 99 | 100 | public function getUpdated(): ?\DateTimeInterface 101 | { 102 | return $this->updated; 103 | } 104 | 105 | public function setUpdated(?\DateTimeInterface $updated): self 106 | { 107 | $this->updated = $updated; 108 | 109 | return $this; 110 | } 111 | 112 | public function getOptions(): ?string 113 | { 114 | return $this->options; 115 | } 116 | 117 | public function setOptions(?string $options): self 118 | { 119 | $this->options = $options; 120 | 121 | return $this; 122 | } 123 | 124 | 125 | } 126 | -------------------------------------------------------------------------------- /src/Entity/ModxSession.php: -------------------------------------------------------------------------------- 1 | id; 41 | } 42 | 43 | public function getAccess(): ?int 44 | { 45 | return $this->access; 46 | } 47 | 48 | public function setAccess(int $access): self 49 | { 50 | $this->access = $access; 51 | 52 | return $this; 53 | } 54 | 55 | public function getData(): ?string 56 | { 57 | return $this->data; 58 | } 59 | 60 | public function setData(?string $data): self 61 | { 62 | $this->data = $data; 63 | 64 | return $this; 65 | } 66 | 67 | 68 | } 69 | -------------------------------------------------------------------------------- /src/Entity/ModxSitePluginEvents.php: -------------------------------------------------------------------------------- 1 | pluginid; 50 | } 51 | 52 | public function getEvent(): ?string 53 | { 54 | return $this->event; 55 | } 56 | 57 | public function getPriority(): ?int 58 | { 59 | return $this->priority; 60 | } 61 | 62 | public function setPriority(int $priority): self 63 | { 64 | $this->priority = $priority; 65 | 66 | return $this; 67 | } 68 | 69 | public function getPropertyset(): ?int 70 | { 71 | return $this->propertyset; 72 | } 73 | 74 | public function setPropertyset(int $propertyset): self 75 | { 76 | $this->propertyset = $propertyset; 77 | 78 | return $this; 79 | } 80 | 81 | 82 | } 83 | -------------------------------------------------------------------------------- /src/Entity/ModxSiteTmplvarAccess.php: -------------------------------------------------------------------------------- 1 | id; 41 | } 42 | 43 | public function getTmplvarid(): ?int 44 | { 45 | return $this->tmplvarid; 46 | } 47 | 48 | public function setTmplvarid(int $tmplvarid): self 49 | { 50 | $this->tmplvarid = $tmplvarid; 51 | 52 | return $this; 53 | } 54 | 55 | public function getDocumentgroup(): ?int 56 | { 57 | return $this->documentgroup; 58 | } 59 | 60 | public function setDocumentgroup(int $documentgroup): self 61 | { 62 | $this->documentgroup = $documentgroup; 63 | 64 | return $this; 65 | } 66 | 67 | 68 | } 69 | -------------------------------------------------------------------------------- /src/Entity/ModxSiteTmplvarContentvalues.php: -------------------------------------------------------------------------------- 1 | id; 65 | } 66 | 67 | public function getTmplvarid(): ?int 68 | { 69 | return $this->tmplvarid; 70 | } 71 | 72 | public function setTmplvarid(int $tmplvarid): self 73 | { 74 | $this->tmplvarid = $tmplvarid; 75 | 76 | return $this; 77 | } 78 | 79 | public function getContentid(): ?int 80 | { 81 | return $this->contentid; 82 | } 83 | 84 | public function setContentid(int $contentid): self 85 | { 86 | $this->contentid = $contentid; 87 | 88 | return $this; 89 | } 90 | 91 | public function getValue(): ?string 92 | { 93 | return $this->value; 94 | } 95 | 96 | public function setValue(string $value): self 97 | { 98 | $this->value = $value; 99 | 100 | return $this; 101 | } 102 | 103 | public function getTvName(): ?ModxSiteTmplvars 104 | { 105 | return $this->tvName; 106 | } 107 | 108 | public function setTvName(?ModxSiteTmplvars $tvName): self 109 | { 110 | $this->tvName = $tvName; 111 | 112 | return $this; 113 | } 114 | 115 | 116 | } 117 | -------------------------------------------------------------------------------- /src/Entity/ModxSiteTmplvarTemplates.php: -------------------------------------------------------------------------------- 1 | tmplvarid; 43 | } 44 | 45 | public function getTemplateid(): ?int 46 | { 47 | return $this->templateid; 48 | } 49 | 50 | public function getRank(): ?int 51 | { 52 | return $this->rank; 53 | } 54 | 55 | public function setRank(int $rank): self 56 | { 57 | $this->rank = $rank; 58 | 59 | return $this; 60 | } 61 | 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/Entity/ModxSystemEventnames.php: -------------------------------------------------------------------------------- 1 | name; 41 | } 42 | 43 | public function getService(): ?bool 44 | { 45 | return $this->service; 46 | } 47 | 48 | public function setService(bool $service): self 49 | { 50 | $this->service = $service; 51 | 52 | return $this; 53 | } 54 | 55 | public function getGroupname(): ?string 56 | { 57 | return $this->groupname; 58 | } 59 | 60 | public function setGroupname(string $groupname): self 61 | { 62 | $this->groupname = $groupname; 63 | 64 | return $this; 65 | } 66 | 67 | 68 | } 69 | -------------------------------------------------------------------------------- /src/Entity/ModxSystemSettings.php: -------------------------------------------------------------------------------- 1 | key; 62 | } 63 | 64 | public function getValue(): ?string 65 | { 66 | return $this->value; 67 | } 68 | 69 | public function setValue(string $value): self 70 | { 71 | $this->value = $value; 72 | 73 | return $this; 74 | } 75 | 76 | public function getXtype(): ?string 77 | { 78 | return $this->xtype; 79 | } 80 | 81 | public function setXtype(string $xtype): self 82 | { 83 | $this->xtype = $xtype; 84 | 85 | return $this; 86 | } 87 | 88 | public function getNamespace(): ?string 89 | { 90 | return $this->namespace; 91 | } 92 | 93 | public function setNamespace(string $namespace): self 94 | { 95 | $this->namespace = $namespace; 96 | 97 | return $this; 98 | } 99 | 100 | public function getArea(): ?string 101 | { 102 | return $this->area; 103 | } 104 | 105 | public function setArea(string $area): self 106 | { 107 | $this->area = $area; 108 | 109 | return $this; 110 | } 111 | 112 | public function getEditedon(): ?\DateTimeInterface 113 | { 114 | return $this->editedon; 115 | } 116 | 117 | public function setEditedon(?\DateTimeInterface $editedon): self 118 | { 119 | $this->editedon = $editedon; 120 | 121 | return $this; 122 | } 123 | 124 | 125 | } 126 | -------------------------------------------------------------------------------- /src/Entity/ModxUserGroupRoles.php: -------------------------------------------------------------------------------- 1 | id; 48 | } 49 | 50 | public function getName(): ?string 51 | { 52 | return $this->name; 53 | } 54 | 55 | public function setName(string $name): self 56 | { 57 | $this->name = $name; 58 | 59 | return $this; 60 | } 61 | 62 | public function getDescription(): ?string 63 | { 64 | return $this->description; 65 | } 66 | 67 | public function setDescription(?string $description): self 68 | { 69 | $this->description = $description; 70 | 71 | return $this; 72 | } 73 | 74 | public function getAuthority(): ?int 75 | { 76 | return $this->authority; 77 | } 78 | 79 | public function setAuthority(int $authority): self 80 | { 81 | $this->authority = $authority; 82 | 83 | return $this; 84 | } 85 | 86 | 87 | } 88 | -------------------------------------------------------------------------------- /src/Entity/ModxUserGroupSettings.php: -------------------------------------------------------------------------------- 1 | group; 71 | } 72 | 73 | public function getKey(): ?string 74 | { 75 | return $this->key; 76 | } 77 | 78 | public function getValue(): ?string 79 | { 80 | return $this->value; 81 | } 82 | 83 | public function setValue(?string $value): self 84 | { 85 | $this->value = $value; 86 | 87 | return $this; 88 | } 89 | 90 | public function getXtype(): ?string 91 | { 92 | return $this->xtype; 93 | } 94 | 95 | public function setXtype(string $xtype): self 96 | { 97 | $this->xtype = $xtype; 98 | 99 | return $this; 100 | } 101 | 102 | public function getNamespace(): ?string 103 | { 104 | return $this->namespace; 105 | } 106 | 107 | public function setNamespace(string $namespace): self 108 | { 109 | $this->namespace = $namespace; 110 | 111 | return $this; 112 | } 113 | 114 | public function getArea(): ?string 115 | { 116 | return $this->area; 117 | } 118 | 119 | public function setArea(string $area): self 120 | { 121 | $this->area = $area; 122 | 123 | return $this; 124 | } 125 | 126 | public function getEditedon(): ?\DateTimeInterface 127 | { 128 | return $this->editedon; 129 | } 130 | 131 | public function setEditedon(?\DateTimeInterface $editedon): self 132 | { 133 | $this->editedon = $editedon; 134 | 135 | return $this; 136 | } 137 | 138 | 139 | } 140 | -------------------------------------------------------------------------------- /src/Entity/ModxUserMessages.php: -------------------------------------------------------------------------------- 1 | id; 83 | } 84 | 85 | public function getType(): ?string 86 | { 87 | return $this->type; 88 | } 89 | 90 | public function setType(string $type): self 91 | { 92 | $this->type = $type; 93 | 94 | return $this; 95 | } 96 | 97 | public function getSubject(): ?string 98 | { 99 | return $this->subject; 100 | } 101 | 102 | public function setSubject(string $subject): self 103 | { 104 | $this->subject = $subject; 105 | 106 | return $this; 107 | } 108 | 109 | public function getMessage(): ?string 110 | { 111 | return $this->message; 112 | } 113 | 114 | public function setMessage(string $message): self 115 | { 116 | $this->message = $message; 117 | 118 | return $this; 119 | } 120 | 121 | public function getSender(): ?int 122 | { 123 | return $this->sender; 124 | } 125 | 126 | public function setSender(int $sender): self 127 | { 128 | $this->sender = $sender; 129 | 130 | return $this; 131 | } 132 | 133 | public function getRecipient(): ?int 134 | { 135 | return $this->recipient; 136 | } 137 | 138 | public function setRecipient(int $recipient): self 139 | { 140 | $this->recipient = $recipient; 141 | 142 | return $this; 143 | } 144 | 145 | public function getPrivate(): ?bool 146 | { 147 | return $this->private; 148 | } 149 | 150 | public function setPrivate(bool $private): self 151 | { 152 | $this->private = $private; 153 | 154 | return $this; 155 | } 156 | 157 | public function getDateSent(): ?\DateTimeInterface 158 | { 159 | return $this->dateSent; 160 | } 161 | 162 | public function setDateSent(?\DateTimeInterface $dateSent): self 163 | { 164 | $this->dateSent = $dateSent; 165 | 166 | return $this; 167 | } 168 | 169 | public function getRead(): ?bool 170 | { 171 | return $this->read; 172 | } 173 | 174 | public function setRead(bool $read): self 175 | { 176 | $this->read = $read; 177 | 178 | return $this; 179 | } 180 | 181 | 182 | } 183 | -------------------------------------------------------------------------------- /src/Entity/ModxUserSettings.php: -------------------------------------------------------------------------------- 1 | user; 71 | } 72 | 73 | public function getKey(): ?string 74 | { 75 | return $this->key; 76 | } 77 | 78 | public function getValue(): ?string 79 | { 80 | return $this->value; 81 | } 82 | 83 | public function setValue(?string $value): self 84 | { 85 | $this->value = $value; 86 | 87 | return $this; 88 | } 89 | 90 | public function getXtype(): ?string 91 | { 92 | return $this->xtype; 93 | } 94 | 95 | public function setXtype(string $xtype): self 96 | { 97 | $this->xtype = $xtype; 98 | 99 | return $this; 100 | } 101 | 102 | public function getNamespace(): ?string 103 | { 104 | return $this->namespace; 105 | } 106 | 107 | public function setNamespace(string $namespace): self 108 | { 109 | $this->namespace = $namespace; 110 | 111 | return $this; 112 | } 113 | 114 | public function getArea(): ?string 115 | { 116 | return $this->area; 117 | } 118 | 119 | public function setArea(string $area): self 120 | { 121 | $this->area = $area; 122 | 123 | return $this; 124 | } 125 | 126 | public function getEditedon(): ?\DateTimeInterface 127 | { 128 | return $this->editedon; 129 | } 130 | 131 | public function setEditedon(?\DateTimeInterface $editedon): self 132 | { 133 | $this->editedon = $editedon; 134 | 135 | return $this; 136 | } 137 | 138 | 139 | } 140 | -------------------------------------------------------------------------------- /src/Entity/ModxWorkspaces.php: -------------------------------------------------------------------------------- 1 | id; 62 | } 63 | 64 | public function getName(): ?string 65 | { 66 | return $this->name; 67 | } 68 | 69 | public function setName(string $name): self 70 | { 71 | $this->name = $name; 72 | 73 | return $this; 74 | } 75 | 76 | public function getPath(): ?string 77 | { 78 | return $this->path; 79 | } 80 | 81 | public function setPath(string $path): self 82 | { 83 | $this->path = $path; 84 | 85 | return $this; 86 | } 87 | 88 | public function getCreated(): ?\DateTimeInterface 89 | { 90 | return $this->created; 91 | } 92 | 93 | public function setCreated(\DateTimeInterface $created): self 94 | { 95 | $this->created = $created; 96 | 97 | return $this; 98 | } 99 | 100 | public function getActive(): ?bool 101 | { 102 | return $this->active; 103 | } 104 | 105 | public function setActive(bool $active): self 106 | { 107 | $this->active = $active; 108 | 109 | return $this; 110 | } 111 | 112 | public function getAttributes(): ?string 113 | { 114 | return $this->attributes; 115 | } 116 | 117 | public function setAttributes(?string $attributes): self 118 | { 119 | $this->attributes = $attributes; 120 | 121 | return $this; 122 | } 123 | 124 | 125 | } 126 | -------------------------------------------------------------------------------- /src/Entity/User.php: -------------------------------------------------------------------------------- 1 | id; 48 | } 49 | 50 | public function getEmail(): ?string 51 | { 52 | return $this->email; 53 | } 54 | 55 | public function setEmail(string $email): self 56 | { 57 | $this->email = $email; 58 | 59 | return $this; 60 | } 61 | 62 | /** 63 | * A visual identifier that represents this user. 64 | * 65 | * @see UserInterface 66 | */ 67 | public function getUsername(): string 68 | { 69 | return (string) $this->email; 70 | } 71 | 72 | /** 73 | * @see UserInterface 74 | */ 75 | public function getRoles(): array 76 | { 77 | $roles = $this->roles; 78 | // guarantee every user at least has ROLE_USER 79 | $roles[] = 'ROLE_USER'; 80 | 81 | return array_unique($roles); 82 | } 83 | 84 | public function setRoles(array $roles): self 85 | { 86 | $this->roles = $roles; 87 | 88 | return $this; 89 | } 90 | 91 | /** 92 | * @see UserInterface 93 | */ 94 | public function getPassword(): string 95 | { 96 | return (string) $this->password; 97 | } 98 | 99 | public function setPassword(string $password): self 100 | { 101 | $this->password = $password; 102 | 103 | return $this; 104 | } 105 | 106 | /** 107 | * @see UserInterface 108 | */ 109 | public function getSalt() 110 | { 111 | // not needed when using the "bcrypt" algorithm in security.yaml 112 | } 113 | 114 | /** 115 | * @see UserInterface 116 | */ 117 | public function eraseCredentials() 118 | { 119 | // If you store any temporary, sensitive data on the user, clear it here 120 | // $this->plainPassword = null; 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /src/Form/Type/LoginType.php: -------------------------------------------------------------------------------- 1 | authenticationUtils = $authenticationUtils; 28 | } 29 | 30 | /** 31 | * {@inheritdoc} 32 | */ 33 | public function buildForm(FormBuilderInterface $builder, array $options) 34 | { 35 | $builder 36 | ->add('email', TextType::class, ['label' => 'Email']) 37 | ->add('password', PasswordType::class, ['trim' => true]) 38 | ->add('_remember_me', CheckboxType::class, [ 39 | 'label_attr' => ['class' => 'switch-custom'], 40 | 'required' => false 41 | ]) 42 | ->add('_target_path', HiddenType::class) 43 | ->add('button-submit', SubmitType::class, ['label' => 'Log In']); 44 | 45 | $authUtils = $this->authenticationUtils; 46 | $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($authUtils) { 47 | $error = $authUtils->getLastAuthenticationError(); 48 | if ($error) { 49 | $event->getForm()->addError(new FormError($error->getMessage())); 50 | } 51 | $event->setData(array_replace((array) $event->getData(), array( 52 | 'email' => $authUtils->getLastUsername(), 53 | ))); 54 | }); 55 | } 56 | 57 | /** 58 | * {@inheritdoc} 59 | */ 60 | public function configureOptions(OptionsResolver $resolver) 61 | { 62 | $resolver->setDefaults(array( 63 | 'csrf_protection' => true, 64 | 'csrf_field_name' => '_csrf_token', 65 | 'csrf_token_id' => 'authenticate' 66 | )); 67 | } 68 | 69 | public function getBlockPrefix() 70 | { 71 | return ''; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/Form/Type/UpdateProfileType.php: -------------------------------------------------------------------------------- 1 | add('email', EmailType::class) 19 | ->add('password', RepeatedType::class, [ 20 | 'first_name' => 'password', 21 | 'second_name' => 'confirm', 22 | 'type' => PasswordType::class, 23 | 'first_options' => [ 24 | 'label' => 'New password' 25 | ], 26 | 'second_options' => [ 27 | 'label' => 'Confirm password' 28 | ], 29 | 'required' => false, 30 | 'constraints' => new Length(['min' => 6]) 31 | ]) 32 | ->add('button-submit', SubmitType::class, ['label' => 'Submit']); 33 | } 34 | } -------------------------------------------------------------------------------- /src/Kernel.php: -------------------------------------------------------------------------------- 1 | getProjectDir().'/config/bundles.php'; 21 | foreach ($contents as $class => $envs) { 22 | if ($envs[$this->environment] ?? $envs['all'] ?? false) { 23 | yield new $class(); 24 | } 25 | } 26 | } 27 | 28 | public function getProjectDir(): string 29 | { 30 | return \dirname(__DIR__); 31 | } 32 | 33 | protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void 34 | { 35 | $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php')); 36 | $container->setParameter('container.dumper.inline_class_loader', \PHP_VERSION_ID < 70400 || !ini_get('opcache.preload')); 37 | $container->setParameter('container.dumper.inline_factories', true); 38 | $confDir = $this->getProjectDir().'/config'; 39 | 40 | $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob'); 41 | $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob'); 42 | $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob'); 43 | $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob'); 44 | } 45 | 46 | protected function configureRoutes(RouteCollectionBuilder $routes): void 47 | { 48 | $confDir = $this->getProjectDir().'/config'; 49 | 50 | $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob'); 51 | $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob'); 52 | $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob'); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/Migrations/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andchir/modx2-api/ed4a903172856bbd6e426d5727581bc87758ea68/src/Migrations/.gitignore -------------------------------------------------------------------------------- /src/Repository/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andchir/modx2-api/ed4a903172856bbd6e426d5727581bc87758ea68/src/Repository/.gitignore -------------------------------------------------------------------------------- /src/Repository/UserRepository.php: -------------------------------------------------------------------------------- 1 | setPassword($newEncodedPassword); 35 | $this->_em->persist($user); 36 | $this->_em->flush(); 37 | } 38 | 39 | // /** 40 | // * @return User[] Returns an array of User objects 41 | // */ 42 | /* 43 | public function findByExampleField($value) 44 | { 45 | return $this->createQueryBuilder('u') 46 | ->andWhere('u.exampleField = :val') 47 | ->setParameter('val', $value) 48 | ->orderBy('u.id', 'ASC') 49 | ->setMaxResults(10) 50 | ->getQuery() 51 | ->getResult() 52 | ; 53 | } 54 | */ 55 | 56 | /* 57 | public function findOneBySomeField($value): ?User 58 | { 59 | return $this->createQueryBuilder('u') 60 | ->andWhere('u.exampleField = :val') 61 | ->setParameter('val', $value) 62 | ->getQuery() 63 | ->getOneOrNullResult() 64 | ; 65 | } 66 | */ 67 | } 68 | -------------------------------------------------------------------------------- /src/Security/LoginFormAuthenticator.php: -------------------------------------------------------------------------------- 1 | entityManager = $entityManager; 35 | $this->urlGenerator = $urlGenerator; 36 | $this->csrfTokenManager = $csrfTokenManager; 37 | $this->passwordEncoder = $passwordEncoder; 38 | } 39 | 40 | public function supports(Request $request) 41 | { 42 | return 'app_login' === $request->attributes->get('_route') 43 | && $request->isMethod('POST'); 44 | } 45 | 46 | public function getCredentials(Request $request) 47 | { 48 | $credentials = [ 49 | 'email' => $request->request->get('email'), 50 | 'password' => $request->request->get('password'), 51 | 'csrf_token' => $request->request->get('_csrf_token'), 52 | ]; 53 | $request->getSession()->set( 54 | Security::LAST_USERNAME, 55 | $credentials['email'] 56 | ); 57 | 58 | return $credentials; 59 | } 60 | 61 | public function getUser($credentials, UserProviderInterface $userProvider) 62 | { 63 | $token = new CsrfToken('authenticate', $credentials['csrf_token']); 64 | if (!$this->csrfTokenManager->isTokenValid($token)) { 65 | throw new InvalidCsrfTokenException(); 66 | } 67 | 68 | $user = $this->entityManager->getRepository(User::class)->findOneBy(['email' => $credentials['email']]); 69 | 70 | if (!$user) { 71 | // fail authentication with a custom error 72 | throw new CustomUserMessageAuthenticationException('Email could not be found.'); 73 | } 74 | 75 | return $user; 76 | } 77 | 78 | public function checkCredentials($credentials, UserInterface $user) 79 | { 80 | return $this->passwordEncoder->isPasswordValid($user, $credentials['password']); 81 | } 82 | 83 | /** 84 | * Used to upgrade (rehash) the user's password automatically over time. 85 | */ 86 | public function getPassword($credentials): ?string 87 | { 88 | return $credentials['password']; 89 | } 90 | 91 | public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey) 92 | { 93 | if ($targetPath = $this->getTargetPath($request->getSession(), $providerKey)) { 94 | return new RedirectResponse($targetPath); 95 | } 96 | 97 | return new RedirectResponse($this->urlGenerator->generate('api_entrypoint')); 98 | } 99 | 100 | protected function getLoginUrl() 101 | { 102 | return $this->urlGenerator->generate('app_login'); 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /templates/base.html.twig: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {% block title %}{{ app_name }}{% endblock %} 8 | 9 | 12 | 13 | {% block stylesheets %}{% endblock %} 14 | 15 | 16 | {% block body %}{% endblock %} 17 | {% block javascripts %}{% endblock %} 18 | 19 | 20 | -------------------------------------------------------------------------------- /templates/homepage.twig: -------------------------------------------------------------------------------- 1 | {% extends 'base.html.twig' %} 2 | 3 | {% block body %} 4 | 5 |
6 | 7 |
8 |
9 | 10 |

{{ app_name }}

11 |
12 | 13 | {% if is_granted('ROLE_USER') %} 14 | 25 | {% else %} 26 | 27 |
28 |
29 | 30 | {{ form(form, {'action': path('app_login'), 'method': 'POST'}) }} 31 | 32 |
33 |
34 | 35 | {% endif %} 36 | 37 |
38 |
39 | 40 |
41 | 42 | {% endblock %} -------------------------------------------------------------------------------- /templates/security/login.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'base.html.twig' %} 2 | 3 | {% block title %}Log in!{% endblock %} 4 | 5 | {% block body %} 6 | 7 |
8 | 9 |
10 |
11 | 12 |
13 |
14 | 15 |

{{ app_name }}

16 |
17 | 18 | {% for message in app.flashes('notice') %} 19 |
20 | {{ message }} 21 |
22 | {% endfor %} 23 | {% for message in app.flashes('error') %} 24 |
25 | {{ message }} 26 |
27 | {% endfor %} 28 | 29 | {{ form(form) }} 30 | 31 |
32 | Home page 33 | 34 |
35 |
36 | 37 |
38 |
39 | 40 |
41 | 42 | {% endblock %} 43 | -------------------------------------------------------------------------------- /templates/security/profile.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'base.html.twig' %} 2 | 3 | {% block title %}Log in!{% endblock %} 4 | 5 | {% block body %} 6 | 7 |
8 | 9 |
10 |
11 | 12 |
13 |
14 | 15 |

{{ app_name }}

16 |
17 |

Edit Profile

18 | 19 | {% for message in app.flashes('notice') %} 20 |
21 | {{ message }} 22 |
23 | {% endfor %} 24 | {% for message in app.flashes('error') %} 25 |
26 | {{ message }} 27 |
28 | {% endfor %} 29 | 30 | {{ form(form) }} 31 | 32 |
33 | Home page 34 | 35 |
36 |
37 | 38 |
39 |
40 | 41 |
42 | 43 | {% endblock %} 44 | --------------------------------------------------------------------------------