public function validate() { if (!$this->isInDB()) { if (StreakRegionalShipping_ShippableRegion::get()->filter(array('ShippableID' => $this->ShippableID, 'RegionID' => $this->RegionID))->count()) { throw new ValidationException("That region is already set for the Product"); } } if (!$this->Price) { throw new ValidationException("Please enter a Price"); } return parent::validate(); }
public function provideGridSheetData($modelClass, $isRelatedModel) { if (self::ModelClass == $modelClass && !$isRelatedModel) { return StreakRegionalShipping_ShippableRegion::get(); } }