Commit e484d543 authored by lecluse's avatar lecluse
Browse files

Optimisations au niveau de la gestion des intervenants (suppression des...

Optimisations au niveau de la gestion des intervenants (suppression des one-to-one qui généraient des requêtes inutiles).
Petites optimisations générales.
Divers
parent 73815a42
......@@ -4,7 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "308cfa4cdcc7d4dd8adddc06573faad5",
"hash": "fd8b6adcbbd24ebb7bc8d3175561c54b",
"content-hash": "54e4156169f7da59e3e2ca2363511a25",
"packages": [
{
"name": "bjyoungblood/bjy-authorize",
......@@ -146,16 +147,16 @@
},
{
"name": "doctrine/cache",
"version": "v1.4.2",
"version": "v1.5.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/cache.git",
"reference": "8c434000f420ade76a07c64cbe08ca47e5c101ca"
"reference": "2b9cec5a5e722010cbebc91713d4c11eaa064d5e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/cache/zipball/8c434000f420ade76a07c64cbe08ca47e5c101ca",
"reference": "8c434000f420ade76a07c64cbe08ca47e5c101ca",
"url": "https://api.github.com/repos/doctrine/cache/zipball/2b9cec5a5e722010cbebc91713d4c11eaa064d5e",
"reference": "2b9cec5a5e722010cbebc91713d4c11eaa064d5e",
"shasum": ""
},
"require": {
......@@ -176,8 +177,8 @@
}
},
"autoload": {
"psr-0": {
"Doctrine\\Common\\Cache\\": "lib/"
"psr-4": {
"Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache"
}
},
"notification-url": "https://packagist.org/downloads/",
......@@ -212,7 +213,7 @@
"cache",
"caching"
],
"time": "2015-08-31 12:36:41"
"time": "2015-11-02 18:35:48"
},
{
"name": "doctrine/collections",
......@@ -504,22 +505,22 @@
},
{
"name": "doctrine/doctrine-orm-module",
"version": "0.9.1",
"version": "0.9.2",
"source": {
"type": "git",
"url": "git@github.com:doctrine/DoctrineORMModule.git",
"reference": "11cf6a34cd097b4d252a82d198ceed565ee3102c"
"url": "https://github.com/doctrine/DoctrineORMModule.git",
"reference": "847db36f0f7ef8d940414e433e8b241aa601a6a7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/DoctrineORMModule/zipball/731ec00a3b5cb9fcf0def3abc42e0ac58f8d0265",
"reference": "11cf6a34cd097b4d252a82d198ceed565ee3102c",
"url": "https://api.github.com/repos/doctrine/DoctrineORMModule/zipball/847db36f0f7ef8d940414e433e8b241aa601a6a7",
"reference": "847db36f0f7ef8d940414e433e8b241aa601a6a7",
"shasum": ""
},
"require": {
"doctrine/dbal": ">=2.4,<2.7",
"doctrine/doctrine-module": "~0.8",
"doctrine/orm": ">=2.4,<2.7",
"doctrine/orm": ">=2.5,<2.7",
"php": ">=5.4",
"symfony/console": "~2.5|~3.0",
"zendframework/zend-mvc": "~2.3",
......@@ -578,20 +579,20 @@
"orm",
"zf2"
],
"time": "2015-06-15 21:20:41"
"time": "2015-10-05 23:06:08"
},
{
"name": "doctrine/inflector",
"version": "v1.0.1",
"version": "v1.1.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/inflector.git",
"reference": "0bcb2e79d8571787f18b7eb036ed3d004908e604"
"reference": "90b2128806bfde671b6952ab8bea493942c1fdae"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/inflector/zipball/0bcb2e79d8571787f18b7eb036ed3d004908e604",
"reference": "0bcb2e79d8571787f18b7eb036ed3d004908e604",
"url": "https://api.github.com/repos/doctrine/inflector/zipball/90b2128806bfde671b6952ab8bea493942c1fdae",
"reference": "90b2128806bfde671b6952ab8bea493942c1fdae",
"shasum": ""
},
"require": {
......@@ -603,7 +604,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
"dev-master": "1.1.x-dev"
}
},
"autoload": {
......@@ -645,7 +646,7 @@
"singularize",
"string"
],
"time": "2014-12-20 21:24:13"
"time": "2015-11-06 14:35:42"
},
{
"name": "doctrine/instantiator",
......@@ -1065,16 +1066,16 @@
},
{
"name": "symfony/console",
"version": "v2.7.5",
"version": "v2.7.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "06cb17c013a82f94a3d840682b49425cd00a2161"
"reference": "5efd632294c8320ea52492db22292ff853a43766"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/06cb17c013a82f94a3d840682b49425cd00a2161",
"reference": "06cb17c013a82f94a3d840682b49425cd00a2161",
"url": "https://api.github.com/repos/symfony/console/zipball/5efd632294c8320ea52492db22292ff853a43766",
"reference": "5efd632294c8320ea52492db22292ff853a43766",
"shasum": ""
},
"require": {
......@@ -1083,7 +1084,6 @@
"require-dev": {
"psr/log": "~1.0",
"symfony/event-dispatcher": "~2.1",
"symfony/phpunit-bridge": "~2.7",
"symfony/process": "~2.1"
},
"suggest": {
......@@ -1118,28 +1118,25 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"time": "2015-09-25 08:32:23"
"time": "2015-10-20 14:38:46"
},
{
"name": "symfony/process",
"version": "v2.7.5",
"version": "v2.7.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "b27c8e317922cd3cdd3600850273cf6b82b2e8e9"
"reference": "4a959dd4e19c2c5d7512689413921e0a74386ec7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/b27c8e317922cd3cdd3600850273cf6b82b2e8e9",
"reference": "b27c8e317922cd3cdd3600850273cf6b82b2e8e9",
"url": "https://api.github.com/repos/symfony/process/zipball/4a959dd4e19c2c5d7512689413921e0a74386ec7",
"reference": "4a959dd4e19c2c5d7512689413921e0a74386ec7",
"shasum": ""
},
"require": {
"php": ">=5.3.9"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.7"
},
"type": "library",
"extra": {
"branch-alias": {
......@@ -1167,7 +1164,7 @@
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
"time": "2015-09-19 19:59:23"
"time": "2015-10-23 14:47:27"
},
{
"name": "unicaen/unicaen-app",
......@@ -1175,7 +1172,7 @@
"source": {
"type": "svn",
"url": "https://svn.unicaen.fr/svn/UnicaenApp",
"reference": "/trunk/@635"
"reference": "/trunk/@644"
},
"require": {
"doctrine/doctrine-orm-module": ">=0.7",
......@@ -1248,30 +1245,6 @@
},
"description": "Module d'authentification pour les applis ZF2 de l'UCBN"
},
{
"name": "unicaen/unicaen-ldap",
"version": "dev-trunk",
"source": {
"type": "svn",
"url": "https://svn.unicaen.fr/svn/UnicaenLdap",
"reference": "/trunk/@10"
},
"require-dev": {
"phpunit/phpunit": ">=3.7",
"zendframework/zend-test": ">=2.2"
},
"type": "library",
"autoload": {
"psr-0": {
"UnicaenLdap": "src/",
"UnicaenLdapTest": "tests/"
},
"classmap": [
"./Module.php"
]
},
"description": "Module Ldap de l'UCBN"
},
{
"name": "zendframework/zend-authentication",
"version": "2.4.8",
......@@ -3487,16 +3460,16 @@
},
{
"name": "phpunit/php-code-coverage",
"version": "2.2.3",
"version": "2.2.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "ef1ca6835468857944d5c3b48fa503d5554cff2f"
"reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef1ca6835468857944d5c3b48fa503d5554cff2f",
"reference": "ef1ca6835468857944d5c3b48fa503d5554cff2f",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979",
"reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979",
"shasum": ""
},
"require": {
......@@ -3545,7 +3518,7 @@
"testing",
"xunit"
],
"time": "2015-09-14 06:51:16"
"time": "2015-10-06 15:47:00"
},
{
"name": "phpunit/php-file-iterator",
......@@ -3727,16 +3700,16 @@
},
{
"name": "phpunit/phpunit",
"version": "4.8.9",
"version": "4.8.16",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "73fad41adb5b7bc3a494bb930d90648df1d5e74b"
"reference": "625f8c345606ed0f3a141dfb88f4116f0e22978e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/73fad41adb5b7bc3a494bb930d90648df1d5e74b",
"reference": "73fad41adb5b7bc3a494bb930d90648df1d5e74b",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/625f8c345606ed0f3a141dfb88f4116f0e22978e",
"reference": "625f8c345606ed0f3a141dfb88f4116f0e22978e",
"shasum": ""
},
"require": {
......@@ -3795,20 +3768,20 @@
"testing",
"xunit"
],
"time": "2015-09-20 12:56:44"
"time": "2015-10-23 06:48:33"
},
{
"name": "phpunit/phpunit-mock-objects",
"version": "2.3.7",
"version": "2.3.8",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
"reference": "5e2645ad49d196e020b85598d7c97e482725786a"
"reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/5e2645ad49d196e020b85598d7c97e482725786a",
"reference": "5e2645ad49d196e020b85598d7c97e482725786a",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983",
"reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983",
"shasum": ""
},
"require": {
......@@ -3851,7 +3824,7 @@
"mock",
"xunit"
],
"time": "2015-08-19 09:14:08"
"time": "2015-10-02 06:51:40"
},
{
"name": "sebastian/comparator",
......@@ -4087,16 +4060,16 @@
},
{
"name": "sebastian/global-state",
"version": "1.0.0",
"version": "1.1.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/global-state.git",
"reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01"
"reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c7428acdb62ece0a45e6306f1ae85e1c05b09c01",
"reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01",
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4",
"reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4",
"shasum": ""
},
"require": {
......@@ -4134,7 +4107,7 @@
"keywords": [
"global state"
],
"time": "2014-10-06 09:23:50"
"time": "2015-10-12 03:26:01"
},
{
"name": "sebastian/recursion-context",
......@@ -4226,24 +4199,21 @@
},
{
"name": "symfony/yaml",
"version": "v2.7.5",
"version": "v2.7.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "31cb2ad0155c95b88ee55fe12bc7ff92232c1770"
"reference": "eca9019c88fbe250164affd107bc8057771f3f4d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/31cb2ad0155c95b88ee55fe12bc7ff92232c1770",
"reference": "31cb2ad0155c95b88ee55fe12bc7ff92232c1770",
"url": "https://api.github.com/repos/symfony/yaml/zipball/eca9019c88fbe250164affd107bc8057771f3f4d",
"reference": "eca9019c88fbe250164affd107bc8057771f3f4d",
"shasum": ""
},
"require": {
"php": ">=5.3.9"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.7"
},
"type": "library",
"extra": {
"branch-alias": {
......@@ -4271,7 +4241,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"time": "2015-09-14 14:14:09"
"time": "2015-10-11 09:39:48"
},
{
"name": "unicaen/unicaen-code",
......@@ -4580,7 +4550,6 @@
"stability-flags": {
"unicaen/unicaen-app": 20,
"unicaen/unicaen-auth": 20,
"unicaen/unicaen-ldap": 20,
"bjyoungblood/bjy-authorize": 20,
"zendframework/zend-developer-tools": 20,
"unicaen/unicaen-code": 20
......
......@@ -240,11 +240,6 @@ class Intervenant implements IntervenantInterface, HistoriqueAwareInterface, Res
*/
protected $agrement;
/**
* @var Utilisateur
*/
protected $utilisateur;
/**
* @var boolean
*/
......@@ -266,12 +261,12 @@ class Intervenant implements IntervenantInterface, HistoriqueAwareInterface, Res
private $formuleResultat;
/**
* @var FormuleIntervenant
* @var \Doctrine\Common\Collections\Collection
*/
private $formuleIntervenant;
/**
* @var \Application\Entity\Db\VIndicDiffDossier
* @var \Doctrine\Common\Collections\Collection
*/
private $vIndicDiffDossier;
......@@ -338,6 +333,7 @@ class Intervenant implements IntervenantInterface, HistoriqueAwareInterface, Res
$this->vIndicAttenteMep = new \Doctrine\Common\Collections\ArrayCollection();
$this->modificationServiceDu = new \Doctrine\Common\Collections\ArrayCollection();
$this->contrat = new \Doctrine\Common\Collections\ArrayCollection();
$this->vIndicDiffDossier = new \Doctrine\Common\Collections\ArrayCollection();
}
......@@ -1452,18 +1448,6 @@ class Intervenant implements IntervenantInterface, HistoriqueAwareInterface, Res
/**
* Get utilisateur
*
* @return Utilisateur
*/
public function getUtilisateur()
{
return $this->utilisateur;
}
/**
* Indique si cet intervenant est permanent.
*
......@@ -1649,7 +1633,10 @@ class Intervenant implements IntervenantInterface, HistoriqueAwareInterface, Res
*/
public function getVIndicDiffDossier()
{
return $this->vIndicDiffDossier;
if (!count($this->vIndicDiffDossier)) {
return null;
}
return $this->vIndicDiffDossier->first();
}
......@@ -1784,13 +1771,16 @@ class Intervenant implements IntervenantInterface, HistoriqueAwareInterface, Res
/**
* Get utilisateur
* Get FormuleIntervenant
*
* @return Utilisateur
* @return FormuleIntervenant
*/
public function getFormuleIntervenant()
{
return $this->formuleIntervenant;
if (!count($this->formuleIntervenant)) {
return null;
}
return $this->formuleIntervenant->first();
}
......
......@@ -109,19 +109,17 @@
<one-to-many field="adresse" target-entity="Application\Entity\Db\AdresseIntervenant" mapped-by="intervenant"/>
<one-to-many field="service" target-entity="Application\Entity\Db\Service" mapped-by="intervenant"/>
<one-to-many field="histoService" target-entity="Application\Entity\Db\HistoIntervenantService" mapped-by="intervenant"/>
<one-to-many field="serviceReferentiel" target-entity="Application\Entity\Db\ServiceReferentiel"
mapped-by="intervenant">
<one-to-many field="serviceReferentiel" target-entity="Application\Entity\Db\ServiceReferentiel" mapped-by="intervenant">
<cascade>
<cascade-persist/>
</cascade>
</one-to-many>
<one-to-many field="validation" target-entity="Application\Entity\Db\Validation" mapped-by="intervenant"/>
<one-to-many field="agrement" target-entity="Application\Entity\Db\Agrement" mapped-by="intervenant"/>
<one-to-one field="utilisateur" target-entity="Application\Entity\Db\Utilisateur" mapped-by="intervenant"/>
<one-to-one field="formuleIntervenant" target-entity="Application\Entity\Db\FormuleIntervenant" mapped-by="intervenant"/>
<one-to-many field="formuleIntervenant" target-entity="Application\Entity\Db\FormuleIntervenant" mapped-by="intervenant" fetch="EXTRA_LAZY"/>
<one-to-many field="formuleResultat" target-entity="Application\Entity\Db\FormuleResultat" mapped-by="intervenant"/>
<one-to-many field="wfIntervenantEtape" target-entity="Application\Entity\Db\WfIntervenantEtape" mapped-by="intervenant"/>
<one-to-one field="vIndicDiffDossier" target-entity="Application\Entity\Db\VIndicDiffDossier" mapped-by="intervenant"/>
<one-to-many field="vIndicDiffDossier" target-entity="Application\Entity\Db\VIndicDiffDossier" mapped-by="intervenant"/>
<one-to-many field="indicModifDossier" target-entity="Application\Entity\Db\IndicModifDossier" mapped-by="intervenant"/>
<one-to-many field="miseEnPaiementIntervenantStructure" target-entity="Application\Entity\Db\MiseEnPaiementIntervenantStructure" mapped-by="intervenant"/>
<one-to-many field="vIndicAttenteDemandeMep" target-entity="Application\Entity\Db\VIndicAttenteDemandeMep" mapped-by="intervenant"/>
......
......@@ -87,16 +87,17 @@ class Annee extends AbstractEntityService
public function getChoixAnnees()
{
$session = $this->getSessionContainer();
$sql = 'SELECT id, libelle FROM annee WHERE active = 1 ORDER BY id';
$stmt = $this->getEntityManager()->getConnection()->executeQuery($sql);
$result = $stmt->fetchAll(\PDO::FETCH_ASSOC);
$session->choixAnnees = [];
foreach( $result as $annee ){
extract( array_change_key_case($annee,CASE_LOWER));
$session->choixAnnees[$id] = $libelle;
if (! $session->choixAnnees) {
$sql = 'SELECT id, libelle FROM annee WHERE active = 1 ORDER BY id';
$stmt = $this->getEntityManager()->getConnection()->executeQuery($sql);
$result = $stmt->fetchAll(\PDO::FETCH_ASSOC);
$session->choixAnnees = [];
foreach ($result as $annee) {
extract(array_change_key_case($annee, CASE_LOWER));
$session->choixAnnees[$id] = $libelle;
}
}
return $session->choixAnnees;
}
......
......@@ -80,7 +80,7 @@ class IntervenantViewHelper extends AbstractHtmlElement
],
'divers' => [
"Id" => $entity->getId(),
"Id de connexion" => ($u = $entity->getUtilisateur()) ? $u->getUsername() : "(Aucun)",
//"Id de connexion" => ($u = $entity->getUtilisateur()) ? $u->getUsername() : "(Aucun)",
],
];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment