sf4/api-user

v1.4.5 2019-04-08 18:40 UTC

README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Structure

If any of the following are applicable to your project, then the directory structure should follow industry best practices by being named the following.

bin/        
config/
src/
tests/
vendor/

Install

Via Composer

$ composer require sf4/api-user

Usage

config/packages/doctrine.yaml

doctrine:
    # ...
    orm:
        # ...
        mappings:
            # ...
            Sf4\ApiUser:
                is_bundle: false
                type: annotation
                dir: '%kernel.project_dir%/vendor/sf4/api-user/src/Entity'
                prefix: 'Sf4\ApiUser\Entity'
                alias: Sf4\ApiUser

config/routes.yaml

# ...
api_user:
    resource: '../vendor/sf4/api-user/src/Routes/api-user.yaml'
    prefix: /user

config/services.yaml

services:
    # ...
    
    Sf4\Api\Repository\RepositoryFactory:
        class: Sf4\Api\Repository\RepositoryFactory
        arguments:
            $entityManager: '@Doctrine\ORM\EntityManagerInterface'
            $entities:
                user: Sf4\ApiUser\Entity\User
                user_detail: Sf4\ApiUser\Entity\UserDetail

    # ...
    Sf4\Api\RequestHandler\RequestHandlerInterface:
        # ...
        -   method: setAvailableRoutes
            arguments:
                -   api_default: 'Sf4\Api\Request\DefaultRequest'
                    # ...
                    api_user_list: 'Sf4\ApiUser\Request\ListRequest'
                    api_user_detail: 'Sf4\ApiUser\Request\DetailRequest'
                    api_user_save_detail: 'Sf4\ApiUser\Request\SaveDetailRequest'

config/packages/translation.yaml

framework:
    # ...
    translator:
        # ...
        paths:
            # ...
            - '%kernel.project_dir%/vendor/sf4/api-user/src/translations'

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email siim.liimand@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.