| 1 | <?php |
||
| 15 | * @author Addshore |
||
| 16 | */ |
||
| 17 | class EntityDocumentSaver { |
||
| 18 | |||
| 19 | private RevisionSaver $revisionSaver; |
||
|
|
|||
| 20 | |||
| 21 | public function __construct( RevisionSaver $revisionSaver ) { |
||
| 22 | $this->revisionSaver = $revisionSaver; |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @since 0.7 |
||
| 27 | * |
||
| 28 | * @param EntityDocument $entityDocument |
||
| 29 | * @param EditInfo $editInfo |
||
| 30 | * |
||
| 31 | * @return Item|Property |
||
| 32 | */ |
||
| 33 | public function save( EntityDocument $entityDocument, EditInfo $editInfo ) { |
||
| 34 | return $this->revisionSaver->save( new Revision( new Content( $entityDocument ) ), $editInfo ); |
||
| 35 | } |
||
| 36 | |||
| 37 | } |
||
| 38 |