/** * Check - switch entity or not * * @param \XLite\Model\AEntity $entity Entity * * @return boolean */ protected function isAllowEntitySwitch(\XLite\Model\AEntity $entity) { // Custom state is not allowed to switch off return parent::isAllowEntitySwitch($entity) && 'custom_state' !== $entity->getServiceName(); }
/** * Check - switch entity or not * * @param \XLite\Model\AEntity $entity Entity * * @return boolean */ protected function isAllowEntitySwitch(\XLite\Model\AEntity $entity) { /** @var \XLite\Model\Shipping\Method $entity */ return parent::isAllowEntitySwitch($entity) && (null === $entity->getProcessorObject() || $entity->getProcessorObject()->isConfigured()); }