src/Entity/Backend/Comite.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Backend;
  3. use Doctrine\ORM\Mapping AS ORM;
  4. use Gedmo\Mapping\Annotation as Gedmo;
  5. // use BeSimple\SoapBundle\ServiceDefinition\Annotation as Soap;
  6. /**
  7. * @ORM\Entity(repositoryClass="App\Repository\Backend\ComiteRepository")
  8. * @ORM\Table(name="Comite")
  9. * Soap\Alias("Comite")
  10. */
  11. class Comite {
  12. /**
  13. * @ORM\Id
  14. * @ORM\Column(type="integer", length=8)
  15. * @ORM\GeneratedValue(strategy="AUTO")
  16. * Soap\ComplexType("int", nillable=true)
  17. */
  18. private $id;
  19. /**
  20. * @ORM\Column(type="string", length=255, nullable=false)
  21. * Soap\ComplexType("string", nillable=true)
  22. */
  23. private $nombre;
  24. /**
  25. * @ORM\Column(type="string", length=255, nullable=false)
  26. * Soap\ComplexType("string", nillable=true)
  27. */
  28. private $nombre_corto;
  29. /**
  30. * @ORM\Column(type="boolean", nullable=false)
  31. * Soap\ComplexType("string", nillable=true)
  32. */
  33. private $activo;
  34. /**
  35. * @ORM\Column(type="string", length=255, nullable=false)
  36. * Soap\ComplexType("string", nillable=true)
  37. * @Gedmo\Slug(fields={"nombre"})
  38. */
  39. private $slug;
  40. /**
  41. * @ORM\Column(type="smallint")
  42. *
  43. */
  44. private $rfga_id;
  45. /**
  46. * @ORM\ManyToOne(targetEntity="App\Entity\Backend\Cliente")
  47. * @ORM\JoinColumn(name="Cliente_id", referencedColumnName="id")
  48. * */
  49. private $cliente;
  50. /**
  51. * @ORM\Column(type="string", length=255, nullable=true)
  52. *
  53. */
  54. private $url;
  55. /**
  56. * @ORM\Column(type="string", length=255, nullable=true)
  57. */
  58. private $code;
  59. /**
  60. * @ORM\OneToMany(targetEntity="\App\Entity\Backend\AsignacionAnualComite", mappedBy="comite")
  61. * @ORM\OrderBy({"anio" = "ASC"})
  62. *
  63. */
  64. private $asignacion_anual;
  65. /**
  66. * @ORM\OneToMany(targetEntity="\App\Entity\Backend\DocumentoContabilidad", mappedBy="comite")
  67. * @ORM\OrderBy({"id" = "DESC"})
  68. *
  69. */
  70. private $documentoscontabilidad;
  71. /**
  72. * @ORM\ManyToMany(targetEntity="App\Entity\Backend\Agrupacion", mappedBy="comites")
  73. */
  74. private $agrupaciones;
  75. /**
  76. * @ORM\Column(name="tipo", type="enumtipocomite", nullable=false)
  77. */
  78. private $tipo;
  79. /**
  80. * @ORM\Column(name="active_federation", type="boolean", nullable=false)
  81. */
  82. private bool $active_federation;
  83. /**
  84. * Get id
  85. *
  86. * @return integer
  87. */
  88. public function getId() {
  89. return $this->id;
  90. }
  91. /**
  92. * Set nombre
  93. *
  94. * @param string $nombre
  95. * @return Comite
  96. */
  97. public function setNombre($nombre) {
  98. $this->nombre = $nombre;
  99. return $this;
  100. }
  101. /**
  102. * Get nombre
  103. *
  104. * @return string
  105. */
  106. public function getNombre() {
  107. return $this->nombre;
  108. }
  109. /**
  110. * Set nombre_corto
  111. *
  112. * @param string $nombreCorto
  113. * @return Comite
  114. */
  115. public function setNombreCorto($nombreCorto) {
  116. $this->nombre_corto = $nombreCorto;
  117. return $this;
  118. }
  119. /**
  120. * Get nombre_corto
  121. *
  122. * @return string
  123. */
  124. public function getNombreCorto() {
  125. return $this->nombre_corto;
  126. }
  127. /**
  128. * Set activo
  129. *
  130. * @param boolean $activo
  131. * @return Comite
  132. */
  133. public function setActivo($activo) {
  134. $this->activo = $activo;
  135. return $this;
  136. }
  137. /**
  138. * Get activo
  139. *
  140. * @return boolean
  141. */
  142. public function getActivo() {
  143. return $this->activo;
  144. }
  145. public function __toString() {
  146. return $this->getNombreCorto() . ($this->cliente ? " (" . $this->cliente->getNombreCorto() . ")" : "");
  147. }
  148. /**
  149. * Set slug
  150. *
  151. * @param string $slug
  152. * @return Comite
  153. */
  154. public function setSlug($slug) {
  155. $this->slug = $slug;
  156. return $this;
  157. }
  158. /**
  159. * Get slug
  160. *
  161. * @return string
  162. */
  163. public function getSlug() {
  164. return $this->slug;
  165. }
  166. /**
  167. * Set rfga_id
  168. *
  169. * @param integer $rfgaId
  170. * @return Comite
  171. */
  172. public function setRfgaId($rfgaId) {
  173. $this->rfga_id = $rfgaId;
  174. return $this;
  175. }
  176. /**
  177. * Get rfga_id
  178. *
  179. * @return integer
  180. */
  181. public function getRfgaId() {
  182. return $this->rfga_id;
  183. }
  184. /**
  185. * Set cliente
  186. *
  187. * @param Cliente $cliente
  188. * @return Comite
  189. */
  190. public function setCliente(Cliente $cliente = null) {
  191. $this->cliente = $cliente;
  192. return $this;
  193. }
  194. /**
  195. * Get cliente
  196. *
  197. * @return Cliente
  198. */
  199. public function getCliente() {
  200. return $this->cliente;
  201. }
  202. /**
  203. * Set url
  204. *
  205. * @param string $url
  206. * @return Comite
  207. */
  208. public function setUrl($url) {
  209. $this->url = $url;
  210. return $this;
  211. }
  212. /**
  213. * Get url
  214. *
  215. * @return string
  216. */
  217. public function getUrl() {
  218. return $this->url;
  219. }
  220. /**
  221. * Set code
  222. *
  223. * @param string|null $code
  224. * @return Comite
  225. */
  226. public function setCode($code) {
  227. $this->code = $code;
  228. return $this;
  229. }
  230. /**
  231. * Get code
  232. *
  233. * @return string|null
  234. */
  235. public function getCode() {
  236. return $this->code;
  237. }
  238. /**
  239. * Constructor
  240. */
  241. public function __construct() {
  242. $this->asignacion_anual = new \Doctrine\Common\Collections\ArrayCollection();
  243. $this->documentoscontabilidad = new \Doctrine\Common\Collections\ArrayCollection();
  244. $this->agrupaciones = new \Doctrine\Common\Collections\ArrayCollection();
  245. }
  246. /**
  247. * Add asignacion_anual
  248. *
  249. * @param \App\Entity\Backend\AsignacionAnualComite $asignacionAnual
  250. * @return Comite
  251. */
  252. public function addAsignacionAnual(\App\Entity\Backend\AsignacionAnualComite $asignacionAnual) {
  253. $this->asignacion_anual[] = $asignacionAnual;
  254. return $this;
  255. }
  256. /**
  257. * Remove asignacion_anual
  258. *
  259. * @param \App\Entity\Backend\AsignacionAnualComite $asignacionAnual
  260. */
  261. public function removeAsignacionAnual(\App\Entity\Backend\AsignacionAnualComite $asignacionAnual) {
  262. $this->asignacion_anual->removeElement($asignacionAnual);
  263. }
  264. /**
  265. * Get asignacion_anual
  266. *
  267. * @return \Doctrine\Common\Collections\Collection
  268. */
  269. public function getAsignacionAnual() {
  270. return $this->asignacion_anual;
  271. }
  272. /**
  273. * Get asignacion_anual
  274. *
  275. * @return \Doctrine\Common\Collections\Collection
  276. */
  277. public function getAsignacionAnualAnio($anio) {
  278. $asig = 0;
  279. $aa_array = $this->getAsignacionAnual();
  280. foreach ($aa_array as $an) {
  281. if ($an->getAnio() == $anio) {
  282. $asig = $an->getAsignacion();
  283. }
  284. }
  285. return $asig;
  286. }
  287. public function getAsignacionActual() {
  288. $anio = date("Y");
  289. $asig = 0;
  290. $aa_array = $this->getAsignacionAnual();
  291. foreach ($aa_array as $an) {
  292. if ($an->getAnio() == $anio) {
  293. $asig = $an->getAsignacion();
  294. break;
  295. }
  296. }
  297. return $asig;
  298. }
  299. public function getPresupuestadoGeneralActual() {
  300. $anio = date("Y");
  301. $asig = 0;
  302. $aa_array = $this->getAsignacionAnual();
  303. foreach ($aa_array as $an) {
  304. if ($an->getAnio() == $anio) {
  305. $asig = $an->getGeneral();
  306. break;
  307. }
  308. }
  309. return $asig;
  310. }
  311. /**
  312. * Add asignacion_anual
  313. *
  314. * @param \App\Entity\Backend\DocumentoContabilidad $documentoContabilidad
  315. * @return Comite
  316. */
  317. public function addDocumentoContabilidad(\App\Entity\Backend\DocumentoContabilidad $documentoContabilidad) {
  318. $this->documentoscontabilidad[] = $documentoContabilidad;
  319. return $this;
  320. }
  321. /**
  322. * Remove asignacion_anual
  323. *
  324. * @param \App\Entity\Backend\DocumentoContabilidad $documentoContabilidad
  325. */
  326. public function removeDocumentoContabilidad(\App\Entity\Backend\DocumentoContabilidad $documentoContabilidad) {
  327. $this->documentoscontabilidad->removeElement($documentoContabilidad);
  328. }
  329. /**
  330. * Get asignacion_anual
  331. *
  332. * @return \Doctrine\Common\Collections\Collection
  333. */
  334. public function getDocumentosContabilidad() {
  335. return $this->documentoscontabilidad;
  336. }
  337. /**
  338. * Add agrupacion
  339. *
  340. * @param \App\Entity\Backend\Agrupacion $agrupacion
  341. * @return Comite
  342. */
  343. public function addAgrupacion(\App\Entity\Backend\Agrupacion $agrupacion) {
  344. $this->agrupaciones[] = $agrupacion;
  345. return $this;
  346. }
  347. /**
  348. * Remove agrupacion
  349. *
  350. * @param \App\Entity\Backend\Agrupacion $agrupacion
  351. */
  352. public function removeAgrupacion(\App\Entity\Backend\Agrupacion $agrupacion) {
  353. $this->agrupaciones->removeElement($agrupacion);
  354. }
  355. /**
  356. * Get agrupaciones
  357. *
  358. * @return \Doctrine\Common\Collections\Collection
  359. */
  360. public function getAgrupaciones() {
  361. return $this->agrupaciones;
  362. }
  363. /**
  364. * Set tipo
  365. *
  366. * @param boolean $tipo
  367. *
  368. * @return Comite
  369. */
  370. public function setTipo($tipo) {
  371. $this->tipo = $tipo;
  372. return $this;
  373. }
  374. /**
  375. * Get tipo
  376. *
  377. * @return bool
  378. */
  379. public function getTipo() {
  380. return $this->tipo;
  381. }
  382. /**
  383. * Get active_federation
  384. *
  385. * @return bool
  386. */
  387. public function getActiveFederation(): bool
  388. {
  389. return $this->active_federation;
  390. }
  391. /**
  392. * Set active_federation
  393. *
  394. * @param boolean $active_federation
  395. *
  396. * @return Comite
  397. */
  398. public function setActiveFederation(bool $active_federation): self
  399. {
  400. $this->active_federation = $active_federation;
  401. return $this;
  402. }
  403. }