2017 © Pedro Peláez
 

library commercetools-custom-types-bundle

Bundle to help you with the creation of custom types.

image

bestit/commercetools-custom-types-bundle

Bundle to help you with the creation of custom types.

  • Wednesday, September 13, 2017
  • by WBLKonzept
  • Repository
  • 2 Watchers
  • 0 Stars
  • 8,317 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 12 Versions
  • 6 % Grown

The README.md

commercetools-custom-types-bundle

Bundle to help you with the creation of custom types. It provides you with a symfony config param matching your custom type structure, which then is mirrored to your commercetools project., (*1)

Installation

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:, (*2)

$ composer require bestit/commercetools-custom-types-bundle

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation., (*3)

Step 2: Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in the app/AppKernel.php file of your project:, (*4)

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...

            new BestIt\CTCustomTypesBundle\BestItCTCustomTypesBundle(),
        );

        // ...
    }

    // ...
}

Step 3: Configure

# Default configuration for extension with alias: "best_it_ct_custom_types"
best_it_ct_custom_types:

    # Add the types mainly documented under: <https://dev.commercetools.com/http-api-projects-types.html>
    types:

        # Prototype
        key:
            name:                 # Required

                # Prototype
                lang:                 ~
            description:          # Required

                # Prototype
                lang:                 ~

            # https://dev.commercetools.com/http-api-projects-custom-fields.html#customizable-resources
            resourceTypeIds:      [] # Required

            # http://dev.commercetools.com/http-api-projects-types.html#fielddefinition
            fieldDefinitions:     # Required

                # Prototype
                name:
                    type:                 # Required
                        name:                 ~ # One of "Boolean"; "String"; "LocalizedString"; "Enum"; "Number"; "Money"; "Date"; "T
ime"; "DateTime"; "Set", Required

                        # Specially used to the set type: <http://dev.commercetools.com/http-api-projects-types.html#settype>
                        elementType:
                            name:                 ~ # One of "Boolean"; "String"; "LocalizedString"; "Enum"; "Number"; "Money"; "Date"
; "Time"; "DateTime"; "Set", Required
                            values:

                                # Prototype
                                key:                  ~
                        values:

                            # Prototype
                            key:                  ~
                    required:             false # Required
                    inputHint:            ~ # One of "MultiLine"; "SingleLine", Required
                    label:                # Required

                        # Prototype
                        lang:                 ~

    # The shell command works on the complete set of types normally. To prevent side effects while changing or deleting types which ar
e "unknown at this moment" define a whitelist for types, on which you are allowed to work on.
    whitelist:            []
    commercetools_client_service: ~ # Required

Usage

The following symfony command mirrors your types config to the commercetools database:, (*5)

$ php bin/console commercetools:process-custom-types [<whitelist>]

It tries to delete every custom type, which is not declared in your config or excluded by the whitelist (config or pcre regex without delimiter)., (*6)

Further Todos

  • Add unittests
  • Refactor the command
  • better Support for complex tyes

The Versions

13/09 2017

dev-master

9999999-dev

Bundle to help you with the creation of custom types.

  Sources   Download

MIT

The Requires

 

The Development Requires

13/09 2017
31/08 2017
16/03 2017
22/01 2017

0.5.0

0.5.0.0

Bundle to help you with the creation of custom types.

  Sources   Download

MIT

The Requires

 

The Development Requires

07/01 2017

0.2.2

0.2.2.0

Bundle to help you with the creation of custom types.

  Sources   Download

MIT

The Requires

 

The Development Requires

06/01 2017

0.3.0

0.3.0.0

Bundle to help you with the creation of custom types.

  Sources   Download

MIT

The Requires

 

The Development Requires

06/01 2017

0.4.0

0.4.0.0

Bundle to help you with the creation of custom types.

  Sources   Download

MIT

The Requires

 

The Development Requires

06/01 2017

0.2.1

0.2.1.0

Bundle to help you with the creation of custom types.

  Sources   Download

MIT

The Requires

 

The Development Requires

06/01 2017

0.2.0

0.2.0.0

Bundle to help you with the creation of custom types.

  Sources   Download

MIT

The Requires

 

The Development Requires

06/01 2017

0.1.1

0.1.1.0

Bundle to help you with the creation of custom types.

  Sources   Download

MIT

The Requires

 

The Development Requires

06/01 2017

0.1.0

0.1.0.0

Bundle to help you with the creation of custom types.

  Sources   Download

MIT

The Requires

 

The Development Requires