Skip to content

Allow custom data type#3

Merged
tsmsogn merged 18 commits intofunayaki:masterfrom
b0n:master
Aug 30, 2018
Merged

Allow custom data type#3
tsmsogn merged 18 commits intofunayaki:masterfrom
b0n:master

Conversation

@b0n
Copy link

@b0n b0n commented Aug 29, 2018

  • fix restore
  • fix deprecated warnings

Copy link
Member

@tsmsogn tsmsogn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make tests for this PR?

* @param \DateTime $until Date until which soft deleted records must be hard deleted.
* @return int number of affected rows.
*/
/*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will break compatibility.

$softDeleteField = $this->getSoftDeleteField();
$entity->$softDeleteField = null;
$notDeleteValue = $this->getNotDeleteValue();
$entity->$softDeleteField = $notDeleteValue;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$entity->$softDeleteField = $this->getNotDeleteValue();

* Tests hardDeleteAll.
*/
/*
public function testHardDeleteAll()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will break compatibility.


$options = $this->getOptions();
$findWithDeleted = in_array('withDeleted', $options) || $this->repository()->findWithDeleted();
if (method_exists($this, 'getRepository')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_callable() instead of method_exists()

parent::triggerBeforeFind();

$repository = $this->repository();
if (method_exists($this, 'getRepository')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_callable() instead of method_exists()

* @return null
*/
public function getNotDeleteValue() {
if (isset($this->notDeleteValue)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about the property naming restoreValue

*
* @return null
*/
public function getNotDeleteValue() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about the method naming getRestoreValue() ?

@stickler-ci
Copy link

stickler-ci bot commented Aug 30, 2018

I couldn't find a .stickler.yml file in this repository. I can make one for you, or you can create one by following the documentation.

@stickler-ci
Copy link

stickler-ci bot commented Aug 30, 2018

I couldn't find a .stickler.yml file in this repository. I can make one for you, or you can create one by following the documentation.

@stickler-ci
Copy link

stickler-ci bot commented Aug 30, 2018

I couldn't find a .stickler.yml file in this repository. I can make one for you, or you can create one by following the documentation.

@stickler-ci
Copy link

stickler-ci bot commented Aug 30, 2018

I couldn't find a .stickler.yml file in this repository. I can make one for you, or you can create one by following the documentation.

@tsmsogn tsmsogn merged commit 0f72fd6 into funayaki:master Aug 30, 2018
@tsmsogn
Copy link
Member

tsmsogn commented Aug 31, 2018

resolves PGBI#23

@tsmsogn tsmsogn changed the title fix: restore Allow custom data type Aug 31, 2018
@tsmsogn
Copy link
Member

tsmsogn commented Aug 31, 2018

relates PGBI#27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants