Skip to content

Commit

Permalink
Merge pull request #49 from jdecool/master
Browse files Browse the repository at this point in the history
Remove type hinting on base persists methods
  • Loading branch information
jdecool committed Feb 11, 2015
2 parents 729bd38 + 4e1961c commit 447e9bf
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Manager/BaseEntityWithFileManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct($arrayFilepath, $entityManager)
/**
* {@inheritdoc}
*/
public function save(BaseEntityWithFile $entity)
public function save($entity)
{
$this->entityManager->persist($entity);
$this->entityManager->flush();
Expand All @@ -50,7 +50,7 @@ public function save(BaseEntityWithFile $entity)
/**
* {@inheritdoc}
*/
public function delete(BaseEntityWithFile $entity)
public function delete($entity)
{
$this->entityManager->remove($entity);
$this->entityManager->flush();
Expand Down
4 changes: 2 additions & 2 deletions Manager/BaseEntityWithImageManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function __construct($arrayFilepath, $entityManager, $imageFormatDefiniti
/**
* {@inheritdoc}
*/
public function save(BaseEntityWithFile $entity)
public function save($entity)
{
$this->entityManager->persist($entity);
$this->entityManager->flush();
Expand All @@ -53,7 +53,7 @@ public function save(BaseEntityWithFile $entity)
/**
* {@inheritdoc}
*/
public function delete(BaseEntityWithFile $entity)
public function delete($entity)
{
$this->entityManager->remove($entity);
$this->entityManager->flush();
Expand Down
4 changes: 2 additions & 2 deletions Manager/FileManagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface FileManagerInterface
*
* @return BaseEntityWithFile The saved entity
*/
public function save(BaseEntityWithFile $entity);
public function save($entity);

/**
* Saves an entity and manages its file storage
Expand All @@ -36,7 +36,7 @@ public function saveWithFiles(BaseEntityWithFile $entity, $callback = null);
*
* @return BaseEntityWithFile The deleted entity
*/
public function delete(BaseEntityWithFile $entity);
public function delete($entity);

/**
* Deletes an entity and manages its file storage
Expand Down
16 changes: 16 additions & 0 deletions Manager/Traits/FileManagerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -440,4 +440,20 @@ protected function fileMove(BaseEntityWithFile $entity, $propertyName, $fileDest

return false;
}

/**
* Persist and flush the entity
*
* @param mixed $entity The entity to save
* @return mixed The saved entity
*/
abstract public function save($entity);

/**
* Remove and flush the entity
*
* @param mixed $entity The entity to delete
* @return mixed The deleted entity
*/
abstract public function delete($entity);
}

0 comments on commit 447e9bf

Please sign in to comment.