How to Manipulate Families


The Akeneo PIM project introduces services to help you manage your catalog entities.

As stated above, the family factory and the attribute requirement factory are some of the services that you can get from the Symfony container:

// family factory

// family manager

// attribute requirement factory

In the following examples, we will use $ff as the family factory service and $arf as the attribute requirements factory.

Create a family

// create a family
$family = $ff->createFamily();
  • Add some requirements to this family


For this example, we will assume that we already have some attributes (to learn more about attribute creation, you can read the How to Manipulate Attributes cookbook) and some channels

// Set the attribute color required for the channel ecommerce
  • And don’t forget to save everything to the database
// save the family in database