public function addSet($handle, $name, $pkg = null, $locked = null) { $set = new SetEntity(); $set->setAttributeKeyCategory($this->categoryEntity); $set->setAttributeSetHandle($handle); $set->setAttributeSetName($name); if ($pkg) { $set->setPackage($pkg); } if ($locked) { $set->setAttributeSetIsLocked($locked); } $this->entityManager->persist($set); $this->entityManager->flush(); return $set; }