Loading tests/OSETest/Entity/Db/EntityProvider.php +89 −4 Changes for tests/OSETest/Entity/Db/EntityProvider.php: 89 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ namespace OSETest\Entity\Db; use Application\Entity\Db\Civilite; use Application\Entity\Db\Corps; use Application\Entity\Db\Etablissement; use Application\Entity\Db\IntervenantDossier; use Application\Entity\Db\RegimeSecu; use Application\Entity\Db\Intervenant; use Application\Entity\Db\IntervenantPermanent; Loading Loading @@ -142,6 +143,8 @@ class EntityProvider */ private $periode; /** * * @param EntityManager $entityManager Loading Loading @@ -171,14 +174,19 @@ class EntityProvider $this->newEntities = new SplStack(); } /** * @var string */ protected $testClassName; /** * * @param string $className * * @return self */ public function setTestClassName($className) Loading @@ -188,6 +196,8 @@ class EntityProvider return $this; } /** * SUpprime du gestionnaire d'entité les éventuelles nouvelles instances d'entités créées. * Loading @@ -205,8 +215,7 @@ class EntityProvider // 'DELETE FROM V_ELEMENT_TYPE_INTERVENTION WHERE ELEMENT_PEDAGOGIQUE_ID = ?' with params [17970]: // ORA-01752: cannot delete from view without exactly one key-preserved table $entity->setHistoDestruction(new \DateTime()); } else { } else { $this->getEntityManager()->remove($entity); } $this->newEntities->next(); Loading @@ -220,6 +229,7 @@ class EntityProvider } /** * Recherche et retourne l'année en cours. * Loading @@ -240,6 +250,8 @@ class EntityProvider return $this->annee; } /** * Recherche et retourne l'Etablissement par défaut. * Loading @@ -260,6 +272,8 @@ class EntityProvider return $this->etablissement; } /** * Recherche et retourne la première Civilite trouvée. * Loading @@ -278,6 +292,8 @@ class EntityProvider return $this->civilite; } /** * Retourne à chaque appel une nouvelle instance de Structure persistée. * Loading @@ -288,6 +304,8 @@ class EntityProvider return null; } /** * Recherche et retourne la structure racine, i.e. qui n'a aucun structure mère. * Loading @@ -308,12 +326,15 @@ class EntityProvider return $this->structureRacine; } /** * Retourne : * - soit une Structure d'enseignement quelconque ; * - soit à chaque appel une nouvelle instance de Structure d'enseignement persistée. * * @param boolean $quelconque * * @return Structure */ public function getStructureEns($quelconque = true) Loading Loading @@ -342,10 +363,12 @@ class EntityProvider } /** * Retourne à chaque appel une nouvelle instance de StatutIntervenant persistée. * * @param boolean $permanent * * @return StatutIntervenant */ public function getStatutIntervenant($permanent = true) Loading @@ -360,10 +383,13 @@ class EntityProvider return $statut; } /** * Recherche et retourne le StatutIntervenant correspondant au code spécifié. * * @param string $sourceCode Code "source" du statut, ex: StatutIntervenant::SALAR_PRIVE * * @return StatutIntervenant */ public function getStatutIntervenantByCode($sourceCode) Loading @@ -383,6 +409,8 @@ class EntityProvider return $this->statuts[$sourceCode]; } /** * Retourne une nouvelle instance UNIQUE de Corps. * Loading @@ -400,6 +428,8 @@ class EntityProvider return $this->corps; } /** * Retourne une nouvelle instance UNIQUE de RegimeSecu. * Loading @@ -418,12 +448,14 @@ class EntityProvider } /** * Retourne à chaque appel une nouvelle instance de Service. * * @param Intervenant $intervenant * @param Structure $structureEns * @param ElementPedagogique $ep * * @return Service */ public function getService(Intervenant $intervenant, Structure $structureEns = null, ElementPedagogique $ep = null) Loading @@ -442,12 +474,15 @@ class EntityProvider return $service; } /** * Retourne à chaque appel une nouvelle instance de VolumeHoraire. * * @param Service $v * @param float $heures * @param TypeIntervention $typeIntervention * * @return VolumeHoraire */ public function getVolumeHoraire(Service $v, $heures, TypeIntervention $typeIntervention = null, Periode $periode = null) Loading @@ -464,6 +499,8 @@ class EntityProvider return $vh; } /** * Recherche et retourne un TypeIntervention quelconque. * Loading @@ -482,10 +519,13 @@ class EntityProvider return $this->typeIntervention; } /** * Recherche et retourne le TypeIntervention correspondant au code spécifié. * * @param string $code Code du TypeIntervention, ex: TypeIntervention::CODE_PIECE_JOINTE * * @return TypeIntervention */ public function getTypeInterventionByCode($code) Loading @@ -505,6 +545,8 @@ class EntityProvider return $this->typesIntervention[$code]; } /** * Recherche et retourne une Periode quelconque. * Loading @@ -524,6 +566,8 @@ class EntityProvider return $this->periode; } /** * Recherche et retourne une Etape quelconque. * Loading @@ -542,6 +586,8 @@ class EntityProvider return $this->etape; } /** * Retourne à chaque appel une nouvelle instance de ElementPedagogique persistée. * Loading @@ -561,11 +607,14 @@ class EntityProvider return $ep; } /** * Retourne à chaque appel une nouvelle instance de ServiceReferentiel persistée. * * @param Intervenant $intervenant * @param Structure $structure * * @return ServiceReferentiel */ public function getServiceReferentiel(Intervenant $intervenant, Structure $structure = null) Loading @@ -583,6 +632,8 @@ class EntityProvider return $service; } /** * Recherche et retourne une FonctionReferentiel quelconque. * Loading @@ -601,6 +652,8 @@ class EntityProvider return $this->fonction; } /** * Recherche et retourne le TypeVolumeHoraire "Prévu". * Loading @@ -619,6 +672,8 @@ class EntityProvider return $this->typeVolumeHoraire; } /** * Retourne à chaque appel une nouvelle instance de TypePieceJointe persistée. * Loading @@ -635,11 +690,14 @@ class EntityProvider return $type; } /** * Retourne à chaque appel une nouvelle instance de TypePieceJointeStatut persistée. * * @param StatutIntervenant $statut * @param TypePieceJointe $type * * @return TypePieceJointeStatut */ public function getTypePieceJointeStatut(StatutIntervenant $statut, TypePieceJointe $type = null) Loading @@ -655,14 +713,17 @@ class EntityProvider return $tpjs; } /** * Retourne à chaque appel une nouvelle instance de PieceJointe persistée. * * @param TypePieceJointe $type * @param Dossier $dossier * @param IntervenantDossier $dossier * * @return PieceJointe */ public function getPieceJointe(TypePieceJointe $type, Dossier $dossier = null) public function getPieceJointe(TypePieceJointe $type, IntervenantDossier $dossier = null) { $pj = Asset::newPieceJointe($type, $dossier); Loading @@ -673,6 +734,8 @@ class EntityProvider return $pj; } /** * Retourne à chaque appel une nouvelle instance de Fichier persistée. * Loading @@ -689,6 +752,8 @@ class EntityProvider return $fichier; } /** * Retourne à chaque appel une nouvelle instance de TypeAgrement persistée. * Loading @@ -705,11 +770,14 @@ class EntityProvider return $type; } /** * Retourne à chaque appel une nouvelle instance de TypeAgrementStatut persistée. * * @param StatutIntervenant $statut * @param TypeAgrement $type * * @return TypeAgrementStatut */ public function getTypeAgrementStatut(StatutIntervenant $statut, TypeAgrement $type = null) Loading @@ -725,12 +793,15 @@ class EntityProvider return $tas; } /** * Retourne à chaque appel une nouvelle instance d'AgrementService persistée. * * @param TypeAgrement $type * @param Intervenant $intervenant * @param Structure $structure * * @return Agrement */ public function getAgrement(TypeAgrement $type, Intervenant $intervenant, Structure $structure = null) Loading @@ -748,6 +819,8 @@ class EntityProvider return $a; } /** * Retourne à chaque appel une nouvelle instance de Validation persistée. * Loading @@ -764,10 +837,13 @@ class EntityProvider return $validation; } /** * Recherche et retourne le TypeValidation correspondant au code spécifié. * * @param string $sourceCode Code du TypeValidation, ex: TypeValidation::CODE_PIECE_JOINTE * * @return TypeValidation */ public function getTypeValidationByCode($sourceCode) Loading @@ -787,10 +863,13 @@ class EntityProvider return $this->typesValidation[$sourceCode]; } /** * Recherche et retourne le TypeAgrement correspondant au code spécifié. * * @param string $sourceCode Code du TypeAgrement, ex: TypeAgrement::CODE_CONSEIL_RESTREINT * * @return TypeAgrement */ public function getTypeAgrementByCode($sourceCode) Loading @@ -810,12 +889,15 @@ class EntityProvider return $this->typesAgrement[$sourceCode]; } /** * Retourne à chaque appel une nouvelle instance de Contrat persistée. * * @param TypeContrat $type * @param Intervenant $intervenant * @param Structure $structure * * @return Contrat */ public function getContrat(TypeContrat $type, Intervenant $intervenant, Structure $structure = null) Loading @@ -832,10 +914,13 @@ class EntityProvider return $a; } /** * Retourne à chaque appel une nouvelle instance de TypeContrat persistée. * * @param boolean $avenant * * @return TypeContrat */ public function getTypeContrat($avenant = false) Loading Loading
tests/OSETest/Entity/Db/EntityProvider.php +89 −4 Changes for tests/OSETest/Entity/Db/EntityProvider.php: 89 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ namespace OSETest\Entity\Db; use Application\Entity\Db\Civilite; use Application\Entity\Db\Corps; use Application\Entity\Db\Etablissement; use Application\Entity\Db\IntervenantDossier; use Application\Entity\Db\RegimeSecu; use Application\Entity\Db\Intervenant; use Application\Entity\Db\IntervenantPermanent; Loading Loading @@ -142,6 +143,8 @@ class EntityProvider */ private $periode; /** * * @param EntityManager $entityManager Loading Loading @@ -171,14 +174,19 @@ class EntityProvider $this->newEntities = new SplStack(); } /** * @var string */ protected $testClassName; /** * * @param string $className * * @return self */ public function setTestClassName($className) Loading @@ -188,6 +196,8 @@ class EntityProvider return $this; } /** * SUpprime du gestionnaire d'entité les éventuelles nouvelles instances d'entités créées. * Loading @@ -205,8 +215,7 @@ class EntityProvider // 'DELETE FROM V_ELEMENT_TYPE_INTERVENTION WHERE ELEMENT_PEDAGOGIQUE_ID = ?' with params [17970]: // ORA-01752: cannot delete from view without exactly one key-preserved table $entity->setHistoDestruction(new \DateTime()); } else { } else { $this->getEntityManager()->remove($entity); } $this->newEntities->next(); Loading @@ -220,6 +229,7 @@ class EntityProvider } /** * Recherche et retourne l'année en cours. * Loading @@ -240,6 +250,8 @@ class EntityProvider return $this->annee; } /** * Recherche et retourne l'Etablissement par défaut. * Loading @@ -260,6 +272,8 @@ class EntityProvider return $this->etablissement; } /** * Recherche et retourne la première Civilite trouvée. * Loading @@ -278,6 +292,8 @@ class EntityProvider return $this->civilite; } /** * Retourne à chaque appel une nouvelle instance de Structure persistée. * Loading @@ -288,6 +304,8 @@ class EntityProvider return null; } /** * Recherche et retourne la structure racine, i.e. qui n'a aucun structure mère. * Loading @@ -308,12 +326,15 @@ class EntityProvider return $this->structureRacine; } /** * Retourne : * - soit une Structure d'enseignement quelconque ; * - soit à chaque appel une nouvelle instance de Structure d'enseignement persistée. * * @param boolean $quelconque * * @return Structure */ public function getStructureEns($quelconque = true) Loading Loading @@ -342,10 +363,12 @@ class EntityProvider } /** * Retourne à chaque appel une nouvelle instance de StatutIntervenant persistée. * * @param boolean $permanent * * @return StatutIntervenant */ public function getStatutIntervenant($permanent = true) Loading @@ -360,10 +383,13 @@ class EntityProvider return $statut; } /** * Recherche et retourne le StatutIntervenant correspondant au code spécifié. * * @param string $sourceCode Code "source" du statut, ex: StatutIntervenant::SALAR_PRIVE * * @return StatutIntervenant */ public function getStatutIntervenantByCode($sourceCode) Loading @@ -383,6 +409,8 @@ class EntityProvider return $this->statuts[$sourceCode]; } /** * Retourne une nouvelle instance UNIQUE de Corps. * Loading @@ -400,6 +428,8 @@ class EntityProvider return $this->corps; } /** * Retourne une nouvelle instance UNIQUE de RegimeSecu. * Loading @@ -418,12 +448,14 @@ class EntityProvider } /** * Retourne à chaque appel une nouvelle instance de Service. * * @param Intervenant $intervenant * @param Structure $structureEns * @param ElementPedagogique $ep * * @return Service */ public function getService(Intervenant $intervenant, Structure $structureEns = null, ElementPedagogique $ep = null) Loading @@ -442,12 +474,15 @@ class EntityProvider return $service; } /** * Retourne à chaque appel une nouvelle instance de VolumeHoraire. * * @param Service $v * @param float $heures * @param TypeIntervention $typeIntervention * * @return VolumeHoraire */ public function getVolumeHoraire(Service $v, $heures, TypeIntervention $typeIntervention = null, Periode $periode = null) Loading @@ -464,6 +499,8 @@ class EntityProvider return $vh; } /** * Recherche et retourne un TypeIntervention quelconque. * Loading @@ -482,10 +519,13 @@ class EntityProvider return $this->typeIntervention; } /** * Recherche et retourne le TypeIntervention correspondant au code spécifié. * * @param string $code Code du TypeIntervention, ex: TypeIntervention::CODE_PIECE_JOINTE * * @return TypeIntervention */ public function getTypeInterventionByCode($code) Loading @@ -505,6 +545,8 @@ class EntityProvider return $this->typesIntervention[$code]; } /** * Recherche et retourne une Periode quelconque. * Loading @@ -524,6 +566,8 @@ class EntityProvider return $this->periode; } /** * Recherche et retourne une Etape quelconque. * Loading @@ -542,6 +586,8 @@ class EntityProvider return $this->etape; } /** * Retourne à chaque appel une nouvelle instance de ElementPedagogique persistée. * Loading @@ -561,11 +607,14 @@ class EntityProvider return $ep; } /** * Retourne à chaque appel une nouvelle instance de ServiceReferentiel persistée. * * @param Intervenant $intervenant * @param Structure $structure * * @return ServiceReferentiel */ public function getServiceReferentiel(Intervenant $intervenant, Structure $structure = null) Loading @@ -583,6 +632,8 @@ class EntityProvider return $service; } /** * Recherche et retourne une FonctionReferentiel quelconque. * Loading @@ -601,6 +652,8 @@ class EntityProvider return $this->fonction; } /** * Recherche et retourne le TypeVolumeHoraire "Prévu". * Loading @@ -619,6 +672,8 @@ class EntityProvider return $this->typeVolumeHoraire; } /** * Retourne à chaque appel une nouvelle instance de TypePieceJointe persistée. * Loading @@ -635,11 +690,14 @@ class EntityProvider return $type; } /** * Retourne à chaque appel une nouvelle instance de TypePieceJointeStatut persistée. * * @param StatutIntervenant $statut * @param TypePieceJointe $type * * @return TypePieceJointeStatut */ public function getTypePieceJointeStatut(StatutIntervenant $statut, TypePieceJointe $type = null) Loading @@ -655,14 +713,17 @@ class EntityProvider return $tpjs; } /** * Retourne à chaque appel une nouvelle instance de PieceJointe persistée. * * @param TypePieceJointe $type * @param Dossier $dossier * @param IntervenantDossier $dossier * * @return PieceJointe */ public function getPieceJointe(TypePieceJointe $type, Dossier $dossier = null) public function getPieceJointe(TypePieceJointe $type, IntervenantDossier $dossier = null) { $pj = Asset::newPieceJointe($type, $dossier); Loading @@ -673,6 +734,8 @@ class EntityProvider return $pj; } /** * Retourne à chaque appel une nouvelle instance de Fichier persistée. * Loading @@ -689,6 +752,8 @@ class EntityProvider return $fichier; } /** * Retourne à chaque appel une nouvelle instance de TypeAgrement persistée. * Loading @@ -705,11 +770,14 @@ class EntityProvider return $type; } /** * Retourne à chaque appel une nouvelle instance de TypeAgrementStatut persistée. * * @param StatutIntervenant $statut * @param TypeAgrement $type * * @return TypeAgrementStatut */ public function getTypeAgrementStatut(StatutIntervenant $statut, TypeAgrement $type = null) Loading @@ -725,12 +793,15 @@ class EntityProvider return $tas; } /** * Retourne à chaque appel une nouvelle instance d'AgrementService persistée. * * @param TypeAgrement $type * @param Intervenant $intervenant * @param Structure $structure * * @return Agrement */ public function getAgrement(TypeAgrement $type, Intervenant $intervenant, Structure $structure = null) Loading @@ -748,6 +819,8 @@ class EntityProvider return $a; } /** * Retourne à chaque appel une nouvelle instance de Validation persistée. * Loading @@ -764,10 +837,13 @@ class EntityProvider return $validation; } /** * Recherche et retourne le TypeValidation correspondant au code spécifié. * * @param string $sourceCode Code du TypeValidation, ex: TypeValidation::CODE_PIECE_JOINTE * * @return TypeValidation */ public function getTypeValidationByCode($sourceCode) Loading @@ -787,10 +863,13 @@ class EntityProvider return $this->typesValidation[$sourceCode]; } /** * Recherche et retourne le TypeAgrement correspondant au code spécifié. * * @param string $sourceCode Code du TypeAgrement, ex: TypeAgrement::CODE_CONSEIL_RESTREINT * * @return TypeAgrement */ public function getTypeAgrementByCode($sourceCode) Loading @@ -810,12 +889,15 @@ class EntityProvider return $this->typesAgrement[$sourceCode]; } /** * Retourne à chaque appel une nouvelle instance de Contrat persistée. * * @param TypeContrat $type * @param Intervenant $intervenant * @param Structure $structure * * @return Contrat */ public function getContrat(TypeContrat $type, Intervenant $intervenant, Structure $structure = null) Loading @@ -832,10 +914,13 @@ class EntityProvider return $a; } /** * Retourne à chaque appel une nouvelle instance de TypeContrat persistée. * * @param boolean $avenant * * @return TypeContrat */ public function getTypeContrat($avenant = false) Loading