/** * {@inheritDoc} */ public function load(ObjectManager $manager) { if (!$this->isEnabled()) { return; } foreach (self::$samples as $name) { $status = new ProductStatus(); $status->translate($this->getDefaultLocale())->setName($name); $status->translate($this->getDefaultLocale())->setSlug($slug = Sluggable::makeSlug($name)); $status->translate($this->getDefaultLocale())->setCssClass($slug); $status->mergeNewTranslations(); $manager->persist($status); $this->addReference('product_status_' . $name, $status); } $manager->flush(); }
public function create() : ProductStatusInterface { $status = new ProductStatus(); $status->setSymbol(''); return $status; }