Skip to content

Instantly share code, notes, and snippets.

@grena
Last active June 15, 2016 10:02
Show Gist options
  • Save grena/07a410e881791afe5a40aa0021f1b06c to your computer and use it in GitHub Desktop.
Save grena/07a410e881791afe5a40aa0021f1b06c to your computer and use it in GitHub Desktop.
Structured formats for PIM entities

AssociationType

Standard

[
	'code'   => 'mycode',
	'labels' => [
	   'fr_FR' => 'XSELL',
	   'en_US' => 'Vente croisée',
	]
]

Flat

[
	'code'        => 'mycode',
	'label-fr_FR' => 'XSELL',
	'label-en_US' => 'Vente croisée',
]

Attribute

Standard

[
	'labels' => [
	   'fr_FR' => 'Description',
	   'en_US' => 'Description',
	]
	'attributeType' => 'pim_catalog_text',
	'number_min' => 23.5,
	'number_max' => 29.9,
	'max_file_size' => 3500,
	'sort_order' => 5,
	'max_characters' => 8000,
	'minimum_input_length' => null,
	'options' => [
		'blue',
		'red',
		'yellow',
	]
	'available_locales' => [],
	'date_min' => null,
	'date_max' => '2013-02-22',
	'reference_data_name' => null,
	'localizable' => false,
	'useable_as_grid_filter' => false,
	'unique' => false,
	'required' => false,
	'scopable' => false,
	'wysiwyg_enabled' => false,
	'decimals_allowed' => true,
	'negative_allowed' => true,
]

Flat

[
	'label-fr_FR' => 'Description',
	'label-en_US' => 'Description',
	'type' => 'pim_catalog_text',
	'number_min' => '23.5',
	'number_max' => '29.9',
	'max_file_size' => '3500',
	'sort_order' => '5',
	'max_characters' => '8000',
	'minimum_input_length' => '',
	'options' => 'blue,red,yellow',
	'available_locales' => '',
	'date_min' => '',
	'date_max' => '2013-02-22',
	'reference_data_name' => '',
	'localizable' => '0',
	'useable_as_grid_filter' => '0',
	'unique' => '0',
	'required' => '0',
	'scopable' => '0',
	'wysiwyg_enabled' => '0',
	'decimals_allowed' => '1',
	'negative_allowed' => '1',
]

Attribute groups

Standard

[
    'code'       => 'sizes',
    'sort_order' => 1,
    'attributes' => ['size', 'main_color'],
    'label'      => [
        'en_US' => 'Sizes',
        'fr_FR' => 'Tailles'
    ]
]

Flat

[
    'code'        => 'sizes',
    'sort_order'  => '1',
    'attributes'  => 'size,main_color',
    'label-en_US' => 'Sizes',
    'label-fr_FR' => 'Tailles'
]

Attribute option

Standard

[
    'attribute' => 'maximum_print_size',
    'code' => '210_x_1219_mm',
    'sort_order' => 2,
    'labels' => [
        'de_DE' => '210 x 1219 mm',
        'en_US' => '210 x 1219 mm',
        'fr_FR' => '210 x 1219 mm'
    ]
]

Flat

[
    'attribute' => 'maximum_print_size',
    'code' => '210_x_1219_mm',
    'sort_order' => '2',
    'label-de_DE' => '210 x 1219 mm',
    'label-en_US' => '210 x 1219 mm',
    'label-fr_FR' => '210 x 1219 mm'
]

Category

Standard

[
	'code'   => 'mycode',
	'parent' => null,
	'labels' => [
	 'fr_FR' => 'T-shirt super beau',
	 'en_US' => 'T-shirt very beautiful',
	],
]

Flat

[
	'code'        => 'mycode',
	'parent'      => '',
	'label-fr_FR' => 'T-shirt super beau',
	'label-en_US' => 'T-shirt very beautiful',
]

Channel

Standard

[
	'code'   => 'ecommerce',
	'label'  => 'Ecommerce',
	'locales'    => [],
	'currencies' => [
		'EUR', 
		'USD'
	],
	'tree'       => 'master_catalog',
	'color'      => 'orange'
]

Flat

[
	'code'         => 'ecommerce',
	'label'        => 'Ecommerce',
	'locales'      => '',
	'currencies'   => 'EUR,USD',
	'tree'         => 'master_catalog',
	'color'        => 'orange'
]

