コード例 #1
0
 protected function performValidation()
 {
     if (is_null($this->product)) {
         return $this->fail();
     }
     if (!$this->checkProductHasNoActiveAttributeGroupsWhenInputHasNone()) {
         return $this->fail();
     }
     // TODO rewrite to use repository
     $this->productActiveAttributeGroups = $this->product->activeAttributeGroups()->with('attributeOption')->get()->keyBy('id');
     if (!$this->checkProductHasSameActiveAttributeGroupIdsAsInput() or !$this->checkEachOptionBelongsToCorrectAttributeGroupGroup()) {
         return $this->fail();
     }
     return $this->pass();
 }