Skip to content

Commit

Permalink
Completed PersonalData validator.
Browse files Browse the repository at this point in the history
Renamed HistoryRepository
Updated Report generator to use the PersonalData column type.
Fixed error with unserializing existing PersonalData objects in update command.
  • Loading branch information
Mark Ogilvie committed Mar 13, 2018
1 parent ed28d75 commit dc8111d
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions Model/PersonalData.php
Original file line number Diff line number Diff line change
Expand Up @@ -443,18 +443,15 @@ public function getRetainFor(): string
/**
* Set RetainFor.
*
* @param \DateInterval $retainFor
* @param string $retainFor
*
* @return PersonalData
* @return \SpecShaper\GdprBundle\Model\PersonalData
* @throws \Exception
*/
public function setRetainFor(string $retainFor): PersonalData
{
$interval = new \DateInterval($retainFor);

if (0 == $interval->format('s')) {
throw new GdprException("RetainFor option period ". $retainFor . " is not a valid \DateTimeInterface duration string");
}


$this->retainFor = $interval;

return $this;
Expand Down

0 comments on commit dc8111d

Please sign in to comment.