Currency

Standard

[
	'code'      => 'USD',
	'activated' => true,
]

Flat

[
	'code'      => 'USD',
	'activated' => '1',
]

Family

Standard

[
	'code'                => 'pc_monitors',
	'attributes'          => [
		'sku', 
		'name', 
		'description', 
		'price'
	],
	'attribute_as_label'  => 'name',
	'requirements' => [
		'mobile' => [
			'sku', 
			'name'
		],
		'print'  => [
			'sku', 
			'name', 
			'description'
		],
	],
	'labels' => [
		'fr_FR' => 'Moniteurs',
		'en_US' => 'PC Monitors',
	],
]

Flat

[
	'code'                => 'pc_monitors',
	'label-en_US'         => 'PC Monitors',
	'label-fr_FR'         => 'Moniteurs',
	'attributes'          => 'sku,name,description,price',
	'attribute_as_label'  => 'name',
	'requirements-print'  => 'sku,name,description',
	'requirements-mobile' => 'sku,name',
]

Group

Standard

[
    'code'   => 'mycode',
    'type'   => 'RELATED',
    'labels' => [
        'en_US' => 'EN Label',
        'fr_FR' => 'FR Label',
    ],
]

Flat

[
	'code'        => 'mycode',
	'type'        => 'RELATED',
	'label-en_US' => 'EN Label',
	'label-fr_FR' => 'FR Label',
]

Group type

Standard

[
    'code'        => 'VARIANT',
    'is_variant'  => true,
    'label'       => [
        'en_US' => 'variant',
        'fr_FR' => 'variantes',
    ]
]

Flat

[
    'code'        => 'VARIANT',
    'is_variant'  => '1',
    'label-en_US' => 'variant',
    'label-fr_FR' => 'variantes',
]

Product

Standard

[
    'sku'               => [
        [
            'locale' => null,
            'scope'  => null,
            'data'   => '10699783'
        ]
    ],
    'categories'        => ['audio_video_sales', 'loudspeakers', 'sony'],
    'enabled'           => true,
    'family'            => 'loudspeakers',
    'groups'            => ['sound', 'audio', 'mp3'],
    'variant_group'     => 'speakers',
    'associations'      => [
        'UPSELL' => [
            'groups'   => [],
            'products' => []
        ],
        'X_SELL' => [
            'groups'   => ['akeneo_tshirt', 'oro_tshirt'],
            'products' => ['AKN_TS', 'ORO_TSH']
        ]
    ],
    'super_price'       => [
        [
            'locale' => 'de_DE',
            'scope'  => 'ecommerce',
            'data'   => [
                [
                    'data'     => '10',
                    'currency' => 'EUR'
                ],
                [
                    'data'     => '9',
                    'currency' => 'USD'
                ],
            ]
        ],
        [
            'locale' => 'fr_FR',
            'scope'  => 'ecommerce',
            'data'   => [
                [
                    'data'     => '30',
                    'currency' => 'EUR'
                ],
                [
                    'data'     => '29',
                    'currency' => 'USD'
                ],
            ]
        ]
    ],
    'total_megapixels'  => [
        [
            'locale' => null,
            'scope'  => null,
            'data'   => '50'
        ]
    ],
    'tshirt_materials'  => [
        [
            'locale' => null,
            'scope'  => null,
            'data'   => []
        ]
    ],
    'tshirt_style'      => [
        [
            'locale' => null,
            'scope'  => null,
            'data'   => ['vneck', 'large']
        ]
    ],
    'weight'            => [
        [
            'locale' => 'de_DE',
            'scope'  => 'print',
            'data'   => [
                'unit' => 'MEGAHERTZ',
                'data' => '100'
            ]
        ]
    ],
    'maximum_scan_size' => [
        [
            'locale' => null,
            'scope'  => null,
            'data'   => [
                'unit' => 'MILLIMETER',
                'data' => '50'
            ]
        ]
    ],
    'autolock' => [
        [
            'locale' => null,
            'scope'  => null,
            'data'   => false
        ]
    ]
]

Flat

