/** * Test getter/setter for sort order property */ public function testSortOrder() { $this->assertEmpty($this->group->getSortOrder()); // Change value and assert new $newOrder = 5; $this->assertEntity($this->group->setSortOrder($newOrder)); $this->assertEquals($newOrder, $this->group->getSortOrder()); }
/** * {@inheritdoc} * @return AttributeGroupInterface */ protected function createEntity(array $data) { $group = new AttributeGroup(); $group->setCode($data['code']); foreach ($this->getLabels($data) as $locale => $label) { $translation = $group->getTranslation($locale); $translation->setLabel($label); $group->addTranslation($translation); } $group->setSortOrder($data['sortOrder']); foreach ($this->getAttributes($data) as $attribute) { $group->addAttribute($attribute); } return $group; }
/** * {@inheritDoc} */ public function setSortOrder($sortOrder) { $this->__initializer__ && $this->__initializer__->__invoke($this, 'setSortOrder', array($sortOrder)); return parent::setSortOrder($sortOrder); }