/** * @param string $fileExtension * @param string $basePath * @param int $imageType * @param string $mimeType * @param int $width * @param int $height * @param string|null $uriPrefix */ public function __construct($fileExtension, $basePath, $imageType, $mimeType, $width, $height, $uriPrefix = null) { $this->id = Uuid::uuid4(); $this->baseFileName = $this->id->getHex(); $this->subPath = $this->buildSubPath(); $this->fileExtension = (string) $fileExtension; $this->basePath = (string) $basePath; $this->imageType = (int) $imageType; $this->mimeType = (string) $mimeType; $this->width = (int) $width; $this->height = (int) $height; if ($uriPrefix !== null) { $this->uriPrefix = (string) $uriPrefix; } }
/** * @param UuidInterface $orderItemId * @param int $quantity */ public function addOrderItemQty(UuidInterface $orderItemId, $quantity) { if ($quantity > 0) { $this->items[$orderItemId->getHex()] = (int) $quantity; } }
/** * @param UuidInterface $id * @return string binary bytes */ private function getBytesFromId(UuidInterface $id) { return $id->getBytes(); }
/** * @param UuidInterface $other * @return int -1, 0 or 1 */ public function compareTo(UuidInterface $other) { $ramseyOther = RamseyUuid::fromBytes($other->getBytes()); return $this->ramseyUuid->compareTo($ramseyOther); }