manufacturer_product_url) { return $this->manufacturer_product_url; } if (null !== $this->getManufacturer()) { return $this->getManufacturer()->getAutoProductUrl($this->name); } return ''; // no url is available } /** * Similar to getManufacturerProductUrl, but here only the database value is returned. * @return string The manufacturer url saved in DB for this part. */ public function getCustomProductURL(): string { return $this->manufacturer_product_url; } /** * Returns the manufacturing/production status for this part. * The status can be one of the following: * (Similar to https://designspark.zendesk.com/hc/en-us/articles/213584805-What-are-the-Lifecycle-Status-definitions-) * * "": Status unknown * * "announced": Part has been announced, but is not in production yet * * "active": Part is in production and will be for the forseeable future * * "nrfnd": Not recommended for new designs. * * "eol": Part will become discontinued soon * * "discontinued": Part is obsolete/discontinued by the manufacturer * @return string */ public function getManufacturingStatus(): ?string { return $this->manufacturing_status; } /** * Sets the manufacturing status for this part * See getManufacturingStatus() for valid values. * @param string $manufacturing_status * @return Part */ public function setManufacturingStatus(string $manufacturing_status): self { $this->manufacturing_status = $manufacturing_status; return $this; } /** * Get the manufacturer of this part (if there is one). * * @return Manufacturer the manufacturer of this part (if there is one) */ public function getManufacturer(): ?Manufacturer { return $this->manufacturer; } /** * Returns the assigned manufacturer product number (MPN) for this part. * @return string */ public function getManufacturerProductNumber(): string { return $this->manufacturer_product_number; } /** * Sets the manufacturer product number (MPN) for this part. * @param string $manufacturer_product_number * @return Part */ public function setManufacturerProductNumber(string $manufacturer_product_number): self { $this->manufacturer_product_number = $manufacturer_product_number; return $this; } /** * Sets the URL to the manufacturer site about this Part. * Set to "" if this part should use the automatically URL based on its manufacturer. * @param string $new_url The new url * @return self */ public function setManufacturerProductURL(string $new_url): self { $this->manufacturer_product_url = $new_url; return $this; } /** * Sets the new manufacturer of this part. * * @param Manufacturer|null $new_manufacturer The new Manufacturer of this part. Set to null, if this part should * not have a manufacturer. * * @return self */ public function setManufacturer(?Manufacturer $new_manufacturer): self { $this->manufacturer = $new_manufacturer; return $this; } }