Skip to content

Commit

Permalink
Fix some PHPCS errors related to line length
Browse files Browse the repository at this point in the history
  • Loading branch information
Filips Alpe committed Jul 5, 2013
1 parent 55110d6 commit 8ef670e
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions src/Pim/Bundle/ProductBundle/Form/Type/ProductType.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,30 +69,33 @@ public function finishView(FormView $view, FormInterface $form, array $options)

$valueForms = $form->get('values')->getChildren();
foreach ($valueForms as $valueForm) {
$value = $valueForm->getData();
$attribute = $value->getAttribute();
$attributeGroup = $attribute->getVirtualGroup();

if (!isset($groups[$attributeGroup->getId()])) {
$groups[$attributeGroup->getId()]['name'] = $attributeGroup->getName();
$value = $valueForm->getData();
$attribute = $value->getAttribute();
$attrId = $attribute->getId();
$group = $attribute->getVirtualGroup();
$groupId = $group->getId();

if (!isset($groups[$groupId])) {
$groups[$groupId]['name'] = $group->getName();
}

if (!isset($groups[$attributeGroup->getId()]['values'][$attribute->getId()])) {
$groups[$attributeGroup->getId()]['attributes'][$attribute->getId()]['isRemovable'] = $value->isRemovable();
$groups[$attributeGroup->getId()]['attributes'][$attribute->getId()]['code'] = $attribute->getCode();
$groups[$attributeGroup->getId()]['attributes'][$attribute->getId()]['label'] = $attribute->getLabel();
$groups[$attributeGroup->getId()]['attributes'][$attribute->getId()]['sortOrder'] = $attribute->getSortOrder();
if (!isset($groups[$groupId]['values'][$attrId])) {
$groups[$groupId]['attributes'][$attrId]['isRemovable'] = $value->isRemovable();
$groups[$groupId]['attributes'][$attrId]['code'] = $attribute->getCode();
$groups[$groupId]['attributes'][$attrId]['label'] = $attribute->getLabel();
$groups[$groupId]['attributes'][$attrId]['sortOrder'] = $attribute->getSortOrder();
}

$formView = $valueForm->createView($view->getChild('values'));
if ($value->getAttribute()->getScopable()) {
$groups[$attributeGroup->getId()]['attributes'][$attribute->getId()]['classes']['scopable'] = true;
$groups[$attributeGroup->getId()]['attributes'][$attribute->getId()]['values'][$value->getScope()] = $valueForm->createView($view->getChild('values'));
$groups[$groupId]['attributes'][$attrId]['classes']['scopable'] = true;
$groups[$groupId]['attributes'][$attrId]['values'][$value->getScope()] = $formView;
} else {
$groups[$attributeGroup->getId()]['attributes'][$attribute->getId()]['value'] = $valueForm->createView($view->getChild('values'));
$groups[$groupId]['attributes'][$attrId]['value'] = $formView;
}

if ('pim_product_price_collection' === $attribute->getAttributeType()) {
$groups[$attributeGroup->getId()]['attributes'][$attribute->getId()]['classes']['currency'] = true;
$groups[$groupId]['attributes'][$attrId]['classes']['currency'] = true;
}
}

Expand Down

0 comments on commit 8ef670e

Please sign in to comment.