-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Programmes 6323 deal with parents in other partner pids (#245)
* Add new entity to track changes skipped due to parents in another partner_pid
- Loading branch information
1 parent
45f66ed
commit dbda539
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
namespace BBC\ProgrammesPagesService\Data\ProgrammesDb\Entity; | ||
|
||
use Doctrine\ORM\Mapping as ORM; | ||
|
||
/** | ||
* This table lists all changes relating to our desired partner_pids that have been skipped due to having a parent in | ||
* another partner_pid we do not ingest. | ||
* It's here so we have a permanent record of when that happens and can re-ingest if necessary. | ||
* | ||
* We do this because there's really no sane way to deal with that case other than "ingest everything in all | ||
* partner_pids", which would require a massive rewrite of our queries and reingest of all data. | ||
* | ||
* @ORM\Table() | ||
* @ORM\Entity(repositoryClass="BBC\ProgrammesPagesService\Data\ProgrammesDb\EntityRepository\PipsAutoSkippedChangeRepository") | ||
*/ | ||
class PipsAutoSkippedChange extends PipsChangeBase | ||
{ | ||
/** | ||
* The ID of the parent entity that caused this (otherwise valid) change event to be auto-skipped. | ||
* @var string | ||
* | ||
* @ORM\Column(type="string", length=255, nullable=false) | ||
*/ | ||
private $triggeringEntityId; | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getTriggeringEntityId(): string | ||
{ | ||
return $this->triggeringEntityId; | ||
} | ||
|
||
/** | ||
* @param string $triggeringEntityId | ||
*/ | ||
public function setTriggeringEntityId(string $triggeringEntityId) | ||
{ | ||
$this->triggeringEntityId = $triggeringEntityId; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/Data/ProgrammesDb/EntityRepository/PipsAutoSkippedChangeRepository.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace BBC\ProgrammesPagesService\Data\ProgrammesDb\EntityRepository; | ||
|
||
use BBC\ProgrammesPagesService\Data\ProgrammesDb\Entity\PipsAutoSkippedChange; | ||
use Doctrine\ORM\EntityRepository; | ||
|
||
class PipsAutoSkippedChangeRepository extends EntityRepository | ||
{ | ||
public function addSkippedEntity(PipsAutoSkippedChange $pipsSkippedEntity) | ||
{ | ||
$em = $this->getEntityManager(); | ||
$em->persist($pipsSkippedEntity); | ||
$em->flush(); | ||
} | ||
|
||
/** | ||
* @param mixed $cid | ||
* @return null|PipsAutoSkippedChange | ||
*/ | ||
public function findById($cid) | ||
{ | ||
return $this->find($cid); | ||
} | ||
} |