Equipment.php 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854
  1. <?php
  2. namespace AppBundle\Entity\Product;
  3. use AppBundle\Annotation\ExportSplitFields;
  4. use AppBundle\Entity\AccessAndFunction\Access;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Dunglas\ApiBundle\Annotation\Iri;
  8. use Symfony\Component\Serializer\Annotation\Groups;
  9. use Symfony\Component\Validator\Constraints as Assert;
  10. use AppBundle\Entity\Traits\TimestampableEntity;
  11. use AppBundle\Entity\Traits\CreatorUpdaterEntity;
  12. use AppBundle\Entity\Person\Person;
  13. use AppBundle\Entity\Place\Room;
  14. use AppBundle\Entity\Place\Place;
  15. /**
  16. * Equipement, matériel
  17. *
  18. * @Iri("http://schema.org/Equipment")
  19. */
  20. #[ORM\Entity(repositoryClass: 'AppBundle\Entity\Product\Repository\EquipmentRepository')]
  21. class Equipment extends AbstractProduct
  22. {
  23. use TimestampableEntity;
  24. use CreatorUpdaterEntity;
  25. /**
  26. * @var Access
  27. */
  28. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access', inversedBy: 'equipments', cascade: ['persist'])]
  29. #[Groups(['equipment', 'equipment_list', 'equipmentcostume_list', 'accessequipment_grid', 'equipmentmediatheque_list'])]
  30. private $access;
  31. /**
  32. * @var string The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.
  33. *
  34. * @Iri("https://schema.org/brand")
  35. */
  36. #[ORM\Column(type: 'string', length: 40, nullable: true)]
  37. #[Assert\Type(type: 'string')]
  38. #[Groups(['equipment', 'equipment_reference', 'equipment_list', 'equipment_list_equipmentcomposition', 'equipmentrent_list_equipment', 'equipmentloan_list_equipment', 'equipmentcontrol_list_equipment', 'equipmentrepair_list_equipment', 'equipmentaccounting_list', 'equipmentcostume_list', 'place_list_equipmentuseds', 'accessequipment_grid_equipments', 'access_details_equipments', 'equipment_details', 'equipment_details_equipmentcomposition', 'own_access_equipments', 'own_student_access_equipments', 'event_details_equipments', 'course_details_equipments', 'examen_details_equipments', 'educationalproject_details_equipments', 'equipment_availability_form_equipment'])]
  39. private $brand;
  40. /**
  41. * @var string An associated image.
  42. *
  43. * @Iri("https://schema.org/image")
  44. */
  45. #[ORM\Column(type: 'string', nullable: true)]
  46. #[Assert\Type(type: 'string')]
  47. #[Groups(['equipment', 'equipment_details'])]
  48. private $image;
  49. /**
  50. * @var string The model of the product. Use with the URL of a ProductModel or a textual representation of the model identifier. The URL of the ProductModel can be from an external source. It is recommended to additionally provide strong product identifiers via the gtin8/gtin13/gtin14 and mpn properties.
  51. *
  52. * @Iri("https://schema.org/model")
  53. */
  54. #[ORM\Column(type: 'string', length: 40, nullable: true)]
  55. #[Assert\Type(type: 'string')]
  56. #[Groups(['equipment', 'equipment_reference', 'equipment_list', 'equipment_list_equipmentcomposition', 'equipmentrent_list_equipment', 'equipmentloan_list_equipment', 'equipmentcontrol_list_equipment', 'equipmentrepair_list_equipment', 'equipmentaccounting_list', 'equipmentcostume_list', 'place_list_equipmentuseds', 'accessequipment_grid_equipments', 'access_details_equipments', 'equipment_details', 'equipment_details_equipmentcomposition', 'own_access_equipments', 'own_student_access_equipments', 'event_details_equipments', 'course_details_equipments', 'examen_details_equipments', 'educationalproject_details_equipments', 'equipment_availability_form_equipment'])]
  57. private $model;
  58. /**
  59. * @var string The name of the item.
  60. *
  61. * @Iri("https://schema.org/name")
  62. */
  63. #[ORM\Column(type: 'string', nullable: true)]
  64. #[Assert\Type(type: 'string')]
  65. #[Groups(['equipment', 'equipment_reference', 'equipmentloan_list_equipment', 'equipmentmediatheque_list', 'place_list_equipmentuseds', 'examenconvocation_list_equipments', 'equipment_details_equipmentcomposition', 'event_details_equipments', 'course_details_equipments', 'examen_details_equipments', 'educationalproject_details_equipments', 'equipment_details', 'equipmentrent_list_equipment', 'equipment_availability_form_equipment'])]
  66. private $name;
  67. /**
  68. * @var string The product identifier, such as ISBN. For example: `<meta itemprop='productID' content='isbn:123-456-789'/>`.
  69. *
  70. * @Iri("https://schema.org/productID")
  71. */
  72. #[ORM\Column(type: 'string', length: 30, nullable: true)]
  73. #[Assert\Type(type: 'string')]
  74. #[Groups(['equipment', 'equipment_reference', 'equipmentrepair_list_equipment', 'accessequipment_grid_equipments', 'equipment_details', 'equipment_list', 'equipmentcostume_list', 'own_access_equipments', 'own_student_access_equipments', 'equipment_availability_form_equipment'])]
  75. private $productID;
  76. /**
  77. * @var string The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a product or service, or the product to which the offer refers.
  78. *
  79. * @Iri("https://schema.org/sku")
  80. */
  81. #[ORM\Column(type: 'string', length: 35, nullable: true)]
  82. #[Assert\Type(type: 'string')]
  83. #[Groups(['equipment', 'equipment_list', 'equipment_reference', 'equipmentrent_list_equipment', 'equipmentloan_list_equipment', 'equipmentcontrol_list_equipment', 'equipmentrepair_list_equipment', 'equipmentaccounting_list', 'equipmentcostume_list', 'equipment_details', 'equipmentmediatheque_list', 'equipment_availability_form_equipment'])]
  84. private $sku;
  85. /**
  86. * @var \DateTime The date the item e.g. vehicle was purchased by the current owner.
  87. *
  88. * @Iri("https://schema.org/purchaseDate")
  89. */
  90. #[ORM\Column(type: 'date', nullable: true)]
  91. #[Assert\Date]
  92. #[Groups(['equipment', 'equipment_list', 'equipmentaccounting_list', 'equipmentmediatheque_list', 'equipmentcostume_list', 'equipment_details'])]
  93. private $purchaseDate;
  94. /**
  95. * @var Place
  96. */
  97. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Place\Place', inversedBy: 'equipmentStorages')]
  98. #[ORM\JoinColumn(name: 'place_storage_id', nullable: true, onDelete: 'SET NULL')]
  99. #[Groups(['equipment', 'equipment_list', 'equipmentrent_list_equipment', 'equipmentloan_list_equipment', 'equipmentcontrol_list_equipment', 'equipmentrepair_list_equipment', 'equipmentaccounting_list', 'equipmentmediatheque_list', 'equipmentcostume_list', 'equipment_details'])]
  100. private $placeStorage;
  101. /**
  102. * @var Room
  103. */
  104. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Place\Room', inversedBy: 'equipmentStorages')]
  105. #[ORM\JoinColumn(name: 'room_storage_id', nullable: true, onDelete: 'SET NULL')]
  106. #[Groups(['equipment', 'equipment_list', 'equipmentrent_list_equipment', 'equipmentloan_list_equipment', 'equipmentcontrol_list_equipment', 'equipmentrepair_list_equipment', 'equipmentaccounting_list', 'equipmentmediatheque_list', 'equipmentcostume_list', 'equipment_details'])]
  107. private $roomStorage;
  108. /**
  109. * @var Place
  110. */
  111. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Place\Place', inversedBy: 'equipmentUseds')]
  112. #[ORM\JoinColumn(name: 'place_used_id', nullable: true, onDelete: 'SET NULL')]
  113. #[Groups(['equipment', 'equipment_list', 'equipmentrent_list_equipment', 'equipmentloan_list_equipment', 'equipmentcontrol_list_equipment', 'equipmentrepair_list_equipment', 'equipmentaccounting_list', 'equipmentmediatheque_list', 'equipmentcostume_list', 'equipment_details', 'equipment_reference'])]
  114. private $placeWhereIsUsed;
  115. /**
  116. * @var Room
  117. */
  118. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Place\Room', inversedBy: 'equipmentUseds')]
  119. #[ORM\JoinColumn(name: 'room_used_id', nullable: true, onDelete: 'SET NULL')]
  120. #[Groups(['equipment', 'equipment_list', 'equipmentrent_list_equipment', 'equipmentloan_list_equipment', 'equipmentcontrol_list_equipment', 'equipmentrepair_list_equipment', 'equipmentaccounting_list', 'equipmentmediatheque_list', 'equipmentcostume_list', 'equipment_details'])]
  121. private $roomWhereIsUsed;
  122. /**
  123. * @var string
  124. */
  125. #[ORM\Column(type: 'boolean', options: ['default' => true])]
  126. #[Assert\Type(type: 'boolean')]
  127. #[Assert\NotNull]
  128. #[Groups(['equipment', 'equipment_details'])]
  129. private $isSamePlaceToStockAndUsed = true;
  130. /**
  131. * @var string
  132. */
  133. #[ORM\Column(type: 'string', length: 100, nullable: true)]
  134. #[Assert\Type(type: 'string')]
  135. #[Groups(['equipment', 'equipment_list', 'equipmentrent_list_equipment', 'equipmentloan_list_equipment', 'equipmentcontrol_list_equipment', 'equipmentrepair_list_equipment', 'equipmentaccounting_list', 'equipmentmediatheque_list', 'equipmentcostume_list', 'equipment_details'])]
  136. private $additionalStoragePlace;
  137. /**
  138. * @var EquipmentList
  139. */
  140. #[ORM\ManyToOne(targetEntity: 'EquipmentList')]
  141. #[ORM\JoinColumn(nullable: true)]
  142. #[Groups(['equipment', 'equipment_reference', 'equipment_list', 'equipment_list_equipmentcomposition', 'equipmentrent_list_equipment', 'equipmentloan_list_equipment', 'equipmentcontrol_list_equipment', 'equipmentrepair_list_equipment', 'equipmentaccounting_list', 'equipmentcostume_list', 'place_list_equipmentuseds', 'accessequipment_grid_equipments', 'access_details_equipmentloans', 'access_details_equipments', 'equipment_details', 'equipment_details_equipmentcomposition', 'own_access_equipments', 'own_student_access_equipments', 'event_details_equipments', 'course_details_equipments', 'examen_details_equipments', 'educationalproject_details_equipments', 'equipment_availability_form_equipment'])]
  143. private $equipmentList;
  144. /**
  145. * @var ArrayCollection<EquipmentComposition>
  146. */
  147. #[ORM\OneToMany(targetEntity: 'EquipmentComposition', mappedBy: 'parent', orphanRemoval: true)]
  148. #[Groups(['equipment_equipmentcomposition', 'equipment_list', 'equipmentcostume_list', 'equipment_details'])]
  149. private $equipmentComposition;
  150. /**
  151. * @var ArrayCollection<EquipmentRepair>
  152. */
  153. #[ORM\OneToMany(targetEntity: 'EquipmentRepair', mappedBy: 'equipment', orphanRemoval: true)]
  154. #[Groups(['equipment_equipmentrepair', 'equipment_details'])]
  155. private $equipmentRepair;
  156. /**
  157. * @var ArrayCollection<EquipmentControl>
  158. */
  159. #[ORM\OneToMany(targetEntity: 'EquipmentControl', mappedBy: 'equipment', orphanRemoval: true, cascade: ['persist'])]
  160. #[Groups(['equipment_equipmentcontrol', 'equipment_details'])]
  161. private $equipmentControl;
  162. /**
  163. * @var ArrayCollection<EquipmentLoan>
  164. */
  165. #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Product\EquipmentLoan', mappedBy: 'equipment', orphanRemoval: true, cascade: ['persist'])]
  166. #[Groups(['equipment_equipmentloan', 'equipment_details', 'equipment_list', 'equipmentmediatheque_list', 'equipmentcostume_list'])]
  167. private $equipmentLoan;
  168. /**
  169. * @var ArrayCollection|EquipmentLoan[]
  170. */
  171. #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Product\EquipmentLoan', mappedBy: 'equipment', orphanRemoval: true, fetch: 'EXTRA_LAZY')]
  172. #[ORM\OrderBy(['id' => 'DESC'])]
  173. #[Groups(['equipment_details'])]
  174. private $equipmentLoanFiltered;
  175. /**
  176. * @var string
  177. */
  178. #[ORM\Column(type: 'string', length: 35, nullable: true)]
  179. #[Assert\Type(type: 'string')]
  180. #[Groups(['equipment', 'equipment_list', 'equipment_reference', 'equipmentrent_list_equipment', 'equipmentloan_list_equipment', 'equipmentcontrol_list_equipment', 'equipmentrepair_list_equipment', 'equipmentaccounting_list', 'equipmentcostume_list', 'equipment_details', 'equipmentmediatheque_list'])]
  181. private $skuComplementary;
  182. /**
  183. * @var string
  184. */
  185. #[ORM\Column(type: 'string', nullable: true)]
  186. #[Assert\Type(type: 'string')]
  187. #[Assert\Choice(callback: ['AppBundle\Enum\Product\EquipmentToneEnum', 'toArray'])]
  188. #[Groups(['equipment', 'equipment_list', 'equipmentcostume_list'])]
  189. private $tone;
  190. /**
  191. * @var string
  192. */
  193. #[ORM\Column(type: 'string', nullable: true)]
  194. #[Assert\Type(type: 'string')]
  195. #[Assert\Choice(callback: ['AppBundle\Enum\Product\EquipmentStatusEnum', 'toArray'])]
  196. #[Groups(['equipment', 'equipment_list', 'equipmentrent_list_equipment', 'equipmentloan_list_equipment', 'equipmentaccounting_list', 'equipmentmediatheque_list', 'equipmentcostume_list', 'equipment_details'])]
  197. private $status;
  198. /**
  199. * @var Access
  200. */
  201. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access', inversedBy: 'equipmentSuppliers')]
  202. #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
  203. #[Groups(['equipment', 'equipment_list', 'equipmentaccounting_list', 'equipmentmediatheque_list', 'equipmentcostume_list', 'equipment_details'])]
  204. private $supplier;
  205. /**
  206. * @var float
  207. */
  208. #[ORM\Column(type: 'float', nullable: true)]
  209. #[Assert\Type(type: 'float')]
  210. #[Groups(['equipment', 'equipment_list', 'equipmentaccounting_list', 'equipmentmediatheque_list', 'equipmentcostume_list', 'equipment_details'])]
  211. private $purchasePrice;
  212. /**
  213. * @var string
  214. */
  215. #[ORM\Column(type: 'string', length: 15, nullable: true)]
  216. #[Assert\Type(type: 'string')]
  217. #[Groups(['equipment', 'equipment_list', 'equipmentaccounting_list', 'equipmentmediatheque_list', 'equipmentcostume_list', 'equipment_details'])]
  218. private $billNumber;
  219. /**
  220. * @var float
  221. */
  222. #[ORM\Column(type: 'float', nullable: true)]
  223. #[Assert\Type(type: 'float')]
  224. #[Groups(['equipment', 'equipment_list', 'equipmentaccounting_list', 'equipmentmediatheque_list', 'equipmentcostume_list', 'equipment_details'])]
  225. private $tva;
  226. /**
  227. * @var string
  228. */
  229. #[ORM\Column(type: 'string', nullable: true)]
  230. #[Assert\Type(type: 'string')]
  231. #[Assert\Choice(callback: ['AppBundle\Enum\Product\OutCauseEnum', 'toArray'])]
  232. #[Groups(['equipment', 'equipment_list', 'equipmentaccounting_list', 'equipmentmediatheque_list', 'equipmentcostume_list', 'equipment_details'])]
  233. private $outCause;
  234. /**
  235. * @var string
  236. */
  237. #[ORM\Column(type: 'boolean', options: ['default' => false])]
  238. #[Assert\Type(type: 'boolean')]
  239. #[Assert\NotNull]
  240. #[Groups(['equipment', 'equipment_details'])]
  241. private $isComposition = false;
  242. /**
  243. * @var integer
  244. *
  245. *
  246. */
  247. #[ORM\Column(type: 'integer', nullable: true)]
  248. #[Assert\Type(type: 'integer', message: 'invalid-integer')]
  249. #[Groups(['equipment', 'equipment_list', 'equipmentaccounting_list', 'equipmentcostume_list', 'equipment_details', 'equipment_reference'])]
  250. private $qte;
  251. /**
  252. * @var string
  253. */
  254. #[ORM\Column(type: 'string', nullable: true)]
  255. #[Assert\Type(type: 'string')]
  256. #[Assert\Choice(callback: ['AppBundle\Enum\Product\CheckingEnum', 'toArray'])]
  257. #[Groups(['equipment'])]
  258. private $detailedChecking;
  259. /**
  260. * @var string
  261. */
  262. #[ORM\Column(type: 'string', nullable: true)]
  263. #[Assert\Type(type: 'string')]
  264. #[Assert\Choice(callback: ['AppBundle\Enum\Product\CheckingEnum', 'toArray'])]
  265. #[Groups(['equipment'])]
  266. private $checking;
  267. /**
  268. * @var Access
  269. */
  270. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access', inversedBy: 'equipmentControlManagers')]
  271. #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
  272. #[Groups(['equipment'])]
  273. private $controlManager;
  274. /**
  275. * @var integer
  276. */
  277. #[ORM\Column(type: 'integer', nullable: true)]
  278. #[Assert\Type(type: 'integer', message: 'invalid-integer')]
  279. #[Groups(['equipment'])]
  280. private $serviceLife;
  281. /**
  282. * @var integer
  283. */
  284. #[ORM\Column(type: 'integer', nullable: true)]
  285. #[Assert\Type(type: 'integer', message: 'invalid-integer')]
  286. #[Groups(['equipment'])]
  287. private $maxUsedHour;
  288. /**
  289. * @var string
  290. */
  291. #[ORM\Column(type: 'string', nullable: true)]
  292. #[Assert\Type(type: 'string')]
  293. #[Assert\Choice(callback: ['AppBundle\Enum\Product\EquipmentInsuranceEnum', 'toArray'])]
  294. #[Groups(['equipment', 'equipment_list', 'equipmentaccounting_list', 'equipmentcostume_list', 'accessequipment_grid_equipments', 'own_access_equipments', 'own_student_access_equipments'])]
  295. private $insurance;
  296. /**
  297. * @var string
  298. */
  299. #[ORM\Column(type: 'string', length: 100, nullable: true)]
  300. #[Assert\Type(type: 'string')]
  301. #[Assert\Length(max: 100, maxMessage: 'invalid-max-length')]
  302. #[Groups(['equipment', 'equipment_list', 'equipmentmediatheque_list', 'equipmentcostume_list', 'equipment_details'])]
  303. private $composer;
  304. /**
  305. * @var string
  306. */
  307. #[ORM\Column(type: 'string', length: 100, nullable: true)]
  308. #[Assert\Type(type: 'string')]
  309. #[Assert\Length(max: 100, maxMessage: 'invalid-max-length')]
  310. #[Groups(['equipment', 'equipmentmediatheque_list'])]
  311. private $arranger;
  312. /**
  313. * @var string
  314. */
  315. #[ORM\Column(type: 'string', length: 100, nullable: true)]
  316. #[Assert\Type(type: 'string')]
  317. #[Assert\Length(max: 100, maxMessage: 'invalid-max-length')]
  318. #[Groups(['equipment'])]
  319. private $referenceEditor;
  320. /**
  321. * @var string
  322. */
  323. #[ORM\Column(type: 'string', nullable: true)]
  324. #[Assert\Type(type: 'string')]
  325. #[Assert\Choice(callback: ['AppBundle\Enum\Product\OriginMusicScoreEnum', 'toArray'])]
  326. #[Groups(['equipment', 'equipment_list', 'equipmentmediatheque_list', 'equipmentcostume_list', 'equipment_details'])]
  327. private $origin;
  328. /**
  329. * @var bool
  330. */
  331. #[ORM\Column(type: 'boolean', options: ['default' => false])]
  332. #[Assert\Type(type: 'boolean')]
  333. #[Assert\NotNull]
  334. #[Groups(['equipment', 'equipment_list', 'equipmentmediatheque_list', 'equipmentcostume_list', 'equipment_details'])]
  335. private $presenceDriver = false;
  336. /**
  337. * @var Access
  338. */
  339. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access', inversedBy: 'equipmentEditors', cascade: ['persist'])]
  340. #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
  341. #[Groups(['equipment', 'access', 'equipment_details', 'equipmentmediatheque_list'])]
  342. private $editor;
  343. /**
  344. * @var string
  345. */
  346. #[ORM\Column(type: 'string', nullable: true)]
  347. #[Assert\Type(type: 'string')]
  348. #[Assert\Choice(callback: ['AppBundle\Enum\Product\BandEnum', 'toArray'])]
  349. #[Groups(['equipment', 'equipment_list', 'equipmentmediatheque_list', 'equipmentcostume_list', 'equipment_details'])]
  350. private $band;
  351. /**
  352. * @var string
  353. */
  354. #[ORM\Column(type: 'string', nullable: true)]
  355. #[Assert\Type(type: 'string')]
  356. #[Groups(['equipment', 'equipmentmediatheque_list', 'equipment_details'])]
  357. private $style;
  358. /**
  359. * @var int
  360. */
  361. #[ORM\Column(type: 'integer', nullable: true)]
  362. #[Assert\Type(type: 'integer', message: 'invalid-integer')]
  363. #[Groups(['equipment', 'equipmentmediatheque_list', 'equipment_details'])]
  364. private $duration;
  365. /**
  366. * @var string
  367. */
  368. #[ORM\Column(type: 'string', nullable: true)]
  369. #[Assert\Type(type: 'string')]
  370. #[Assert\Choice(callback: ['AppBundle\Enum\Product\DifficultyEnum', 'toArray'], message: 'invalid-choice')]
  371. #[Groups(['equipment', 'equipment_list', 'equipmentmediatheque_list', 'equipmentcostume_list', 'equipment_details'])]
  372. private $difficulty;
  373. /**
  374. * @var ArrayCollection<EquipmentList>
  375. */
  376. #[ORM\ManyToMany(targetEntity: 'AppBundle\Entity\Product\EquipmentList')]
  377. #[ORM\JoinTable(joinColumns: [], inverseJoinColumns: [])]
  378. #[ORM\JoinColumn(name: 'equipment_id', referencedColumnName: 'id')]
  379. #[ORM\JoinColumn(name: 'equipmentlist_id', referencedColumnName: 'id')]
  380. #[Groups(['equipment', 'equipment_equipmentlist', 'equipmentmediatheque_list', 'equipment_details'])]
  381. private $instrumentOrVoice;
  382. /**
  383. * @var integer
  384. */
  385. #[ORM\Column(type: 'integer', nullable: true)]
  386. #[Assert\Type(type: 'integer', message: 'invalid-integer')]
  387. #[Groups(['equipment', 'equipment_list', 'equipmentcostume_list', 'equipment_details'])]
  388. private $breakingLoad;
  389. /**
  390. * @var integer
  391. */
  392. #[ORM\Column(type: 'integer', nullable: true)]
  393. #[Assert\Type(type: 'integer', message: 'invalid-integer')]
  394. #[Groups(['equipment', 'equipment_list', 'equipmentcostume_list', 'equipment_details'])]
  395. private $mua;
  396. /**
  397. * @var integer
  398. */
  399. #[ORM\Column(type: 'integer', nullable: true)]
  400. #[Assert\Type(type: 'integer', message: 'invalid-integer')]
  401. #[Groups(['equipment', 'equipment_list', 'equipmentcostume_list', 'equipment_details'])]
  402. private $cmu;
  403. /**
  404. * @var integer
  405. */
  406. #[ORM\Column(type: 'integer', nullable: true)]
  407. #[Assert\Type(type: 'integer', message: 'invalid-integer')]
  408. #[Groups(['equipment', 'equipment_list', 'equipmentcostume_list', 'equipment_details'])]
  409. private $cmr;
  410. /**
  411. * @var integer
  412. */
  413. #[ORM\Column(type: 'integer', nullable: true)]
  414. #[Assert\Type(type: 'integer', message: 'invalid-integer')]
  415. #[Groups(['equipment', 'equipment_list', 'equipmentcostume_list', 'equipment_details'])]
  416. private $verticalEffort;
  417. /**
  418. * @var integer
  419. */
  420. #[ORM\Column(type: 'integer', nullable: true)]
  421. #[Assert\Type(type: 'integer', message: 'invalid-integer')]
  422. #[Groups(['equipment', 'equipment_list', 'equipmentcostume_list', 'equipment_details'])]
  423. private $horizontalEffort;
  424. /**
  425. * @var integer
  426. */
  427. #[ORM\Column(type: 'integer', nullable: true)]
  428. #[Assert\Type(type: 'integer', message: 'invalid-integer')]
  429. #[Groups(['equipment', 'equipmentcontrol_list_equipment', 'equipment_details'])]
  430. private $theoreticalServiceLifeControl;
  431. /**
  432. * @var integer
  433. */
  434. #[ORM\Column(type: 'integer', nullable: true)]
  435. #[Assert\Type(type: 'integer', message: 'invalid-integer')]
  436. #[Groups(['equipment', 'equipmentcontrol_list_equipment', 'equipment_details'])]
  437. private $maximumDurationOfUseControl;
  438. /**
  439. * @var string
  440. */
  441. #[ORM\Column(type: 'string', nullable: true)]
  442. #[Assert\Type(type: 'string')]
  443. #[Assert\Choice(callback: ['AppBundle\Enum\Product\PeriodicityControlEnum', 'toArray'])]
  444. #[Groups(['equipment', 'equipmentcontrol_list_equipment', 'equipment_details'])]
  445. private $periodicityControl;
  446. /**
  447. * @var Access
  448. */
  449. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access')]
  450. #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
  451. #[Groups(['equipment', 'equipmentcontrol_list_equipment', 'equipment_details'])]
  452. private $managerControl;
  453. /**
  454. * @var \DateTime
  455. */
  456. #[ORM\Column(type: 'time', nullable: true)]
  457. #[Assert\Time]
  458. #[Groups(['equipment', 'equipmentmediatheque_list', 'equipment_details'])]
  459. private $durationTime;
  460. /**
  461. * @var string
  462. *
  463. *
  464. */
  465. #[ORM\Column(type: 'string', nullable: true)]
  466. #[Assert\Type(type: 'string')]
  467. #[Groups(['equipment', 'equipment_details'])]
  468. private $isbn;
  469. /**
  470. * @var string
  471. * @ExportSplitFields({"equipmentList.familly","equipmentList.category","name","brand","model"})
  472. *
  473. */
  474. #[Groups(['template', 'place_list_equipmentuseds'])]
  475. private $fullLabelTemplate;
  476. public function __construct()
  477. {
  478. parent::__construct();
  479. $this->instrumentOrVoice = new ArrayCollection();
  480. $this->equipmentComposition = new ArrayCollection();
  481. $this->equipmentRepair = new ArrayCollection();
  482. $this->equipmentControl = new ArrayCollection();
  483. $this->equipmentLoan = new ArrayCollection();
  484. $this->equipmentLoanFiltered = new ArrayCollection();
  485. }
  486. /**
  487. * Sets access.
  488. *
  489. * @param Access $access
  490. *
  491. * @return $this
  492. */
  493. public function setAccess(Access $access = null)
  494. {
  495. $this->access = $access;
  496. return $this;
  497. }
  498. /**
  499. * Gets access.
  500. *
  501. * @return Access
  502. */
  503. public function getAccess()
  504. {
  505. return $this->access;
  506. }
  507. /**
  508. * Sets brand.
  509. *
  510. * @param string $brand
  511. *
  512. * @return $this
  513. */
  514. public function setBrand($brand)
  515. {
  516. $this->brand = $brand;
  517. return $this;
  518. }
  519. /**
  520. * Gets brand.
  521. *
  522. * @return string
  523. */
  524. public function getBrand()
  525. {
  526. return $this->brand;
  527. }
  528. /**
  529. * Sets image.
  530. *
  531. * @param string $image
  532. *
  533. * @return $this
  534. */
  535. public function setImage($image)
  536. {
  537. $this->image = $image;
  538. return $this;
  539. }
  540. /**
  541. * Gets image.
  542. *
  543. * @return string
  544. */
  545. public function getImage()
  546. {
  547. return $this->image;
  548. }
  549. /**
  550. * Sets model.
  551. *
  552. * @param string $model
  553. *
  554. * @return $this
  555. */
  556. public function setModel($model)
  557. {
  558. $this->model = $model;
  559. return $this;
  560. }
  561. /**
  562. * Gets model.
  563. *
  564. * @return string
  565. */
  566. public function getModel()
  567. {
  568. return $this->model;
  569. }
  570. /**
  571. * Sets name.
  572. *
  573. * @param string $name
  574. *
  575. * @return $this
  576. */
  577. public function setName($name)
  578. {
  579. $this->name = $name;
  580. return $this;
  581. }
  582. /**
  583. * Gets name.
  584. *
  585. * @return string
  586. */
  587. public function getName()
  588. {
  589. return $this->name;
  590. }
  591. /**
  592. * Sets productID.
  593. *
  594. * @param string $productID
  595. *
  596. * @return $this
  597. */
  598. public function setProductID($productID)
  599. {
  600. $this->productID = $productID;
  601. return $this;
  602. }
  603. /**
  604. * Gets productID.
  605. *
  606. * @return string
  607. */
  608. public function getProductID()
  609. {
  610. return $this->productID;
  611. }
  612. /**
  613. * Sets sku.
  614. *
  615. * @param string $sku
  616. *
  617. * @return $this
  618. */
  619. public function setSku($sku)
  620. {
  621. $this->sku = $sku;
  622. return $this;
  623. }
  624. /**
  625. * Gets sku.
  626. *
  627. * @return string
  628. */
  629. public function getSku()
  630. {
  631. return $this->sku;
  632. }
  633. /**
  634. * Sets purchaseDate.
  635. *
  636. * @param \DateTime $purchaseDate
  637. *
  638. * @return $this
  639. */
  640. public function setPurchaseDate(\DateTime $purchaseDate = null)
  641. {
  642. $this->purchaseDate = $purchaseDate;
  643. return $this;
  644. }
  645. /**
  646. * Gets purchaseDate.
  647. *
  648. * @return \DateTime
  649. */
  650. public function getPurchaseDate()
  651. {
  652. return $this->purchaseDate ? $this->purchaseDate->format('Y-m-d') : $this->purchaseDate;
  653. }
  654. /**
  655. * Sets placeStorage.
  656. *
  657. * @param Place $placeStorage
  658. *
  659. * @return $this
  660. */
  661. public function setPlaceStorage(Place $placeStorage = null)
  662. {
  663. $this->placeStorage = $placeStorage;
  664. return $this;
  665. }
  666. /**
  667. * Gets placeStorage.
  668. *
  669. * @return Place
  670. */
  671. public function getPlaceStorage()
  672. {
  673. return $this->placeStorage;
  674. }
  675. /**
  676. * Sets roomStorage.
  677. *
  678. * @param Room $roomStorage
  679. *
  680. * @return $this
  681. */
  682. public function setRoomStorage(Room $roomStorage = null)
  683. {
  684. $this->roomStorage = $roomStorage;
  685. return $this;
  686. }
  687. /**
  688. * Gets roomStorage.
  689. *
  690. * @return Room
  691. */
  692. public function getRoomStorage()
  693. {
  694. return $this->roomStorage;
  695. }
  696. /**
  697. * Sets placeWhereIsUsed
  698. *
  699. * @param Place $placeWhereIsUsed
  700. *
  701. * @return $this
  702. */
  703. public function setPlaceWhereIsUsed(Place $placeWhereIsUsed = null)
  704. {
  705. $this->placeWhereIsUsed = $placeWhereIsUsed;
  706. return $this;
  707. }
  708. /**
  709. * Gets placeWhereIsUsed
  710. *
  711. * @return Place
  712. */
  713. public function getPlaceWhereIsUsed()
  714. {
  715. return $this->placeWhereIsUsed;
  716. }
  717. /**
  718. * Sets roomWhereIsUsed
  719. *
  720. * @param Room $roomWhereIsUsed
  721. *
  722. * @return $this
  723. */
  724. public function setRoomWhereIsUsed(Room $roomWhereIsUsed = null)
  725. {
  726. $this->roomWhereIsUsed = $roomWhereIsUsed;
  727. return $this;
  728. }
  729. /**
  730. * Gets roomWhereIsUsed
  731. *
  732. * @return Room
  733. */
  734. public function getRoomWhereIsUsed()
  735. {
  736. return $this->roomWhereIsUsed;
  737. }
  738. /**
  739. * Sets additionalStoragePlace.
  740. *
  741. * @param string $additionalStoragePlace
  742. *
  743. * @return $this
  744. */
  745. public function setAdditionalStoragePlace($additionalStoragePlace)
  746. {
  747. $this->additionalStoragePlace = $additionalStoragePlace;
  748. return $this;
  749. }
  750. /**
  751. * Gets additionalStoragePlace.
  752. *
  753. * @return string
  754. */
  755. public function getAdditionalStoragePlace()
  756. {
  757. return $this->additionalStoragePlace;
  758. }
  759. /**
  760. * Sets equipmentList.
  761. *
  762. * @param EquipmentList $equipmentList
  763. *
  764. * @return $this
  765. */
  766. public function setEquipmentList(EquipmentList $equipmentList = null)
  767. {
  768. $this->equipmentList = $equipmentList;
  769. return $this;
  770. }
  771. /**
  772. * Gets equipmentList.
  773. *
  774. * @return EquipmentList
  775. */
  776. public function getEquipmentList()
  777. {
  778. return $this->equipmentList;
  779. }
  780. /**
  781. * Sets skuComplementary.
  782. *
  783. * @param string $skuComplementary
  784. *
  785. * @return $this
  786. */
  787. public function setSkuComplementary($skuComplementary)
  788. {
  789. $this->skuComplementary = $skuComplementary;
  790. return $this;
  791. }
  792. /**
  793. * Gets skuComplementary.
  794. *
  795. * @return string
  796. */
  797. public function getSkuComplementary()
  798. {
  799. return $this->skuComplementary;
  800. }
  801. /**
  802. * Sets tone.
  803. *
  804. * @param string $tone
  805. *
  806. * @return $this
  807. */
  808. public function setTone($tone)
  809. {
  810. $this->tone = $tone;
  811. return $this;
  812. }
  813. /**
  814. * Gets tone.
  815. *
  816. * @return string
  817. */
  818. public function getTone()
  819. {
  820. return $this->tone;
  821. }
  822. /**
  823. * Sets status.
  824. *
  825. * @param string $status
  826. *
  827. * @return $this
  828. */
  829. public function setStatus($status)
  830. {
  831. $this->status = $status;
  832. return $this;
  833. }
  834. /**
  835. * Gets status.
  836. *
  837. * @return string
  838. */
  839. public function getStatus()
  840. {
  841. return $this->status;
  842. }
  843. /**
  844. * Sets supplier.
  845. *
  846. * @param Access $supplier
  847. *
  848. * @return $this
  849. */
  850. public function setSupplier(Access $supplier = null)
  851. {
  852. $this->supplier = $supplier;
  853. return $this;
  854. }
  855. /**
  856. * Gets supplier.
  857. *
  858. * @return Access
  859. */
  860. public function getSupplier()
  861. {
  862. return $this->supplier;
  863. }
  864. /**
  865. * Sets purchasePrice.
  866. *
  867. * @param float $purchasePrice
  868. *
  869. * @return $this
  870. */
  871. public function setPurchasePrice($purchasePrice)
  872. {
  873. $this->purchasePrice = floatval($purchasePrice);
  874. return $this;
  875. }
  876. /**
  877. * Gets purchasePrice.
  878. *
  879. * @return float
  880. */
  881. public function getPurchasePrice()
  882. {
  883. return $this->purchasePrice;
  884. }
  885. /**
  886. * Sets billNumber.
  887. *
  888. * @param string $billNumber
  889. *
  890. * @return $this
  891. */
  892. public function setBillNumber($billNumber)
  893. {
  894. $this->billNumber = $billNumber;
  895. return $this;
  896. }
  897. /**
  898. * Gets billNumber.
  899. *
  900. * @return string
  901. */
  902. public function getBillNumber()
  903. {
  904. return $this->billNumber;
  905. }
  906. /**
  907. * Sets tva.
  908. *
  909. * @param float $tva
  910. *
  911. * @return $this
  912. */
  913. public function setTva($tva)
  914. {
  915. $this->tva = floatval($tva);
  916. return $this;
  917. }
  918. /**
  919. * Gets tva.
  920. *
  921. * @return float
  922. */
  923. public function getTva()
  924. {
  925. return $this->tva;
  926. }
  927. /**
  928. * Sets outCause.
  929. *
  930. * @param string $outCause
  931. *
  932. * @return $this
  933. */
  934. public function setOutCause($outCause)
  935. {
  936. $this->outCause = $outCause;
  937. return $this;
  938. }
  939. /**
  940. * Gets outCause.
  941. *
  942. * @return string
  943. */
  944. public function getOutCause()
  945. {
  946. return $this->outCause;
  947. }
  948. /**
  949. * Sets owner.
  950. *
  951. * @param Person person
  952. *
  953. * @return $this
  954. */
  955. public function setPerson(Person $person = null)
  956. {
  957. $this->person = $person;
  958. return $this;
  959. }
  960. /**
  961. * Gets person.
  962. *
  963. * @return Person
  964. */
  965. public function getPerson()
  966. {
  967. return $this->person;
  968. }
  969. /**
  970. * Sets isComposition
  971. *
  972. * @param bool $isComposition
  973. *
  974. * @return $this
  975. */
  976. public function setIsComposition($isComposition)
  977. {
  978. $this->isComposition = $isComposition;
  979. return $this;
  980. }
  981. /**
  982. * Gets isComposition
  983. *
  984. * @return bool
  985. */
  986. public function getIsComposition()
  987. {
  988. return $this->isComposition;
  989. }
  990. /**
  991. * Sets amount.
  992. *
  993. * @param integer $qte
  994. *
  995. * @return $this
  996. */
  997. public function setQte($qte)
  998. {
  999. $this->qte = $qte;
  1000. return $this;
  1001. }
  1002. /**
  1003. * Gets qte.
  1004. *
  1005. * @return integer
  1006. */
  1007. public function getQte()
  1008. {
  1009. if(!$this->isComposition)
  1010. return null;
  1011. return $this->qte;
  1012. }
  1013. /**
  1014. * Sets detailedChecking.
  1015. *
  1016. * @param string $detailedChecking
  1017. *
  1018. * @return $this
  1019. */
  1020. public function setDetailedChecking($detailedChecking)
  1021. {
  1022. $this->detailedChecking = $detailedChecking;
  1023. return $this;
  1024. }
  1025. /**
  1026. * Gets detailedChecking.
  1027. *
  1028. * @return string
  1029. */
  1030. public function getDetailedChecking()
  1031. {
  1032. return $this->detailedChecking;
  1033. }
  1034. /**
  1035. * Sets checking.
  1036. *
  1037. * @param string $checking
  1038. *
  1039. * @return $this
  1040. */
  1041. public function setChecking($checking)
  1042. {
  1043. $this->checking = $checking;
  1044. return $this;
  1045. }
  1046. /**
  1047. * Gets checking.
  1048. *
  1049. * @return string
  1050. */
  1051. public function getChecking()
  1052. {
  1053. return $this->checking;
  1054. }
  1055. /**
  1056. * Sets controlManager.
  1057. *
  1058. * @param Access $controlManager
  1059. *
  1060. * @return $this
  1061. */
  1062. public function setControlManager(Access $controlManager = null)
  1063. {
  1064. $this->controlManager = $controlManager;
  1065. return $this;
  1066. }
  1067. /**
  1068. * Gets controlManager.
  1069. *
  1070. * @return Access
  1071. */
  1072. public function getControlManager()
  1073. {
  1074. return $this->controlManager;
  1075. }
  1076. /**
  1077. * Sets serviceLife.
  1078. *
  1079. * @param integer $serviceLife
  1080. *
  1081. * @return $this
  1082. */
  1083. public function setServiceLife($serviceLife)
  1084. {
  1085. $this->serviceLife = $serviceLife;
  1086. return $this;
  1087. }
  1088. /**
  1089. * Gets serviceLife.
  1090. *
  1091. * @return integer
  1092. */
  1093. public function getServiceLife()
  1094. {
  1095. return $this->serviceLife;
  1096. }
  1097. /**
  1098. * Sets MaxUsedHour.
  1099. *
  1100. * @param integer $maxUsedHour
  1101. *
  1102. * @return $this
  1103. */
  1104. public function setMaxUsedHour($maxUsedHour)
  1105. {
  1106. $this->maxUsedHour = $maxUsedHour;
  1107. return $this;
  1108. }
  1109. /**
  1110. * Gets MaxUsedHour.
  1111. *
  1112. * @return integer
  1113. */
  1114. public function getMaxUsedHour()
  1115. {
  1116. return $this->maxUsedHour;
  1117. }
  1118. /**
  1119. * Sets insurance.
  1120. *
  1121. * @param string $insurance
  1122. *
  1123. * @return $this
  1124. */
  1125. public function setInsurance($insurance)
  1126. {
  1127. $this->insurance = $insurance;
  1128. return $this;
  1129. }
  1130. /**
  1131. * Gets insurance.
  1132. *
  1133. * @return string
  1134. */
  1135. public function getInsurance()
  1136. {
  1137. return $this->insurance;
  1138. }
  1139. /**
  1140. * Sets composer.
  1141. *
  1142. * @param string $composer
  1143. *
  1144. * @return $this
  1145. */
  1146. public function setComposer($composer)
  1147. {
  1148. $this->composer = $composer;
  1149. return $this;
  1150. }
  1151. /**
  1152. * Gets composer.
  1153. *
  1154. * @return string
  1155. */
  1156. public function getComposer()
  1157. {
  1158. return $this->composer;
  1159. }
  1160. /**
  1161. * Sets arranger.
  1162. *
  1163. * @param string $arranger
  1164. *
  1165. * @return $this
  1166. */
  1167. public function setArranger($arranger)
  1168. {
  1169. $this->arranger = $arranger;
  1170. return $this;
  1171. }
  1172. /**
  1173. * Gets arranger.
  1174. *
  1175. * @return string
  1176. */
  1177. public function getArranger()
  1178. {
  1179. return $this->arranger;
  1180. }
  1181. /**
  1182. * Sets referenceEditor.
  1183. *
  1184. * @param string $referenceEditor
  1185. *
  1186. * @return $this
  1187. */
  1188. public function setReferenceEditor($referenceEditor)
  1189. {
  1190. $this->referenceEditor = $referenceEditor;
  1191. return $this;
  1192. }
  1193. /**
  1194. * Gets referenceEditor.
  1195. *
  1196. * @return string
  1197. */
  1198. public function getReferenceEditor()
  1199. {
  1200. return $this->referenceEditor;
  1201. }
  1202. /**
  1203. * Sets origin.
  1204. *
  1205. * @param string $origin
  1206. *
  1207. * @return $this
  1208. */
  1209. public function setOrigin($origin)
  1210. {
  1211. $this->origin = $origin;
  1212. return $this;
  1213. }
  1214. /**
  1215. * Gets origin.
  1216. *
  1217. * @return string
  1218. */
  1219. public function getOrigin()
  1220. {
  1221. return $this->origin;
  1222. }
  1223. /**
  1224. * Sets presenceDriver.
  1225. *
  1226. * @param bool $presenceDriver
  1227. *
  1228. * @return $this
  1229. */
  1230. public function setPresenceDriver($presenceDriver)
  1231. {
  1232. if(!$presenceDriver) $presenceDriver = false;
  1233. $this->presenceDriver = $presenceDriver;
  1234. return $this;
  1235. }
  1236. /**
  1237. * Gets presenceDriver.
  1238. *
  1239. * @return bool
  1240. */
  1241. public function getPresenceDriver()
  1242. {
  1243. return $this->presenceDriver;
  1244. }
  1245. /**
  1246. * Sets editor.
  1247. *
  1248. * @param Access $editor
  1249. *
  1250. * @return $this
  1251. */
  1252. public function setEditor(Access $editor = null)
  1253. {
  1254. $this->editor = $editor;
  1255. return $this;
  1256. }
  1257. /**
  1258. * Gets editor.
  1259. *
  1260. * @return Access
  1261. */
  1262. public function getEditor()
  1263. {
  1264. return $this->editor;
  1265. }
  1266. /**
  1267. * Sets band.
  1268. *
  1269. * @param string $band
  1270. *
  1271. * @return $this
  1272. */
  1273. public function setBand($band)
  1274. {
  1275. $this->band = $band;
  1276. return $this;
  1277. }
  1278. /**
  1279. * Gets band.
  1280. *
  1281. * @return string
  1282. */
  1283. public function getBand()
  1284. {
  1285. return $this->band;
  1286. }
  1287. /**
  1288. * Sets style.
  1289. *
  1290. * @param string $style
  1291. *
  1292. * @return $this
  1293. */
  1294. public function setStyle($style)
  1295. {
  1296. $this->style = $style;
  1297. return $this;
  1298. }
  1299. /**
  1300. * Gets style.
  1301. *
  1302. * @return string
  1303. */
  1304. public function getStyle()
  1305. {
  1306. return $this->style;
  1307. }
  1308. /**
  1309. * Sets duration.
  1310. *
  1311. * @param int $duration
  1312. *
  1313. * @return $this
  1314. */
  1315. public function setDuration($duration)
  1316. {
  1317. $this->duration = $duration;
  1318. return $this;
  1319. }
  1320. /**
  1321. * Gets duration.
  1322. *
  1323. * @return int
  1324. */
  1325. public function getDuration()
  1326. {
  1327. return $this->duration;
  1328. }
  1329. /**
  1330. * Sets difficulty.
  1331. *
  1332. * @param string $difficulty
  1333. *
  1334. * @return $this
  1335. */
  1336. public function setDifficulty($difficulty)
  1337. {
  1338. $this->difficulty = $difficulty;
  1339. return $this;
  1340. }
  1341. /**
  1342. * Gets difficulty.
  1343. *
  1344. * @return string
  1345. */
  1346. public function getDifficulty()
  1347. {
  1348. return $this->difficulty;
  1349. }
  1350. /**
  1351. * Adds instrumentOrVoice.
  1352. *
  1353. * @param EquipmentList $instrumentOrVoice
  1354. *
  1355. * @return $this
  1356. */
  1357. public function addInstrumentOrVoice($instrumentOrVoice)
  1358. {
  1359. $this->instrumentOrVoice[] = $instrumentOrVoice;
  1360. return $this;
  1361. }
  1362. /**
  1363. * Removes instrumentOrVoice.
  1364. *
  1365. * @param EquipmentList $instrumentOrVoice
  1366. *
  1367. * @return $this
  1368. */
  1369. public function removeInstrumentOrVoice($instrumentOrVoice)
  1370. {
  1371. $this->instrumentOrVoice->removeElement($instrumentOrVoice);
  1372. return $this;
  1373. }
  1374. /**
  1375. * Gets instrumentOrVoice.
  1376. *
  1377. * @return ArrayCollection<MaterialList>
  1378. */
  1379. public function getInstrumentOrVoice()
  1380. {
  1381. return array_values($this->instrumentOrVoice->toArray());
  1382. }
  1383. /**
  1384. * Gets breakingLoad.
  1385. *
  1386. * @return integer
  1387. */
  1388. public function getBreakingLoad()
  1389. {
  1390. return $this->breakingLoad;
  1391. }
  1392. /**
  1393. * Sets breakingLoad.
  1394. *
  1395. * @param integer $breakingLoad
  1396. *
  1397. * @return $this
  1398. */
  1399. public function setBreakingLoad($breakingLoad)
  1400. {
  1401. $this->breakingLoad = $breakingLoad;
  1402. return $this;
  1403. }
  1404. /**
  1405. * Gets mua.
  1406. *
  1407. * @return integer
  1408. */
  1409. public function getMua()
  1410. {
  1411. return $this->mua;
  1412. }
  1413. /**
  1414. * Sets mua.
  1415. *
  1416. * @param integer $mua
  1417. *
  1418. * @return $this
  1419. */
  1420. public function setMua($mua)
  1421. {
  1422. $this->mua = $mua;
  1423. return $this;
  1424. }
  1425. /**
  1426. * Gets cmu.
  1427. *
  1428. * @return integer
  1429. */
  1430. public function getCmu()
  1431. {
  1432. return $this->cmu;
  1433. }
  1434. /**
  1435. * Sets cmu.
  1436. *
  1437. * @param integer $cmu
  1438. *
  1439. * @return $this
  1440. */
  1441. public function setCmu($cmu)
  1442. {
  1443. $this->cmu = $cmu;
  1444. return $this;
  1445. }
  1446. /**
  1447. * Gets cmr.
  1448. *
  1449. * @return integer
  1450. */
  1451. public function getCmr()
  1452. {
  1453. return $this->cmr;
  1454. }
  1455. /**
  1456. * Sets cmr.
  1457. *
  1458. * @param integer $cmr
  1459. *
  1460. * @return $this
  1461. */
  1462. public function setCmr($cmr)
  1463. {
  1464. $this->cmr = $cmr;
  1465. return $this;
  1466. }
  1467. /**
  1468. * Gets verticalEffort.
  1469. *
  1470. * @return integer
  1471. */
  1472. public function getVerticalEffort()
  1473. {
  1474. return $this->verticalEffort;
  1475. }
  1476. /**
  1477. * Sets verticalEffort.
  1478. *
  1479. * @param integer $verticalEffort
  1480. *
  1481. * @return $this
  1482. */
  1483. public function setVerticalEffort($verticalEffort)
  1484. {
  1485. $this->verticalEffort = $verticalEffort;
  1486. return $this;
  1487. }
  1488. /**
  1489. * Gets horizontalEffort.
  1490. *
  1491. * @return integer
  1492. */
  1493. public function getHorizontalEffort()
  1494. {
  1495. return $this->horizontalEffort;
  1496. }
  1497. /**
  1498. * Sets horizontalEffort.
  1499. *
  1500. * @param integer $horizontalEffort
  1501. *
  1502. * @return $this
  1503. */
  1504. public function setHorizontalEffort($horizontalEffort)
  1505. {
  1506. $this->horizontalEffort = $horizontalEffort;
  1507. return $this;
  1508. }
  1509. /**
  1510. * @param EquipmentComposition $equipmentComposition
  1511. * @return $this
  1512. */
  1513. public function addEquipmentComposition(EquipmentComposition $equipmentComposition)
  1514. {
  1515. $equipmentComposition->setParent($this);
  1516. $this->equipmentComposition[] = $equipmentComposition;
  1517. return $this;
  1518. }
  1519. /**
  1520. * @return ArrayCollection
  1521. */
  1522. public function getEquipmentComposition()
  1523. {
  1524. return $this->equipmentComposition;
  1525. }
  1526. /**
  1527. * Remove $equipmentComposition
  1528. *
  1529. * @param \AppBundle\Entity\Product\EquipmentComposition $equipmentComposition
  1530. */
  1531. public function removeEquipmentComposition(EquipmentComposition $equipmentComposition)
  1532. {
  1533. $this->equipmentComposition->removeElement($equipmentComposition);
  1534. }
  1535. /**
  1536. * @param EquipmentRepair $equipmentRepair
  1537. * @return $this
  1538. */
  1539. public function addEquipmentRepair(EquipmentRepair $equipmentRepair)
  1540. {
  1541. $equipmentRepair->setEquipment($this);
  1542. $this->equipmentRepair[] = $equipmentRepair;
  1543. return $this;
  1544. }
  1545. /**
  1546. * @return ArrayCollection
  1547. */
  1548. public function getEquipmentRepair()
  1549. {
  1550. return $this->equipmentRepair;
  1551. }
  1552. /**
  1553. * Remove equipmentRepair
  1554. *
  1555. * @param \AppBundle\Entity\Product\EquipmentRepair $equipmentRepair
  1556. */
  1557. public function removeEquipmentRepair(EquipmentRepair $equipmentRepair)
  1558. {
  1559. $this->equipmentRepair->removeElement($equipmentRepair);
  1560. }
  1561. /**
  1562. * @param EquipmentControl $equipmentControl
  1563. * @return $this
  1564. */
  1565. public function addEquipmentControl(EquipmentControl $equipmentControl)
  1566. {
  1567. $equipmentControl->setEquipment($this);
  1568. $this->equipmentControl[] = $equipmentControl;
  1569. return $this;
  1570. }
  1571. /**
  1572. * @return ArrayCollection
  1573. */
  1574. public function getEquipmentControl()
  1575. {
  1576. return $this->equipmentControl;
  1577. }
  1578. /**
  1579. * Remove equipmentControl
  1580. *
  1581. * @param \AppBundle\Entity\Product\EquipmentControl $equipmentControl
  1582. */
  1583. public function removeEquipmentControl(\AppBundle\Entity\Product\EquipmentControl $equipmentControl)
  1584. {
  1585. $this->equipmentControl->removeElement($equipmentControl);
  1586. }
  1587. /**
  1588. * @param EquipmentLoan $equipmentLoan
  1589. * @return $this
  1590. */
  1591. public function addEquipmentLoan(EquipmentLoan $equipmentLoan)
  1592. {
  1593. $equipmentLoan->setEquipment($this);
  1594. $this->equipmentLoan[] = $equipmentLoan;
  1595. return $this;
  1596. }
  1597. /**
  1598. * @return ArrayCollection
  1599. */
  1600. public function getEquipmentLoan()
  1601. {
  1602. return $this->equipmentLoan;
  1603. }
  1604. /**
  1605. * Remove equipmentLoan
  1606. *
  1607. * @param \AppBundle\Entity\Product\EquipmentLoan $equipmentLoan
  1608. */
  1609. public function removeEquipmentLoan(EquipmentLoan $equipmentLoan)
  1610. {
  1611. $this->equipmentLoan->removeElement($equipmentLoan);
  1612. }
  1613. /**
  1614. * Get equipmentLoans
  1615. *
  1616. * @return \Doctrine\Common\Collections\Collection
  1617. */
  1618. public function getEquipmentLoanFiltered()
  1619. {
  1620. $filtered = array_filter($this->equipmentLoan->toArray(), function($equipmentLoansFiltered) {
  1621. return is_null($equipmentLoansFiltered->getEndDate());
  1622. });
  1623. $filteredArray = new ArrayCollection(array_values($filtered));
  1624. return $filteredArray;
  1625. }
  1626. /**
  1627. * Set theoreticalServiceLifeControl
  1628. *
  1629. * @param integer $theoreticalServiceLifeControl
  1630. *
  1631. * @return Equipment
  1632. */
  1633. public function setTheoreticalServiceLifeControl($theoreticalServiceLifeControl)
  1634. {
  1635. $this->theoreticalServiceLifeControl = $theoreticalServiceLifeControl;
  1636. return $this;
  1637. }
  1638. /**
  1639. * Get theoreticalServiceLifeControl
  1640. *
  1641. * @return integer
  1642. */
  1643. public function getTheoreticalServiceLifeControl()
  1644. {
  1645. return $this->theoreticalServiceLifeControl;
  1646. }
  1647. /**
  1648. * Set maximumDurationOfUseControl
  1649. *
  1650. * @param integer $maximumDurationOfUseControl
  1651. *
  1652. * @return Equipment
  1653. */
  1654. public function setMaximumDurationOfUseControl($maximumDurationOfUseControl)
  1655. {
  1656. $this->maximumDurationOfUseControl = $maximumDurationOfUseControl;
  1657. return $this;
  1658. }
  1659. /**
  1660. * Get maximumDurationOfUseControl
  1661. *
  1662. * @return integer
  1663. */
  1664. public function getMaximumDurationOfUseControl()
  1665. {
  1666. return $this->maximumDurationOfUseControl;
  1667. }
  1668. /**
  1669. * Set periodicityControl
  1670. *
  1671. * @param string $periodicityControl
  1672. *
  1673. * @return Equipment
  1674. */
  1675. public function setPeriodicityControl($periodicityControl)
  1676. {
  1677. $this->periodicityControl = $periodicityControl;
  1678. return $this;
  1679. }
  1680. /**
  1681. * Get periodicityControl
  1682. *
  1683. * @return string
  1684. */
  1685. public function getPeriodicityControl()
  1686. {
  1687. return $this->periodicityControl;
  1688. }
  1689. /**
  1690. * Set managerControl
  1691. *
  1692. * @param \AppBundle\Entity\AccessAndFunction\Access $managerControl
  1693. *
  1694. * @return Equipment
  1695. */
  1696. public function setManagerControl(\AppBundle\Entity\AccessAndFunction\Access $managerControl = null)
  1697. {
  1698. $this->managerControl = $managerControl;
  1699. return $this;
  1700. }
  1701. /**
  1702. * Get managerControl
  1703. *
  1704. * @return \AppBundle\Entity\AccessAndFunction\Access
  1705. */
  1706. public function getManagerControl()
  1707. {
  1708. return $this->managerControl;
  1709. }
  1710. /**
  1711. * Gets full label.
  1712. *
  1713. * @return array
  1714. */
  1715. public function getFullLabelTemplate()
  1716. {
  1717. $fullLabel = [];
  1718. if(!empty($this->getEquipmentList())){
  1719. $fullLabel[] = ['value' => $this->getEquipmentList()->getFamilly(), 'translate' => true];
  1720. $fullLabel[] = ['value' => $this->getEquipmentList()->getCategory(), 'translate' => true];
  1721. }
  1722. $fullLabel[] = $this->getName();
  1723. $fullLabel[] = $this->getBrand();
  1724. $fullLabel[] = $this->getModel();
  1725. return $fullLabel;
  1726. }
  1727. /**
  1728. * Set isSamePlaceToStockAndUsed
  1729. *
  1730. * @param boolean $isSamePlaceToStockAndUsed
  1731. *
  1732. * @return Equipment
  1733. */
  1734. public function setIsSamePlaceToStockAndUsed($isSamePlaceToStockAndUsed)
  1735. {
  1736. $this->isSamePlaceToStockAndUsed = $isSamePlaceToStockAndUsed;
  1737. return $this;
  1738. }
  1739. /**
  1740. * Get isSamePlaceToStockAndUsed
  1741. *
  1742. * @return boolean
  1743. */
  1744. public function getIsSamePlaceToStockAndUsed()
  1745. {
  1746. return $this->isSamePlaceToStockAndUsed;
  1747. }
  1748. /**
  1749. * Set isbn
  1750. *
  1751. * @param string $isbn
  1752. *
  1753. * @return Equipment
  1754. */
  1755. public function setIsbn($isbn)
  1756. {
  1757. $this->isbn = $isbn;
  1758. return $this;
  1759. }
  1760. /**
  1761. * Get isbn
  1762. *
  1763. * @return string
  1764. */
  1765. public function getIsbn()
  1766. {
  1767. return $this->isbn;
  1768. }
  1769. /**
  1770. * Sets duration.
  1771. *
  1772. * @param \DateTime $durationTime
  1773. *
  1774. * @return $this
  1775. */
  1776. public function setDurationTime($durationTime)
  1777. {
  1778. $this->durationTime = $durationTime;
  1779. return $this;
  1780. }
  1781. /**
  1782. * Gets duration.
  1783. *
  1784. * @return \DateTime
  1785. */
  1786. public function getDurationTime()
  1787. {
  1788. return $this->durationTime ? $this->durationTime->format('H:i:s') : $this->durationTime;
  1789. }
  1790. }