<?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 repository-class="App\Entity\StructureRepository" name="App\Entity\Structure" table="structure">
    <id name="id" type="integer" column="id">
      <generator strategy="IDENTITY"/>
    </id>
    <field name="nom" type="string" column="nom" length="40" precision="0" scale="0" nullable="false"/>
    <field name="adresse" type="string" column="adresse" length="250" precision="0" scale="0" nullable="false"/>
    <field name="email" type="string" column="email" length="140" precision="0" scale="0" nullable="false"/>
    <field name="telephone" type="string" column="telephone" length="20" precision="0" scale="0" nullable="false"/>
    <field name="fax" type="string" column="fax" length="20" precision="0" scale="0" nullable="false"/>
    <field name="codePostal" type="string" column="codePostal" length="20" precision="0" scale="0" nullable="false"/>
    <field name="ville" type="string" column="ville" length="140" precision="0" scale="0" nullable="false"/>
    <field name="latitude" type="float" column="latitude" precision="0" scale="0" nullable="true"/>
    <field name="longitude" type="float" column="longitude" precision="0" scale="0" nullable="true"/>
    <field name="dateAjout" type="datetime" column="dateAjout" precision="0" scale="0" nullable="false"/>
    <field name="dateModification" type="datetime" column="dateModification" precision="0" scale="0" nullable="false"/>
    <field name="modifiePar" type="text" column="modifiePar" length="100" precision="0" scale="0" nullable="true"/>
    <field name="displayTracabilite" type="boolean" column="displayTracabilite" nullable="true"/>
    <field name="displayPortailIntranet" type="boolean" column="displayPortailIntranet" nullable="true"/>
    <field name="displayPartageDocuments" type="boolean" column="displayPartageDocuments" nullable="true"/>
    <field name="displayGestionPersonnel" type="boolean" column="displayGestionPersonnel" nullable="true"/>
    <field name="displayGestionMateriel" type="boolean" column="displayGestionMateriel" nullable="true"/>
    <field name="displayGestionLivraison" type="boolean" column="displayGestionLivraison" nullable="true"/>
    <field name="displayElfCleanOne" type="boolean" column="displayElfCleanOne" nullable="true"/>
    <field name="displayGestionContenu" type="boolean" column="displayGestionContenu" nullable="true"/>
    <field name="displayAutres" type="boolean" column="displayAutres" nullable="true"/>
    <field name="displayWidgets" type="boolean" column="displayWidgets" nullable="true"/>
    <field name="displayDayStats" type="boolean" column="displayDayStats" nullable="true"/>
    <field name="displayMoovroom" type="boolean" column="displayMoovroom" nullable="true"/>
    <field name="displayPrest" type="boolean" column="displayPrest" nullable="true"/>
    <field name="displayPrestAgent" type="boolean" column="displayPrestAgent" nullable="true"/>
    <field name="displayBloc" type="boolean" column="displayBloc" nullable="true"/>
    <one-to-many field="departements" target-entity="App\Entity\Departement" mapped-by="structure" fetch="LAZY"/>
    <one-to-many field="intitules" target-entity="App\Entity\Intitule" mapped-by="structure" fetch="LAZY"/>
    <one-to-many field="contenus" target-entity="App\Entity\PostForExterne" mapped-by="structure" fetch="LAZY"/>

    <one-to-one field="message" target-entity="Contact" mapped-by="structure" nullable="false">
    </one-to-one>

    <one-to-one field="defaultControleModel" target-entity="ControleModel" mapped-by="structureDefault" nullable="true">
    </one-to-one>

    <one-to-many field="controleModels" target-entity="ControleModel" mapped-by="etablissement" fetch="LAZY">
        <cascade>
            <cascade-persist/>
            <cascade-remove/>
        </cascade>
    </one-to-many>


    <one-to-many field="controles" target-entity="Controle" mapped-by="etablissement" fetch="LAZY">
        <cascade>
            <cascade-persist/>
            <cascade-remove/>
        </cascade>
    </one-to-many>

    <lifecycle-callbacks>
      <lifecycle-callback type="postUpdate" method="doUpdateDateModification"/>
      <lifecycle-callback type="preUpdate" method="doUpdateDateModification"/>
    </lifecycle-callbacks>
  </entity>
</doctrine-mapping>