[
    'sku'                             => '10699783',
    'categories'                      => 'audio_video_sales,loudspeakers,sony',
    'enabled'                         => '1',
    'family'                          => 'loudspeakers',
    'groups'                          => 'sound,audio,mp3,speakers',
    'UPSELL-groups'                   => '',
    'UPSELL-products'                 => '',
    'X_SELL-groups'                   => 'akeneo_tshirt,oro_tshirt',
    'X_SELL-products'                 => 'AKN_TS,ORO_TSH',
    'super_price-de_DE-ecommerce-EUR' => '10',
    'super_price-de_DE-ecommerce-USD' => '9',
    'super_price-fr_FR-ecommerce-EUR' => '30',
    'super_price-fr_FR-ecommerce-USD' => '29',
    'total_megapixels'                => '50',
    'tshirt_materials'                => '',
    'tshirt_style'                    => 'vneck,large',
    'weight-de_DE-print'              => '100',
    'weight-de_DE-print-unit'         => 'MEGAHERTZ',
    'maximum_scan_size'               => '50',
    'maximum_scan_size-unit'          => 'MILLIMETER',
    'autolock' 						  => '0',
]

Product draft

Standard

[
    'sku'   => 'MySku',
    'name'  => [
        'locale' => 'fr_FR',
        'scope'  => null,
        'data'   => 'T-shirt super beau'
    ],
    'description'  => [
        'locale' => 'en_US',
        'scope'  => 'mobile',
        'data'   => 'My description'
    ],
    'length'  => [
        'locale' => null,
        'scope'  => null,
        'data'   => ['data' => 10, 'unit', 'CENTIMETER'],
    ],
]

Flat

[
    'sku'                      => 'MySku',
    'name-en_US'               => 'Ziggy who, Ziggy what',
    'description-en_US-mobile' => 'My description',
    'length'                   => '10',
    'length-unit'              => 'CENTIMETER',
    'enabled' 				   => '1',
    'categories' 			   => 'foo,bar',
]

Tag

Standard

[
	'tags' => [
		'dog',
		'flowers',
		'cities',
		'animal',
		'sunset',
	]
]

Flat

[
	'tags' => 'dog,flowers,cities,animal,sunset',
]

User

Standard

[
    'username'       => 'julia',
    'email'          => 'Julia@example.com',
    'password'       => 'julia',
    'first_name'     => 'Julia',
    'last_name'      => 'Stark',
    'catalog_locale' => 'en_US',
    'user_locale'    => 'en_US',
    'catalog_scope'  => 'ecommerce',
    'default_tree'   => 'men_2013',
    'roles'          => ['ROLE_USER'],
    'groups'         => ['Redactor'],
    'enabled'        => true,
]

Flat

[
    'username'       => 'julia',
    'email'          => 'Julia@example.com',
    'password'       => 'julia',
    'first_name'     => 'Julia',
    'last_name'      => 'Stark',
    'catalog_locale' => 'en_US',
    'user_locale'    => 'en_US',
    'catalog_scope'  => 'ecommerce',
    'default_tree'   => 'men_2013',
    'roles'          => 'ROLE_USER',
    'groups'         => 'Redactor',
    'enabled'        => '1',
]

Variant group

Standard

[
    'code'   => 'swords',
    'labels' => [
        'en_US' => 'Swords',
        'fr_FR' => 'Épées'
    ],
    'axis'   => ['blade_length', 'color'],
    'type'   => 'VARIANT',
    'values' => [
        'blade_length'   => [
            [
                'locale' => null,
                'scope'  => null,
                'data'   => [
                    'data' => '80',
                    'unit' => 'CENTIMETER'
                ]
            ]
        ],
        'blade_material' => [
            [
                'locale' => null,
                'scope'  => null,
                'data'   => ['wood', 'leather']
            ]
        ],
        'description'    => [
            [
                'locale' => 'fr_FR',
                'scope'  => 'ecommerce',
                'data'   => '<p>description</p>',
            ],
            [
                'locale' => 'en_US',
                'scope'  => 'ecommerce',
                'data'   => '<p>description</p>',
            ]
        ]
    ]
]

Flat

[
    'code'                        => 'swords',
    'label-en_US'                 => 'Swords',
    'label-fr_FR'                 => 'Épées',
    'axis'                        => 'blade_length,color',
    'type'                        => 'VARIANT',
    'blade_length'                => '80',
    'blade_length-unit'           => 'CENTIMETER',
    'blade_material'              => 'wood,leather',
    'description-fr_FR-ecommerce' => '<p>description</p>',
    'description-en_US-ecommerce' => '<p>description</p>',
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment