Download the PHP package check24/apitk-manipulation-bundle without Composer

On this page you can find all versions of the php package check24/apitk-manipulation-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package apitk-manipulation-bundle

apitk-manipulation-bundle

API Toolkit Bundle to handle POST, PUT, PATCH and DELETE methods.

Installation

Install the package via composer:

Usage

Example Classes

See the example-Folder in this repository: https://github.com/alexdo/apitk-manipulation-bundle/tree/master/example

User entity
User FormType
Controller

Updating Entities (POST, PUT, PATCH)

Updating entites works by mapping request data to a form, validating it and then persisting the form's data to the Database via Doctrine.

You'll need:

This will also auto-generate appropriate Swagger parameters. Usage of FOSRest bundle is optional. Controller methods look the same for POST and PUT.

The $user parameter is an already updated version of the requested User. You can do anything you want with it: Serialization, JSON encode, etc.

Internally, the Update annotation fetches the default EntityManager, gets the Repository and executes find($id) on it. You can customize this in three ways:

  1. If you'd like to use a different ORM connection than default, supply it via entityManager:

    This will cause the annotation to fetch the repository and entity from the "custom" EntityManager.

  2. If you'd like to use a different Repository method than find, use the methodName option:

  3. If your path component is something different than id, eg. email, you can supply the parameter to use via the requestParam option:

Removing Entities (DELETE)

To remove an entity, add an action to your controller that uses the Delete-Annotation.

@Manipulation\Delete("id", entity=User::class)

The $response parameter is a HTTP 204-Response (No Content). You can just return it, or ignore it and build one of your own.

Delete will, by default, perform a hard delete by executing find($id) on UserRepository and then removing the Entity via ObjectManager::remove.

As with Update, you can customize this behaviour:

  1. If you'd like to perform a soft delete or other things instead, use the methodName option:

    This will cause the Annotation to call DeleteRepository::deleteById(DeletionService $deletionService). The DeletionService allows you to access all request parameters. Perform anything you want to mark your Entity as deleted, eg. setting a deleted-Property from 0 to 1 and then flushing the EntityManager.

  2. If you'd like to use a different ORM connection than default, supply it via entityManager:

    This will cause the annotation to operate against the "custom" EntityManager.


All versions of apitk-manipulation-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
check24/apitk-common-bundle Version ^2.2.0
doctrine/doctrine-bundle Version ^2.2
doctrine/orm Version ^2.5
doctrine/persistence Version ^2
nelmio/api-doc-bundle Version ^3.2
sensio/framework-extra-bundle Version ^5.2
symfony/config Version >= 5.3 <6.0
symfony/dependency-injection Version >= 5.3 <6.0
symfony/form Version >= 5.3 <6.0
symfony/framework-bundle Version >= 5.3 <6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package check24/apitk-manipulation-bundle contains the following files

Loading the files please wait ....