sample = $sample; $this->enabled = $enabled; } /** * Tells whether the sample cars for Packeta CD are enabled, or not. * * @return bool */ public function isSampleEnabled(): bool { return $this->sample; } /** * Tells whether the car delivery is disabled, or otherwise. * * @return bool */ public function isDisabled(): bool { return ! $this->enabled; } /** * Checks if carrier is car delivery carrier. * * @param string $carrierId Carrier ID. * * @return bool */ public function isCarDeliveryCarrier( string $carrierId ): bool { return in_array( $carrierId, Carrier::CAR_DELIVERY_CARRIERS, true ); } /** * Checks if car delivery is disabled. * * @param string $carrierId Carrier ID. * * @return bool */ public function isCarDeliveryCarrierDisabled( string $carrierId ): bool { return $this->isCarDeliveryCarrier( $carrierId ) && $this->isDisabled(); } }