Commit 15e49b69 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Refactorisation structure : suite

parent 49ec14e0
Loading
Loading
Loading
Loading
−2
Changes for module/Application/src/Application/Controller/TheseController.php: 0 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -152,8 +152,6 @@ class TheseController extends AbstractController implements

        $qb = $this->theseService->getRepository()->createQueryBuilder('t')
            ->addSelect('di')->leftJoin('th.individu', 'di')
            ->addSelect('ed')->leftJoin('t.ecoleDoctorale', 'ed')
            ->addSelect('ur')->leftJoin('t.uniteRecherche', 'ur')
            ->addSelect('a')->leftJoin('t.acteurs', 'a')
            ->addSelect('i')->leftJoin('a.individu', 'i')
            ->addSelect('r')->leftJoin('a.role', 'r')
+13
Changes for module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Role.dcm.xml: 13 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@
        <field name="isDefault" type="boolean" column="IS_DEFAULT" nullable="false"/>
        <field name="ldapFilter" type="string" column="LDAP_FILTER" length="255" nullable="true"/>
        <field name="attributionAutomatique" type="boolean" column="ATTRIB_AUTO" nullable="false"/>
        <field name="theseDependant" type="boolean" column="THESE_DEP" nullable="false"/>
        <field name="sourceCode" type="string" column="SOURCE_CODE" length="100" nullable="true"/>

        <field name="histoCreation" type="datetime" column="HISTO_CREATION" nullable="false"/>
@@ -26,6 +27,18 @@
            </join-columns>
        </many-to-one>

        <many-to-one field="typeStructureDependant" target-entity="Application\Entity\Db\TypeStructure">
            <join-columns>
                <join-column name="TYPE_STRUCTURE_DEPENDANT_ID" referenced-column-name="ID"/>
            </join-columns>
        </many-to-one>

        <many-to-one field="structure" target-entity="Application\Entity\Db\Structure" fetch="LAZY">
            <join-columns>
                <join-column name="STRUCTURE_ID" referenced-column-name="ID"/>
            </join-columns>
        </many-to-one>

        <many-to-one field="source" target-entity="UnicaenImport\Entity\Db\Source">
            <join-columns>
                <join-column name="SOURCE_ID" referenced-column-name="ID"/>
+6
Changes for module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Structure.dcm.xml: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -12,6 +12,12 @@
        <field name="libelle"    type="string" column="LIBELLE"     length="128" nullable="false"/>
        <field name="cheminLogo" type="string" column="CHEMIN_LOGO" length="200" nullable="true"/>

        <many-to-one field="typeStructure" target-entity="Application\Entity\Db\TypeStructure">
            <join-columns>
                <join-column name="TYPE_STRUCTURE_ID" referenced-column-name="ID"/>
            </join-columns>
        </many-to-one>

        <one-to-one field="etablissement" target-entity="Application\Entity\Db\Etablissement" mapped-by="structure"/>
        <one-to-one field="ecoleDoctorale" target-entity="Application\Entity\Db\EcoleDoctorale" mapped-by="structure"/>
        <one-to-one field="uniteRecherche" target-entity="Application\Entity\Db\UniteRecherche" mapped-by="structure"/>
+10
Changes for module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.TypeStructure.dcm.xml: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
  <entity name="Application\Entity\Db\TypeStructure" table="TYPE_STRUCTURE">
    <id name="id" type="integer" column="ID">
      <generator strategy="SEQUENCE"/>
    </id>
    <field name="code" type="string" column="CODE" length="25" nullable="false"/>
    <field name="libelle" type="string" column="LIBELLE" length="60" nullable="true"/>
  </entity>
</doctrine-mapping>
+118 −6
Changes for module/Application/src/Application/Entity/Db/Role.php: 118 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -53,6 +53,16 @@ class Role extends AbstractRole
     */
    protected $etablissement;

    /**
     * @var TypeStructure
     */
    protected $typeStructureDependant;

    /**
     * @var Structure
     */
    protected $structure;

    /**
     * @var string Code unique *au sein d'un établissement*.
     */
@@ -63,14 +73,51 @@ class Role extends AbstractRole
     */
    protected $libelle;

    /**
     * @var bool
     */
    private $attributionAutomatique = false;

    /**
     * @var bool
     */
    private $theseDependant = false;

    /**
     * @return bool
     */
    public function estRoleDoctorant()
    public function isDoctorant()
    {
        return $this->getCode() === self::CODE_DOCTORANT;
    }

    /**
     * @return bool
     */
    public function isDirecteurThese()
    {
        return $this->getCode() === self::CODE_DIRECTEUR_THESE;
    }

    /**
     * @return Structure
     */
    public function getStructure()
    {
        return $this->structure;
    }

    /**
     * @param Structure $structure
     * @return Role
     */
    public function setStructure($structure)
    {
        $this->structure = $structure;

        return $this;
    }

    /**
     * @return Etablissement
     */
@@ -149,11 +196,6 @@ class Role extends AbstractRole
        return $this->sourceCode;
    }

    /**
     * @var bool
     */
    private $attributionAutomatique = false;

    /**
     * @return bool
     */
@@ -172,4 +214,74 @@ class Role extends AbstractRole

        return $this;
    }

    /**
     * @return bool
     */
    public function isTheseDependant()
    {
        return $this->theseDependant;
    }

    /**
     * @param bool $theseDependant
     * @return self
     */
    public function setTheseDependant($theseDependant = true)
    {
        $this->theseDependant = $theseDependant;

        return $this;
    }

    /**
     * @return TypeStructure
     */
    public function getTypeStructureDependant()
    {
        return $this->typeStructureDependant;
    }

    /**
     * @param TypeStructure $typeStructureDependant
     * @return self
     */
    public function setTypeStructureDependant(TypeStructure $typeStructureDependant)
    {
        $this->typeStructureDependant = $typeStructureDependant;

        return $this;
    }

    /**
     * @return bool
     */
    public function isEtablissementDependant()
    {
        return ($tsd = $this->getTypeStructureDependant()) && $tsd->isEtablissement();
    }

    /**
     * @return bool
     */
    public function isEcoleDoctoraleDependant()
    {
        return ($tsd = $this->getTypeStructureDependant()) && $tsd->isEcoleDoctorale();
    }

    /**
     * @return bool
     */
    public function isUniteRechercheDependant()
    {
        return ($tsd = $this->getTypeStructureDependant()) && $tsd->isUniteRecherche();
    }

    /**
     * @return bool
     */
    public function isStructureDependant()
    {
        return $this->getTypeStructureDependant() !== null;
    }
}
 No newline at end of file
Loading