<?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\DepartementRepository" name="App\Entity\Departement" table="departement">
    <id name="id" type="integer" column="id">
      <generator strategy="IDENTITY"/>
    </id>
    <field name="nom" type="text" column="nom" precision="0" scale="0" nullable="false"/>
    <field name="telephone" type="string" column="telephone" length="20" precision="0" scale="0" nullable="false"/>
    <field name="telephoneInterne" type="string" column="telephoneInterne" length="20" precision="0" scale="0" nullable="false"/>
    <field name="numero" type="integer" column="numero" precision="0" scale="0" nullable="false"/>
    <field name="logo" type="string" column="logo" precision="0" scale="0" nullable="true"/>
    <field name="heureOuverturePublic" type="datetime" column="heureOuverturePublic" precision="0" scale="0" nullable="true"/>
    <field name="heureFermeturePublic" type="datetime" column="heureFermeturePublic" precision="0" scale="0" nullable="true"/>
    <field name="note" type="text" column="note" precision="0" scale="0" nullable="true"/>
    <field name="moovroom" type="boolean" column="moovroom" nullable="true"/>
    <field name="entityManagerName" type="string" column="entityManagerName" length="250" precision="0" scale="0" nullable="true"/>
    <field name="couleur" type="string" column="couleur" length="255" 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"/>
    <one-to-many field="chambres" target-entity="App\Entity\Chambre" mapped-by="service" fetch="LAZY">
        <cascade>
            <cascade-persist/>
            <cascade-remove/>
        </cascade>
    </one-to-many>
    <many-to-one field="structure" target-entity="App\Entity\Structure" inversed-by="departements" fetch="LAZY">
      <join-columns>
        <join-column name="structure_id" referenced-column-name="id" nullable=""/>
      </join-columns>
    </many-to-one>
    <many-to-one field="chefService" target-entity="App\Entity\Personnel" inversed-by="servicesGeres" fetch="LAZY">
      <join-columns>
        <join-column name="chefService" referenced-column-name="id" nullable="1"/>
      </join-columns>
    </many-to-one>
    <many-to-many field="personnels" target-entity="App\Entity\Personnel" mapped-by="departements" fetch="LAZY"/>
    <many-to-many field="questionnaires" target-entity="App\Entity\Questionnaire" mapped-by="departements" fetch="LAZY"/>

    <many-to-many field="fiches" target-entity="Fiche" mapped-by="services" />
    <lifecycle-callbacks>
      <lifecycle-callback type="prePersist" method="preUpload"/>
      <lifecycle-callback type="preUpdate" method="preUpload"/>
      <lifecycle-callback type="postPersist" method="upload"/>
      <lifecycle-callback type="postUpdate" method="upload"/>
      <lifecycle-callback type="preRemove" method="storeFilenameForRemove"/>
      <lifecycle-callback type="postRemove" method="removeUpload"/>
    </lifecycle-callbacks>
  </entity>
</doctrine-mapping>
