url; } public function getLength(): int { return $this->length; } public function getType(): string { return $this->type; } public function setBuffer(string $buffer): void { $this->buffer = $buffer; } public function getBuffer(): string { return $this->buffer; } /** * @param array $props Properties and their values. */ public static function fromArray(array $props): File { $file = new self( $props['url'], (int) $props['length'], $props['type'] ); if ($props['id']) { $file->setId($props['id']); } if ($props['createAt']) { $file->setCreatedAt($props['createdAt']); } if ($props['updatedAt']) { $file->setUpdatedAt($props['updatedAt']); } return $file; } }