Example #1
0
 /**
  * Order the fields of a panel according to the $ids order.
  *
  * @param array      $ids
  * @param PanelFacet $facet
  */
 public function orderFields(array $ids, PanelFacet $panel)
 {
     $fields = $panel->getFieldsFacet();
     foreach ($fields as $field) {
         foreach ($ids as $key => $id) {
             if ($id === $field->getId()) {
                 $field->setPosition($key);
                 $this->om->persist($field);
             }
         }
     }
     $this->om->flush();
 }