Skip to content

Commit 9eedf0d

Browse files
committed
1 parent 8708448 commit 9eedf0d

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed

tests/Documents/Encrypted/Patient.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Documents\Encrypted;
6+
7+
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
8+
9+
#[ODM\Document(collection: 'patients')]
10+
class Patient
11+
{
12+
#[ODM\Id]
13+
public ?string $id;
14+
15+
#[ODM\Field]
16+
public string $patientName;
17+
18+
#[ODM\Field]
19+
public int $patientId;
20+
21+
#[ODM\EmbedOne(targetDocument: PatientRecord::class)]
22+
public PatientRecord $patientRecord;
23+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Documents\Encrypted;
6+
7+
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
8+
use Doctrine\ODM\MongoDB\Mapping\Annotations\EmbeddedDocument;
9+
10+
#[EmbeddedDocument]
11+
class PatientBilling
12+
{
13+
#[ODM\Field]
14+
public string $type;
15+
16+
#[ODM\Field]
17+
public string $number;
18+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Documents\Encrypted;
6+
7+
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
8+
use Doctrine\ODM\MongoDB\Mapping\Annotations\EmbeddedDocument;
9+
10+
#[EmbeddedDocument]
11+
class PatientRecord
12+
{
13+
#[ODM\Id]
14+
public ?string $id;
15+
16+
#[ODM\Field]
17+
#[ODM\Encrypt]
18+
public string $ssn;
19+
20+
#[ODM\EmbedOne(targetDocument: PatientBilling::class)]
21+
#[ODM\Encrypt]
22+
public PatientBilling $billing;
23+
24+
#[ODM\Field]
25+
public int $billingAmount;
26+
}

0 commit comments

Comments
 (0)