generated from Nodarx/template
feat: initial version
Signed-off-by: Sebastian Krupinski <root@LAPTOP-7DVOR6NC>
This commit was merged in pull request #1.
This commit is contained in:
26
lib/Client/Mime/Part/LazyBody.php
Normal file
26
lib/Client/Mime/Part/LazyBody.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Gricob\IMAP\Mime\Part;
|
||||
|
||||
use Gricob\IMAP\Client;
|
||||
|
||||
class LazyBody extends Body
|
||||
{
|
||||
public function __construct(
|
||||
private Client $client,
|
||||
private int $id,
|
||||
private string $section,
|
||||
) {
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
if (!isset($this->value)) {
|
||||
$this->value = $this->client->fetchSectionBody($this->id, $this->section);
|
||||
}
|
||||
|
||||
return $this->value;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user