mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Allow to edit an attachment.
This commit is contained in:
32
app/Repositories/Attachment/AttachmentRepository.php
Normal file
32
app/Repositories/Attachment/AttachmentRepository.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace FireflyIII\Repositories\Attachment;
|
||||
|
||||
use FireflyIII\Models\Attachment;
|
||||
|
||||
/**
|
||||
* Class AttachmentRepository
|
||||
*
|
||||
* @package FireflyIII\Repositories\Attachment
|
||||
*/
|
||||
class AttachmentRepository implements AttachmentRepositoryInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Attachment $attachment
|
||||
* @param array $data
|
||||
*
|
||||
* @return Attachment
|
||||
*/
|
||||
public function update(Attachment $attachment, array $data)
|
||||
{
|
||||
|
||||
$attachment->title = $data['title'];
|
||||
$attachment->description = $data['description'];
|
||||
$attachment->notes = $data['notes'];
|
||||
$attachment->save();
|
||||
|
||||
return $attachment;
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace FireflyIII\Repositories\Attachment;
|
||||
|
||||
use FireflyIII\Models\Attachment;
|
||||
|
||||
/**
|
||||
* Interface AttachmentRepositoryInterface
|
||||
*
|
||||
* @package FireflyIII\Repositories\Attachment
|
||||
*/
|
||||
interface AttachmentRepositoryInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Attachment $attachment
|
||||
* @param array $attachmentData
|
||||
*
|
||||
* @return Attachment
|
||||
*/
|
||||
public function update(Attachment $attachment, array $attachmentData);
|
||||
}
|
Reference in New Issue
Block a user