<?php
namespace App\Entity\Backend;
use App\DBAL\Backend\EnumLivescoringFormula;
use App\DBAL\Backend\EnumLivescoringPolicy;
use App\Entity\Gestion\Highlight;
use App\Util\Util;
use App\Util\UtilStatic;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use JMS\Serializer\Annotation\Type;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Validator\Constraints as Assert;
// use BeSimple\SoapBundle\ServiceDefinition\Annotation as Soap;
/**
* @ORM\Entity(repositoryClass="App\Repository\Backend\CompeticionRepository")
* @ORM\Table(
* name="Competicion",
* indexes={
* @ORM\Index(name="Competicion_estado_IDX", columns={"estado"}),
* @ORM\Index(name="Competicion_visible_IDX", columns={"visible"}),
* @ORM\Index(name="Competicion_rfc_IDX", columns={"rfc"}),
* @ORM\Index(name="fk_CompeticionFormula1", columns={"Formula_id"}),
* @ORM\Index(name="fk_CompeticionModo1", columns={"Modo_id"}),
* @ORM\Index(name="fk_CompeticionClub1", columns={"Club_id"}),
* @ORM\Index(name="fk_CompeticionCalculo1", columns={"Calculo_id"}),
* @ORM\Index(name="fk_CompeticionClub2", columns={"Organizador_id"}),
* @ORM\Index(name="fk_CompeticionCriterio1", columns={"Criterio_id"}),
* @ORM\Index(name="fk_CompeticionCriterio2", columns={"Criterio2_id"})
* }
* )
* @ORM\HasLifecycleCallbacks
* @Gedmo\SoftDeleteable(fieldName="deleted_at", timeAware=false)
* Soap\Alias("Competicion")
*/
class Competicion
{
/**
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @ORM\Column(type="integer", length=8)
* Soap\ComplexType("int",nillable=true)
*/
private $id;
/**
* @ORM\Column(type="string", length=8, nullable=true)
* Soap\ComplexType("string")
*/
private $codigo;
/**
* @ORM\Column(type="string", length=15, nullable=true)
* Soap\ComplexType("string")
*/
private $codigo_contable;
/**
* @ORM\Column(type="string", length=255)
* Soap\ComplexType("string")
*/
private $nombre;
/**
* @ORM\Column(type="date")
* Soap\ComplexType("date")
* @Type("DateTime<'Y-m-d\TH:i:s'>")
*/
private $fecha;
/**
* @ORM\Column(type="datetime",nullable=true)
* Soap\ComplexType("date", nillable=true)
* @Type("DateTime<'Y-m-d\TH:i:s'>")
*/
private $inicio;
/**
* @ORM\Column(type="datetime",nullable=true)
* Soap\ComplexType("date", nillable=true)
* @Type("DateTime<'Y-m-d\TH:i:s'>")
*/
private $fin;
/**
* @ORM\Column(type="integer")
* Soap\ComplexType("int")
*/
private $plazas;
/**
* @ORM\Column(type="integer")
* Soap\ComplexType("int")
*/
private $jugadores;
/**
* @ORM\ManyToOne(targetEntity="Destacada")
* @ORM\JoinColumn(name="destacada", referencedColumnName="id", onDelete="restrict")
*
*/
//Soap\ComplexType("int", nillable=true)
private $destacada;
/**
* @ORM\Column(type="text",nullable=true)
* Soap\ComplexType("string", nillable=true)
*/
private $observaciones;
/**
* @ORM\Column(type="text",nullable=true)
*/
private $observaciones_planificacion;
/**
* @ORM\Column(type="text", nullable=true)
* Soap\ComplexType("string", nillable=true)
*/
private $aviso;
/**
* @ORM\Column(type="text",nullable=true)
* Soap\ComplexType("string", nillable=true)
*/
private $informacion;
// /**
// * @ORM\Column(type="date")
// * Soap\ComplexType("date")
// */
// private $created_at;
// /**
// * @ORM\Column(type="date")
// * Soap\ComplexType("date")
// */
// private $updated_at;
/**
* @ORM\Column(type="integer", length=8, nullable=true)
* Soap\ComplexType("int", nillable=true)
*/
private $rfeg_id;
/**
* @ORM\Column(name="cartel", type="string",nullable=true)
* Soap\ComplexType("string", nillable=true)
*/
private $cartel;
/**
* @Assert\File(maxSize="4M", maxSizeMessage = "El fichero es demasiado grande, debe ser menor de 4 mb", mimeTypes={"application/pdf", "image/jpeg"})
*/
public $file_cartel;
/**
* @ORM\Column(name="horario", type="string",nullable=true)
* Soap\ComplexType("string", nillable=true)
*/
private $horario;
/**
* @Assert\File(maxSize="4M", maxSizeMessage = "El fichero es demasiado grande, debe ser menor de 4 mb", mimeTypes={"application/pdf"})
*
*/
public $file_horario;
/**
* @ORM\Column(name="fichero_inscritos", type="string",nullable=true)
* Soap\ComplexType("string", nillable=true)
*/
private $fichero_inscritos;
/**
* @Assert\File(maxSize="4M", maxSizeMessage = "El fichero es demasiado grande, debe ser menor de 4 mb", mimeTypes={"application/pdf"})
*
*/
public $file_inscritos;
/**
* @ORM\Column(name="fichero_clasificaciones", type="string",nullable=true)
* Soap\ComplexType("string", nillable=true)
*/
private $fichero_clasificaciones;
/**
* @Assert\File(maxSize="4M", maxSizeMessage = "El fichero es demasiado grande, debe ser menor de 4 mb", mimeTypes={"application/pdf"})
*
*/
public $file_clasificaciones;
/**
* @ORM\Column(name="fichero_localeRulePdf", type="string",nullable=true)
* Soap\ComplexType("string", nillable=true)
*/
public $fichero_localeRulePdf;
/**
* @Assert\File(maxSize="4M", maxSizeMessage = "El fichero es demasiado grande, debe ser menor de 4 mb", mimeTypes={"application/pdf"})
*
*/
public $file_localeRulePdf;
/**
* @ORM\Column(name="fichero_banner_schedule", type="string",nullable=true)
* Soap\ComplexType("string", nillable=true)
*/
public $fichero_banner_schedule;
/**
* @Assert\File(maxSize="4M", maxSizeMessage = "La imagen es demasiado grande, debe ser menor de 4 mb", mimeTypes={"image/png", "image/jpeg", "image/jpg", "image/gif"})
*/
public $file_banner_schedule;
/**
* @ORM\Column(name="fichero_reglas", type="string",nullable=true)
* Soap\ComplexType("string", nillable=true)
*/
private $fichero_reglas;
/**
* @ORM\Column(name="fichero_varios_nombre", type="string",nullable=true)
* Soap\ComplexType("string", nillable=true)
*/
private $fichero_varios_nombre;
/**
* @ORM\Column(name="fichero_varios", type="string",nullable=true)
* Soap\ComplexType("string", nillable=true)
*/
private $fichero_varios;
/**
* @Assert\File(maxSize="4M", maxSizeMessage = "El fichero es demasiado grande, debe ser menor de 4 mb", mimeTypes={"application/pdf"})
*
*/
public $file_reglas;
/**
* @Assert\File(maxSize="4M", maxSizeMessage = "El fichero es demasiado grande, debe ser menor de 4 mb", mimeTypes={"application/pdf"})
*
*/
public $file_varios;
//Ficticios para el manejo de los ficheros
public $temp_reglas;
public $temp_clasificaciones;
public $temp_localeRulePdf;
public $temp_banner_schedule;
public $temp_inscritos;
public $temp_horario;
public $temp_cartel;
public $temp_varios;
/**
* @ORM\Column(type="string", length=255,nullable=true)
* Soap\ComplexType("string", nillable=true)
*/
private $circular;
/**
* @ORM\Column(type="string", length=255,nullable=true)
* Soap\ComplexType("string", nillable=true)
*/
private $nombre_observaciones;
/**
* @ORM\Column(type="boolean")
* Soap\ComplexType("boolean")
*/
// private $facturar_automatico;
/**
* @ORM\Column(type="boolean")
* Soap\ComplexType("boolean")
*/
//private $corte_cerrado;
//
//@ORM\Column(type="boolean")
// Soap\ComplexType("boolean")
//
//private $ega_actualizado;
/**
* @ORM\ManyToOne(targetEntity="Formula")
* @ORM\JoinColumn(name="Formula_id", referencedColumnName="id", onDelete="restrict")
* Soap\ComplexType("App\Entity\Backend\Formula", nillable=true)
* @Type("App\Entity\Backend\Formula")
*/
private $formula;
/**
* @ORM\ManyToOne(targetEntity="Modo")
* @ORM\JoinColumn(name="Modo_id", referencedColumnName="id", onDelete="restrict")
* Soap\ComplexType("App\Entity\Backend\Modo", nillable=true)
* @Type("App\Entity\Backend\Modo")
*/
private $modo;
/**
* @ORM\ManyToOne(targetEntity="Calculo")
* @ORM\JoinColumn(name="Calculo_id", referencedColumnName="id", onDelete="restrict")
* Soap\ComplexType("App\Entity\Backend\Calculo", nillable=true)
* @Type("App\Entity\Backend\Calculo")
*/
private $calculo;
/**
* @ORM\ManyToOne(targetEntity="Club")
* @ORM\JoinColumn(name="Club_id", referencedColumnName="id", onDelete="restrict")
* Soap\ComplexType("App\Entity\Backend\Club", nillable=true)
* @Type("App\Entity\Backend\Club")
*/
private $club;
/**
* @ORM\ManyToOne(targetEntity="Club")
* @ORM\JoinColumn(name="Organizador_id", referencedColumnName="id", onDelete="restrict")
* Soap\ComplexType("App\Entity\Backend\Club", nillable=true)
* @Type("App\Entity\Backend\Club")
*/
private $organizador;
/**
* Soap\ComplexType("App\Entity\Backend\Albaran", nillable=true)
* @Type("App\Entity\Backend\Albaran")
*/
private $albaran;
/**
* @ORM\OneToMany(targetEntity="Albaran", mappedBy="competicion")
* @ORM\OrderBy({"numero" = "ASC"})
* */
private $albaranes;
/**
* @ORM\ManyToOne(targetEntity="Criterio")
* @ORM\JoinColumn(name="Criterio_id", referencedColumnName="id", onDelete="restrict")
*
*/
// Soap\ComplexType("int", nillable=true)
private $criterio;
/**
* @ORM\ManyToOne(targetEntity="Criterio")
* @ORM\JoinColumn(name="Criterio2_id", referencedColumnName="id", onDelete="restrict")
*
*/
// Soap\ComplexType("int", nillable=true)
private $criterio2;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $hash;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Backend\Comite")
* @ORM\JoinTable(name="Comite_Competicion",
* joinColumns={@ORM\JoinColumn(name="competicion_id", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="Comite_id", referencedColumnName="id")}
* )
* @ORM\OrderBy({"cliente" = "ASC", "activo" = "DESC", "nombre" = "ASC"})
*/
private $comites;
/**
* @ORM\ManyToMany(targetEntity="\App\Entity\Backend\Circuito",inversedBy="competiciones")
* @ORM\JoinTable(name="Circuito_Competicion")
* )
* @ORM\OrderBy({"cliente" = "ASC", "fecha_inicio" = "ASC", "fecha_fin" = "ASC", "nombre" = "ASC"})
*/
private $circuitos;
/** @ORM\Column(type="enumestadocompeticion")
* Soap\ComplexType("string", nillable=true)
* @Type("string")
*/
private $estado;
/** @ORM\Column(type="enumestadocorte")
* Soap\ComplexType("string", nillable=true)
* @Type("string")
*/
private $estado_corte;
/**
* @var \DateTime $created_at
*
* @Gedmo\Timestampable(on="create")
* @ORM\Column(type="datetime",nullable=true)
* Soap\ComplexType("date")
* @Type("DateTime<'Y-m-d\TH:i:s'>")
*/
private $created_at;
/**
* @var \DateTime $updated_at
*
* @Gedmo\Timestampable(on="update")
* @ORM\Column(type="datetime",nullable=true)
* Soap\ComplexType("date")
* @Type("DateTime<'Y-m-d\TH:i:s'>")
*/
private $updated_at;
/**
* @ORM\OneToMany(targetEntity="Inscrito", mappedBy="competicion")
* */
private $inscritos;
/**
* @ORM\OneToMany(targetEntity="Categoria", mappedBy="competicion")
* */
private $categorias;
/**
* @ORM\OneToMany(targetEntity="Tarifa", mappedBy="competicion", cascade={"persist", "remove"}, orphanRemoval=true)
* */
private $tarifas;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $tarifa_reglamento;
/**
* @ORM\OneToMany(targetEntity="Jornada", mappedBy="competicion", cascade={"persist"})
* @ORM\OrderBy({"orden" = "ASC"})
* */
private $jornadas;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $redireccion;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $wagr = false;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $subvencion_junta = true;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $galeria;
/**
* @ORM\Column(type="text",nullable=true)
* Soap\ComplexType("string", nillable=true)
*/
private $informacion_popup;
/**
* @ORM\Column(type="text",nullable=true)
*
*/
private $reglas;
/**
* @ORM\Column(type="integer", length=2, nullable=false)
* Soap\ComplexType("int")
*/
private $num_competiciones = 0;
/**
* @ORM\Column(type="string", length=6, nullable=true)
* Soap\ComplexType("string", nillable=true)
*/
private $tag_color;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Backend\Club", inversedBy="solicitadas")
* @ORM\JoinTable(name="Club_Aspirante",
* joinColumns={@ORM\JoinColumn(name="competicion_id", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="club_id", referencedColumnName="id")}
* )
*/
private $aspirantes;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Backend\Club", inversedBy="preferencias")
* @ORM\JoinTable(name="Club_Preferente",
* joinColumns={@ORM\JoinColumn(name="competicion_id", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="club_id", referencedColumnName="id")}
* )
*/
private $preferentes;
/**
* @ORM\Column(type="enumestadolivescoring", nullable=true)
*
*/
private $show_live_scoring = "club";
/**
* @ORM\Column(type="boolean", nullable=false)
*
*/
private $rfc = false;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $estricto = true;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $hcp_estricto = false;
/**
* @ORM\Column(type="decimal", length=2, nullable=false, scale=1, options={"default" : 99})
* Soap\ComplexType("float")
*/
private $hcp_inscrito_masculino = 99; //26.4;
/**
* @ORM\Column(type="decimal", length=2, nullable=false, scale=1, options={"default" : -10})
* @Type("float")
* Soap\ComplexType("float")
*/
private $hcp_inscrito_masculino_min = -10; //
/**
* @ORM\Column(type="decimal", length=2, nullable=false, scale=1, options={"default" : 99})
* @Type("float")
* Soap\ComplexType("float")
*/
private $hcp_inscrito_femenino = 99; //36.0;
/**
* @ORM\Column(type="decimal", length=2, nullable=false, scale=1, options={"default" : -10})
* @Type("float")
* Soap\ComplexType("float")
*/
private $hcp_inscrito_femenino_min = -10; //El minimo handicap es
/**
* @ORM\Column(type="smallint", nullable=false, options={"default" : 70})
* Soap\ComplexType("int")
*/
private $hcp_juego_masculino = 70;
/**
* @ORM\Column(type="smallint", nullable=false, options={"default" : 70})
* Soap\ComplexType("int")
*/
private $hcp_juego_femenino = 70;
/**
* @ORM\Column(type="smallint", nullable=false, options={"default" : 99})
* Soap\ComplexType("int")
*/
private $hcp_juego_pareja = 99;
/**
* @ORM\Column(type="smallint", nullable=false, options={"default" : 999})
* Soap\ComplexType("int")
*/
private $hcp_juego_equipo = 999;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $premios;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $arbitrable = false;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $direccion_torneos = false;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $asistencia_presidente = false;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $institucional = false;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $voluntarios = false;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $flyer = false;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $permitir = false;
/**
* @ORM\Column(type="boolean", nullable=false)
*
*/
private $social = false;
/**
* @ORM\Column(type="boolean", nullable=false)
*
*/
private $visible = true;
/**
* @ORM\Column(type="boolean", nullable=false)
*
*/
private $seguimiento = false;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $popup_inscripcion = false;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $popup_inscripcion_texto;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $mostrar_sorteo = false;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $malaga2020 = false;
/**
* @ORM\OneToMany(targetEntity="DatoAdicional", mappedBy="competicion", cascade={"persist", "remove"}, orphanRemoval=true)
* */
private $adicionales;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $lista_espera = false;
/**
* @ORM\Column(type="enumestadorestringirlicencias", nullable=true)
*/
private $restringir_licencia;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $seleccion_tarifas = false;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $permitir_extranjeros = false;
/**
* @ORM\Column(type="smallint", nullable=true)
*/
private $plazas_manana;
/**
* @ORM\Column(type="smallint", nullable=true)
*/
private $plazas_tarde;
/**
* @ORM\Column(type="boolean", nullable=false)
* Soap\ComplexType("boolean")
*/
private $tarjeta_electronica = false;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $auto_assign_marker = false;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $livescoring_comunidad = false;
/**
* @ORM\Column(type="smallint", nullable=true)
*/
private $plazas_lista_espera;
/**
* @var \DateTime|null
*
* @ORM\Column(name="deleted_at", type="datetime", nullable=true)
*/
private $deleted_at;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $contacto;
/**
* @ORM\OneToMany(targetEntity="\App\Entity\Gestion\CompeticionRanking", mappedBy="competicion")
*
*/
private $rankings;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $benefico = false;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Backend\Voucher", inversedBy="competiciones")
* @ORM\JoinTable(name="Voucher_Competicion")
* @ORM\OrderBy({"fechaInicio" = "ASC", "fechaFin" = "ASC"})
*/
private $vouchers;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $flickr_gallery = null;
/**
* @ORM\Column(name="barra_salida", type="boolean", nullable=false)
*/
private $barra_salida = false;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default" : 0})
*/
private $observaciones_frontend = false;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $mostrar_plazas = true;
/**
* @ORM\Column(type="smallint", nullable=true, options={"default" : 1})
*/
private $politica_inicio = 1;
/**
* @ORM\Column(type="smallint", nullable=true, options={"default" : 1})
*/
private $politica_entrega = 1;
/**
* @ORM\Column(name="short_url", type="string", length=255, nullable=true)
*/
private $short_url;
/**
* @ORM\Column(type="boolean", options={"default" : 0})
*/
private $privada = false;
/**
* @ORM\OneToOne(targetEntity=MarcadorRfc::class, mappedBy="competicion", cascade={"persist", "remove"})
*/
private $marcadorRfc;
/**
* @ORM\OneToMany(targetEntity=MensajeTorneo::class, mappedBy="competicion")
*/
private $mensajeTorneos;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gestion\Ronda", mappedBy="competicion")
*/
private $rondas;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $camera_url;
/**
* @ORM\Column(type="enumtipoconfiguracionmatchplay", nullable=true)
*/
private $tipo_configuracion_matchplay;
/**
* @ORM\Column(type="date", nullable=true)
* @Type("DateTime<'Y-m-d'>")
*/
private $liquidation_date;
/**
* @ORM\Column(type="date", nullable=true)
* @Type("DateTime<'Y-m-d'>")
*/
private $collection_date;
/**
* @ORM\OneToMany(targetEntity=CompetitionSectionHidden::class, mappedBy="competition", orphanRemoval=false)
*/
private $competitionSectionHidden;
/**
*
* @ORM\Column(name="livescoring_policy", type="enumlivescoringpolicy", nullable=false)
*/
private $livescoring_policy = EnumLivescoringPolicy::PLAYER_RESULTS;
/**
*
* @ORM\Column(name="livescoring_formula", type="enumlivescoringformula", nullable=false)
*/
private $livescoring_formula = EnumLivescoringFormula::HANDICAP_SCRATCH;
/**
* @ORM\Column(type="boolean", nullable=false)
* Soap\ComplexType("boolean")
*/
private $show_events = false;
/**
* @ORM\OneToMany(targetEntity=Highlight::class, mappedBy="competicion", orphanRemoval=true)
*/
private $highlights;
public function __construct()
{
$this->aspirantes = new ArrayCollection();
$this->preferentes = new ArrayCollection();
$this->comites = new ArrayCollection();
$this->jornadas = new ArrayCollection();
$this->albaranes = new ArrayCollection();
$this->rankings = new ArrayCollection();
$this->circuitos = new ArrayCollection();
$this->inscritos = new ArrayCollection();
$this->categorias = new ArrayCollection();
$this->tarifas = new ArrayCollection();
$this->adicionales = new ArrayCollection();
$this->vouchers = new ArrayCollection();
$this->mensajeTorneos = new ArrayCollection();
$this->competitionSectionHidden = new ArrayCollection();
$this->highlights = new ArrayCollection();
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set id
*
* @param string $id
* @return Competicion
*/
public function setId(?int $id)
{
if (!empty($id) && $id !== 'null') {
$this->id = $id;
}
return $this;
}
/**
* Set codigo
*
* @param string $codigo
* @return Competicion
*/
public function setCodigo($codigo)
{
$this->codigo = $codigo;
return $this;
}
/**
* Get codigo
*
* @return string
*/
public function getCodigo()
{
return $this->codigo;
}
/**
* Set nombre
*
* @param string $nombre
* @return Competicion
*/
public function setNombre($nombre)
{
$this->nombre = $nombre;
return $this;
}
/**
* Get nombre
*
* @return string
*/
public function getNombre()
{
return $this->nombre;
}
/**
* Set fecha
*
* @param \DateTime $fecha
* @return Competicion
*/
public function setFecha($fecha)
{
$this->fecha = $fecha;
return $this;
}
/**
* Get fecha
*
* @return \DateTime
*/
public function getFecha()
{
return $this->fecha;
}
/**
* Set inicio
*
* @param \DateTime $inicio
* @return Competicion
*/
public function setInicio($inicio)
{
if (empty($inicio))
return $this;
$this->inicio = $inicio;
return $this;
}
/**
* Get inicio
*
* @return \DateTime
*/
public function getInicio()
{
$fecha = $this->inicio;
if (!is_null($this->getClub()) && !is_null($this->getClub()->getTimezone())) {
$timezone = new \DateTimeZone($this->getClub()->getTimezone()->getNombre());
if (!is_null($timezone) && !is_null($fecha)) {
$fecha->setTimezone($timezone);
}
}
return $fecha;
}
/**
* Set fin
*
* @param \DateTime $fin
* @return Competicion
*/
public function setFin($fin)
{
if (empty($fin))
return $this;
$this->fin = $fin;
return $this;
}
/**
* Get fin
*
* @return \DateTime
*/
public function getFin()
{
$fecha = $this->fin;
if (!is_null($this->getClub()) && !is_null($this->getClub()->getTimezone())) {
$timezone = new \DateTimeZone($this->getClub()->getTimezone()->getNombre());
if (!is_null($timezone) && !is_null($fecha)) {
$fecha->setTimezone($timezone);
}
}
return $fecha;
}
/**
* Set plazas
*
* @param integer $plazas
* @return Competicion
*/
public function setPlazas($plazas)
{
$this->plazas = $plazas;
return $this;
}
/**
* Get plazas
*
* @return integer
*/
public function getPlazas()
{
return $this->plazas;
}
/**
* Set jugadores
*
* @param integer $jugadores
* @return Competicion
*/
public function setJugadores($jugadores)
{
$this->jugadores = $jugadores;
return $this;
}
/**
* Get jugadores
*
* @return integer
*/
public function getJugadores()
{
return $this->jugadores;
}
/**
* Set estricto
*
* @param boolean $estricto
* @return Competicion
*/
public function setEstricto($estricto)
{
$this->estricto = $estricto;
return $this;
}
/**
* Get estricto
*
* @return boolean
*/
public function getEstricto()
{
return $this->estricto;
}
/**
* Set observaciones
*
* @param string $observaciones
* @return Competicion
*/
public function setObservaciones($observaciones)
{
$this->observaciones = $observaciones;
return $this;
}
/**
* Get observaciones
*
* @return string
*/
public function getObservaciones()
{
return $this->observaciones;
}
/**
* Set aviso
*
* @param string $aviso
* @return Competicion
*/
public function setAviso($aviso)
{
$this->aviso = $aviso;
return $this;
}
/**
* Get aviso
*
* @return string
*/
public function getAviso()
{
return $this->aviso;
}
/**
* Set created_at
*
* @param \DateTime $createdAt
* @return Competicion
*/
public function setCreatedAt($createdAt)
{
$this->created_at = $createdAt;
return $this;
}
/**
* Get created_at
*
* @return \DateTime
*/
public function getCreatedAt()
{
return $this->created_at;
}
/**
* Set updated_at
*
* @param \DateTime $updatedAt
* @return Competicion
*/
public function setUpdatedAt($updatedAt)
{
$this->updated_at = $updatedAt;
return $this;
}
/**
* Get updated_at
*
* @return \DateTime
*/
public function getUpdatedAt()
{
return $this->updated_at;
}
/**
* Set rfeg_id
*
* @param integer $rfegId
* @return Competicion
*/
public function setRfegId($rfegId)
{
$this->rfeg_id = $rfegId;
return $this;
}
/**
* Get rfeg_id
*
* @return integer
*/
public function getRfegId()
{
return $this->rfeg_id;
}
/**
* Set circular
*
* @param string $circular
* @return Competicion
*/
public function setCircular($circular)
{
$this->circular = $circular;
return $this;
}
/**
* Get circular
*
* @return string
*/
public function getCircular()
{
return $this->circular;
}
/**
* Set nombre_observaciones
*
* @param string $nombreObservaciones
* @return Competicion
*/
public function setNombreObservaciones($nombreObservaciones)
{
$this->nombre_observaciones = $nombreObservaciones;
return $this;
}
/**
* Get nombre_observaciones
*
* @return string
*/
public function getNombreObservaciones()
{
return $this->nombre_observaciones;
}
/**
* Set destacada
*
* @param \App\Entity\Backend\Destacada $destacada
* @return Competicion
*/
public function setDestacada(\App\Entity\Backend\Destacada $destacada = null)
{
$this->destacada = $destacada;
return $this;
}
/**
* Get destacada
*
* @return \App\Entity\Backend\Destacada
*/
public function getDestacada()
{
return $this->destacada;
}
/**
* Set formula
*
* @param \App\Entity\Backend\Formula $formula
* @return Competicion
*/
public function setFormula(\App\Entity\Backend\Formula $formula = null)
{
$this->formula = $formula;
return $this;
}
/**
* Get formula
*
* @return \App\Entity\Backend\Formula
*/
public function getFormula()
{
return $this->formula;
}
/**
* Set calculo
*
* @param \App\Entity\Backend\Calculo $calculo
* @return Competicion
*/
public function setCalculo(\App\Entity\Backend\Calculo $calculo = null)
{
$this->calculo = $calculo;
return $this;
}
/**
* Get calculo
*
* @return \App\Entity\Backend\Calculo
*/
public function getCalculo()
{
return $this->calculo;
}
/**
* Set club
*
* @param \App\Entity\Backend\Club $club
* @return Competicion
*/
public function setClub(\App\Entity\Backend\Club $club = null)
{
$this->club = $club;
return $this;
}
/**
* Get club
*
* @return \App\Entity\Backend\Club
*/
public function getClub()
{
return $this->club;
}
/**
* Set organizador
*
* @param \App\Entity\Backend\Club $organizador
* @return Competicion
*/
public function setOrganizador(\App\Entity\Backend\Club $organizador = null)
{
$this->organizador = $organizador;
return $this;
}
/**
* Get organizador
*
* @return \App\Entity\Backend\Club
*/
public function getOrganizador()
{
return $this->organizador;
}
/**
* Set albaran
*
* @param \App\Entity\Backend\Albaran $albaran
* @return Competicion
*/
public function setAlbaran(\App\Entity\Backend\Albaran $albaran = null)
{
$this->albaran = $albaran;
return $this;
}
/**
* Get albaran
*
* @return \App\Entity\Backend\Albaran
*/
public function getAlbaran()
{
return $this->albaran;
}
/**
* Set criterio
*
* @param \App\Entity\Backend\Criterio $criterio
* @return Competicion
*/
public function setCriterio(\App\Entity\Backend\Criterio $criterio = null)
{
$this->criterio = $criterio;
return $this;
}
/**
* Get criterio
*
* @return \App\Entity\Backend\Criterio
*/
public function getCriterio()
{
return $this->criterio;
}
/**
*
* @ORM\PrePersist
* @ORM\PreUpdate
*/
public function updatedTimestamps()
{
$this->setUpdatedAt(new \DateTime('now'));
//Is is new
if ($this->getCreatedAt() == null) {
$this->setCreatedAt(new \DateTime('now'));
}
}
/**
* Add comites
*
* @param \App\Entity\Backend\Comite $comites
* @return Competicion
*/
public function addComite(\App\Entity\Backend\Comite $comites)
{
$this->comites[] = $comites;
return $this;
}
/**
* Remove comites
*
* @param \App\Entity\Backend\Comite $comites
*/
public function removeComite(\App\Entity\Backend\Comite $comites)
{
$this->comites->removeElement($comites);
}
/**
* Get comites
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getComites()
{
return $this->comites;
}
/**
* Set comites
*
* @param \Doctrine\Common\Collections\ArrayCollection $comites
* @return Competicion
*/
public function setComites($comites)
{
$this->comites = $comites;
return $this->comites;
}
/**
* Add circuitos
*
* @param \App\Entity\Backend\Circuito $circuitos
* @return Competicion
*/
public function addCircuito(\App\Entity\Backend\Circuito $circuitos)
{
$this->circuitos[] = $circuitos;
return $this;
}
/**
* Remove circuitos
*
* @param \App\Entity\Backend\Circuito $circuitos
*/
public function removeCircuito(\App\Entity\Backend\Circuito $circuitos)
{
$this->circuitos->removeElement($circuitos);
}
/**
* Get circuitos
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getCircuitos()
{
return $this->circuitos;
}
/**
* Set circuitos
*
* @param \Doctrine\Common\Collections\ArrayCollection $circuitos
* @return Competicion
*/
public function setCircuitos($circuitos)
{
$this->circuitos = $circuitos;
return $this->circuitos;
}
/**
* Set estado
*
* @param enumestadocompeticion $estado
* @return Competicion
*/
public function setEstado($estado)
{
$this->estado = $estado;
return $this;
}
/**
* Get estado
*
* @return enumestadocompeticion
*/
public function getEstado()
{
return $this->estado;
}
/**
* Set hash
*
* @param string $hash
* @return Competicion
*/
public function setHash($hash)
{
$this->hash = $hash;
return $this;
}
/**
* Get hash
*
* @return string
*/
public function getHash()
{
return $this->hash;
}
/**
* Set estado_corte
*
* @param enumestadocorte $estadoCorte
* @return Competicion
*/
public function setEstadoCorte($estadoCorte)
{
$this->estado_corte = $estadoCorte;
return $this;
}
/**
* Get estado_corte
*
* @return enumestadocorte
*/
public function getEstadoCorte()
{
return $this->estado_corte;
}
public function __toString()
{
return (string)$this->getNombre() . " - " . $this->getFecha()->format('d/m/Y');
}
/**
* Get jornadas
*
*/
public function getJornadas()
{
return $this->jornadas;
}
/**
* Set jornadas
*
* @param \Doctrine\Common\Collections\ArrayCollection $jornadas
* @return Competicion
*/
public function setJornadas($jornadas)
{
$this->jornadas = $jornadas;
return $this->jornadas;
}
/**
* Add jornada
*
* @param \App\Entity\Backend\Jornada $jornada
* @return Competicion
*/
public function addJornada(\App\Entity\Backend\Jornada $jornada)
{
$jornada->getCompeticion($this);
$this->jornadas->add($jornada);
return $this;
}
/**
* Delete jornadas
*
* @param \App\Entity\Backend\Jornada $jornadas
* @return Competicion
*/
public function removeJornada(\App\Entity\Backend\Jornada $jornadas)
{
$this->jornadas->removeElement($jornadas);
return $this;
}
/**
* @param bool $hastaHoy Solo se comprueban las jornadas de hoy para atrás
* @return bool
*/
public function getJornadasCompatibles($hastaHoy = true): bool
{
// Se recogen todas las modalidades de la competicion
$modalidades = [];
$now = new \DateTime('today 23:59:59');
foreach ($this->jornadas as $jornada) {
if (($hastaHoy && $jornada->getFecha() <= $now) || !$hastaHoy) {
$modalidades[] = $jornada->getModalidad()->getId();
}
}
// Son compatibles si todas las modalidades son individual
$todasIndividual = count(array_filter($modalidades, function ($modalidadId) {
return $modalidadId === "I";
})) === count($modalidades);
if ($todasIndividual) {
return true;
}
$gruposCompatibles = [
["C", "F", "G", "H", "P"],
["A", "S"]
];
if (empty(array_diff($modalidades, $gruposCompatibles[0])) || empty(array_diff($modalidades, $gruposCompatibles[1]))) {
return true;
}
return false;
}
/**
* Add inscritos
*
* @param \App\Entity\Backend\Inscrito $inscritos
* @return Competicion
*/
public function addInscrito(\App\Entity\Backend\Inscrito $inscritos)
{
$this->inscritos[] = $inscritos;
return $this;
}
/**
* Remove inscritos
*
* @param \App\Entity\Backend\Inscrito $inscritos
*/
public function removeInscrito(\App\Entity\Backend\Inscrito $inscritos)
{
$this->inscritos->removeElement($inscritos);
}
/**
* Get inscritos
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getInscritos()
{
return $this->inscritos;
}
/**
* Add categorias
*
* @param \App\Entity\Backend\Categoria $categorias
* @return Competicion
*/
public function addCategoria(\App\Entity\Backend\Categoria $categorias)
{
$this->categorias[] = $categorias;
return $this;
}
/**
* Remove categorias
*
* @param \App\Entity\Backend\Categoria $categorias
*/
public function removeCategoria(\App\Entity\Backend\Categoria $categorias)
{
$this->categorias->removeElement($categorias);
}
/**
* Get categorias
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getCategorias()
{
return $this->categorias;
}
/**
* Add tarifas
*
* @param \App\Entity\Backend\Tarifa $tarifa
* @return Competicion
*/
public function addTarifa(\App\Entity\Backend\Tarifa $tarifa)
{
$tarifa->setCompeticion($this);
$this->tarifas[] = $tarifa;
return $this;
}
/**
* Remove tarifas
*
* @param \App\Entity\Backend\Tarifa $tarifa
*/
public function removeTarifa(\App\Entity\Backend\Tarifa $tarifa)
{
$this->tarifas->removeElement($tarifa);
$tarifa->removeCompeticion();
}
/**
* Get tarifa
*
* @return array
*/
public function getTarifas()
{
return $this->tarifas;
}
/**
* Set tarifas
*
* @param \Doctrine\Common\Collections\ArrayCollection $tarifas
* @return Competicion
*/
public function setTarifas($tarifas)
{
$this->tarifas = $tarifas;
return $this;
}
/**
* Set cartel
*
* @param string $cartel
* @return Competicion
*/
public function setCartel($cartel)
{
$this->cartel = $cartel;
return $this;
}
/**
* Get cartel
*
* @return string
*/
public function getCartel()
{
return $this->cartel;
}
public function getFileCartel()
{
return $this->file_cartel;
}
public function getFileHorario()
{
return $this->file_horario;
}
public function getFileInscritos()
{
return $this->file_inscritos;
}
public function getFileClasificaciones()
{
return $this->file_clasificaciones;
}
public function getFileBannerSchedule()
{
return $this->file_banner_schedule;
}
public function getFileLocaleRulePdf()
{
return $this->file_localeRulePdf;
}
public function getFileReglas()
{
return $this->file_reglas;
}
public function getFileVarios()
{
return $this->file_varios;
}
public function getAbsolutePath($fichero)
{
switch ($fichero) {
case "cartel":
return null === $this->cartel ? null : $this->getUploadRootDir() . '/' . $this->cartel;
case "horario":
return null === $this->horario ? null : $this->getUploadRootDir() . '/' . $this->horario;
case "fichero_inscritos":
return null === $this->fichero_inscritos ? null : $this->getUploadRootDir() . '/' . $this->fichero_inscritos;
case "fichero_clasificaciones":
return null === $this->fichero_clasificaciones ? null : $this->getUploadRootDir() . '/' . $this->fichero_clasificaciones;
case "fichero_banner_schedule":
return null === $this->fichero_banner_schedule ? null : $this->getUploadRootDir("image") . '/' . $this->fichero_banner_schedule;
case "fichero_localeRulePdf":
return null === $this->fichero_localeRulePdf ? null : $this->getUploadRootDir() . '/' . $this->fichero_localeRulePdf;
case "fichero_reglas":
return null === $this->fichero_reglas ? null : $this->getUploadRootDir() . '/' . $this->fichero_reglas;
case "fichero_varios":
return null === $this->fichero_varios ? null : $this->getUploadRootDir() . '/' . $this->fichero_varios;
}
}
public function getWebPath()
{
return null === $this->cartel ? null : $this->getUploadDir() . '/' . $this->cartel;
}
protected function getUploadRootDir(string $type = "pdf")
{
// la ruta absoluta del directorio donde se deben guardar los archivos cargados
return __DIR__ . '/../../../public/' . $this->getUploadDir($type);
}
protected function getUploadDir(string $type = "pdf")
{
// se libra del __DIR__ para no desviarse al mostrar `doc/image` en la vista.
return "uploads/competiciones/$type";
}
/**
* Renames uploaded file
* @return string
*/
public function preUpload()
{
if (null !== $this->getFileCartel()) {
// haz cualquier cosa para generar un nombre único
$this->cartel = abs(crc32(rand() . "_" . uniqid('archC_'))) . '_' . UtilStatic::normaliza($this->getFileCartel()->getClientOriginalName());
}
if (null !== $this->getFileHorario()) {
// haz cualquier cosa para generar un nombre único
$this->horario = abs(crc32(rand() . "_" . uniqid('archH_'))) . '_' . UtilStatic::normaliza($this->getFileHorario()->getClientOriginalName());
}
if (null !== $this->getFileInscritos()) {
// haz cualquier cosa para generar un nombre único
$this->fichero_inscritos = abs(crc32(rand() . "_" . uniqid('archI_'))) . '_' . UtilStatic::normaliza($this->getFileInscritos()->getClientOriginalName());
}
if (null !== $this->getFileClasificaciones()) {
// haz cualquier cosa para generar un nombre único
$this->fichero_clasificaciones = abs(crc32(rand() . "_" . uniqid('archL_'))) . '_' . UtilStatic::normaliza($this->getFileClasificaciones()->getClientOriginalName());
}
if (null !== $this->getFileLocaleRulePdf()) {
// haz cualquier cosa para generar un nombre único
$this->fichero_localeRulePdf = abs(crc32(rand() . "_" . uniqid('archL_'))) . '_' . UtilStatic::normaliza($this->getFileLocaleRulePdf()->getClientOriginalName());
}
if (null !== $this->getFileBannerSchedule()) {
// haz cualquier cosa para generar un nombre único
$this->fichero_banner_schedule = abs(crc32(rand() . "_" . uniqid('archL_'))) . '_' . UtilStatic::normaliza($this->getFileBannerSchedule()->getClientOriginalName());
}
if (null !== $this->getFileReglas()) {
// haz cualquier cosa para generar un nombre único
$this->fichero_reglas = abs(crc32(rand() . "_" . uniqid('archR_'))) . '_' . UtilStatic::normaliza($this->getFileReglas()->getClientOriginalName());
}
if (null !== $this->getFileVarios()) {
// haz cualquier cosa para generar un nombre único
$this->fichero_varios = abs(crc32(rand() . "_" . uniqid('archV_'))) . '_' . UtilStatic::normaliza($this->getFileVarios()->getClientOriginalName());
}
if (!empty($this->inicio) && ($this->inicio->getTimezone()->getName() !== $_ENV['DEFAULT_TIMEZONE'])) {
$this->inicio->setTimezone(new \DateTimeZone($_ENV['DEFAULT_TIMEZONE']));
}
if (!empty($this->fin) && ($this->fin->getTimezone()->getName() !== $_ENV['DEFAULT_TIMEZONE'])) {
$this->fin->setTimezone(new \DateTimeZone($_ENV['DEFAULT_TIMEZONE']));
}
}
/**
* @ORM\PostPersist()
* @ORM\PostUpdate()
*/
public function upload()
{
if (!is_null($this->getFileCartel())) {
// si hay un error al mover el archivo, move() automáticamente
// envÃa una excepción. Esta impedirá que la entidad se persista
// en la base de datos en caso de error
$this->getFileCartel()->move($this->getUploadRootDir(), $this->cartel);
// check if we have an old file
if (isset($this->temp_cartel)) {
// delete the old file
$this->unlinkIfExist($this->getUploadRootDir() . '/' . $this->temp_cartel);
// clear the temp image path
$this->temp_cartel = null;
}
$this->file_cartel = null;
$pathCartel = $this->getAbsolutePath("cartel");
if (substr($pathCartel, -3) == "pdf") {
$im = new \Imagick();
$im->readimage($pathCartel);
$im->setiteratorindex(0); //primera pagina
$im->setImageFormat('png'); //formato
$im->setcompressionquality(75); //calidad
$im->scaleImage(100, 100, true);
$im->writeimage(substr($pathCartel, 0, -3) . "png"); //usamos substring para quitar la extension
$im->destroy();
}
}
if (!is_null($this->getFileHorario())) {
// si hay un error al mover el archivo, move() automáticamente
// envÃa una excepción. Esta impedirá que la entidad se persista
// en la base de datos en caso de error
$this->getFileHorario()->move($this->getUploadRootDir(), $this->horario);
// check if we have an old file
if (isset($this->temp_horario)) {
// delete the old file
$this->unlinkIfExist($this->getUploadRootDir() . '/' . $this->temp_horario);
// clear the temp image path
$this->temp_horario = null;
}
$this->file_horario = null;
}
if (!is_null($this->getFileInscritos())) {
// si hay un error al mover el archivo, move() automáticamente
// envÃa una excepción. Esta impedirá que la entidad se persista
// en la base de datos en caso de error
$this->getFileInscritos()->move($this->getUploadRootDir(), $this->fichero_inscritos);
// check if we have an old file
if (isset($this->temp_inscritos)) {
// delete the old file
$this->unlinkIfExist($this->getUploadRootDir() . '/' . $this->temp_inscritos);
// clear the temp image path
$this->temp_inscritos = null;
}
$this->file_inscritos = null;
}
if (!is_null($this->getFileClasificaciones())) {
// si hay un error al mover el archivo, move() automáticamente
// envÃa una excepción. Esta impedirá que la entidad se persista
// en la base de datos en caso de error
$this->getFileClasificaciones()->move($this->getUploadRootDir(), $this->fichero_clasificaciones);
// check if we have an old file
if (isset($this->temp_clasificaciones)) {
// delete the old file
$this->unlinkIfExist($this->getUploadRootDir() . '/' . $this->temp_clasificaciones);
// clear the temp image path
$this->temp_clasificaciones = null;
}
$this->file_clasificaciones = null;
}
if (!is_null($this->getFileLocaleRulePdf())) {
// si hay un error al mover el archivo, move() automáticamente
// envÃa una excepción. Esta impedirá que la entidad se persista
// en la base de datos en caso de error
$this->getFileLocaleRulePdf()->move($this->getUploadRootDir(), $this->fichero_localeRulePdf);
// check if we have an old file
if (isset($this->temp_localeRulePdf)) {
// delete the old file
$this->unlinkIfExist($this->getUploadRootDir() . '/' . $this->temp_localeRulePdf);
// clear the temp image path
$this->temp_localeRulePdf = null;
}
$this->file_localeRulePdf = null;
}
if (!is_null($this->getFileBannerSchedule())) {
// si hay un error al mover el archivo, move() automáticamente
// envÃa una excepción. Esta impedirá que la entidad se persista
// en la base de datos en caso de error
$this->getFileBannerSchedule()->move($this->getUploadRootDir("image"), $this->fichero_banner_schedule);
// check if we have an old file
if (isset($this->temp_banner_schedule)) {
// delete the old file
$this->unlinkIfExist($this->getUploadRootDir("image") . '/' . $this->temp_banner_schedule);
// clear the temp image path
$this->temp_banner_schedule = null;
}
$this->file_banner_schedule = null;
}
if (!is_null($this->getFileReglas())) {
// si hay un error al mover el archivo, move() automáticamente
// envÃa una excepción. Esta impedirá que la entidad se persista
// en la base de datos en caso de error
$this->getFileReglas()->move($this->getUploadRootDir(), $this->fichero_reglas);
// check if we have an old file
if (isset($this->temp_reglas)) {
// delete the old file
$this->unlinkIfExist($this->getUploadRootDir() . '/' . $this->temp_reglas);
// clear the temp image path
$this->temp_reglas = null;
}
$this->file_reglas = null;
}
if (!is_null($this->getFileVarios())) {
// si hay un error al mover el archivo, move() automáticamente
// envÃa una excepción. Esta impedirá que la entidad se persista
// en la base de datos en caso de error
$this->getFileVarios()->move($this->getUploadRootDir(), $this->fichero_varios);
// check if we have an old file
if (isset($this->temp_varios)) {
// delete the old file
$this->unlinkIfExist($this->getUploadRootDir() . '/' . $this->temp_varios);
// clear the temp image path
$this->temp_varios = null;
}
$this->file_varios = null;
}
}
/**
* Defaults when inserting a user
* @ORM\PrePersist()
*/
public function prePersistTasks()
{
$this->preUpload();
}
/**
* Defaults when updating a user
* @ORM\PreUpdate()
*/
public function preUpdateTasks()
{
$this->preUpload();
}
/**
* @ORM\PostRemove()
*/
public function removeUpload($fichero)
{
switch ($fichero) {
case "cartel":
if ($file_cartel = $this->getAbsolutePath('cartel')) {
unlink($file_cartel);
$this->setCartel(null);
}
break;
case "horario":
if ($file_horario = $this->getAbsolutePath('horario')) {
unlink($file_horario);
$this->setHorario(null);
}
break;
case "fichero_inscritos":
if ($file_inscritos = $this->getAbsolutePath('fichero_inscritos')) {
unlink($file_inscritos);
$this->setFicheroInscritos(null);
}
break;
case "fichero_clasificaciones":
if ($file_clasificaciones = $this->getAbsolutePath('fichero_clasificaciones')) {
unlink($file_clasificaciones);
$this->setFicheroClasificaciones(null);
}
break;
case "fichero_localeRulePdf":
if ($file_localeRulePdf = $this->getAbsolutePath('fichero_localeRulePdf')) {
unlink($file_localeRulePdf);
$this->setFicheroLocaleRulePdf(null);
}
break;
case "fichero_banner_schedule":
if ($file_banner_schedule = $this->getAbsolutePath('fichero_banner_schedule')) {
unlink($file_banner_schedule);
$this->setFicheroBannerSchedule(null);
}
break;
case "fichero_reglas":
if ($file_reglas = $this->getAbsolutePath('fichero_reglas')) {
unlink($file_reglas);
$this->setFicheroReglas(null);
}
break;
case "fichero_varios":
if ($file_varios = $this->getAbsolutePath('fichero_varios')) {
unlink($file_varios);
$this->setFicheroVarios(null);
}
break;
}
}
/**
* Set horario
*
* @param string $horario
* @return Competicion
*/
public function setHorario($horario)
{
$this->horario = $horario;
return $this;
}
/**
* Get horario
*
* @return string
*/
public function getHorario()
{
return $this->horario;
}
/**
* Set fichero_inscritos
*
* @param string $ficheroInscritos
* @return Competicion
*/
public function setFicheroInscritos($ficheroInscritos)
{
$this->fichero_inscritos = $ficheroInscritos;
return $this;
}
/**
* Get fichero_inscritos
*
* @return string
*/
public function getFicheroInscritos()
{
return $this->fichero_inscritos;
}
public function setFicheroLocaleRulePdf($ficheroLocaleRulePdf)
{
$this->fichero_localeRulePdf = $ficheroLocaleRulePdf;
return $this;
}
public function getFicheroLocaleRulePdf()
{
return $this->fichero_localeRulePdf;
}
/**
* Set fichero_clasificaciones
*
* @param string $ficheroClasificaciones
* @return Competicion
*/
public function setFicheroClasificaciones($ficheroClasificaciones)
{
$this->fichero_clasificaciones = $ficheroClasificaciones;
return $this;
}
/**
* Get fichero_clasificaciones
*
* @return string
*/
public function getFicheroClasificaciones()
{
return $this->fichero_clasificaciones;
}
public function setFicheroBannerSchedule($ficheroBannerSchedule)
{
$this->fichero_banner_schedule = $ficheroBannerSchedule;
return $this;
}
public function getFicheroBannerSchedule()
{
return $this->fichero_banner_schedule;
}
/**
* Set fichero_reglas
*
* @param string $ficheroReglas
* @return Competicion
*/
public function setFicheroReglas($ficheroReglas)
{
$this->fichero_reglas = $ficheroReglas;
return $this;
}
/**
* Get fichero_reglas
*
* @return string
*/
public function getFicheroReglas()
{
return $this->fichero_reglas;
}
/**
* Set fichero_varios
*
* @param string $ficheroVarios
* @return Competicion
*/
public function setFicheroVarios($ficheroVarios)
{
$this->fichero_varios = $ficheroVarios;
return $this;
}
/**
* Get fichero_varios
*
* @return string
*/
public function getFicheroVarios()
{
return $this->fichero_varios;
}
/**
* Set informacion
*
* @param string $informacion
* @return Competicion
*/
public function setInformacion($informacion)
{
$this->informacion = $informacion;
return $this;
}
/**
* Get informacion
*
* @return string
*/
public function getInformacion()
{
return $this->informacion;
}
/**
* Set modo
*
* @param \App\Entity\Backend\Modo $modo
* @return Competicion
*/
public function setModo(\App\Entity\Backend\Modo $modo = null)
{
$this->modo = $modo;
return $this;
}
/**
* Get modo
*
* @return \App\Entity\Backend\Modo
*/
public function getModo()
{
return $this->modo;
}
/**
* isOnline
*
* @return boolean
*/
public function isOnline()
{
return ($this->modo->getId() == 3);
}
/**
* Set criterio2
*
* @param \App\Entity\Backend\Criterio $criterio2
* @return Competicion
*/
public function setCriterio2(\App\Entity\Backend\Criterio $criterio2 = null)
{
$this->criterio2 = $criterio2;
return $this;
}
/**
* Get criterio2
*
* @return \App\Entity\Backend\Criterio
*/
public function getCriterio2()
{
return $this->criterio2;
}
public function toRfegArray(Util $util, UrlGeneratorInterface $router)
{
$nombre = str_replace(array("'"), array('"'), $this->getNombre());
switch ($this->getDestacada()) {
case "1":
case "2":
$C_Competition_CategTorneo = 2;
break;
case "3":
$C_Competition_CategTorneo = 1;
break;
default:
$C_Competition_CategTorneo = 3;
}
$rfeg = array(
"C_Competition_Id" => $this->getRfegId(),
"C_Competition_Name" => $nombre,
"C_Competition_SName" => UtilStatic::limitar_cadena($nombre, 50),
"C_Competition_ClubId" => $this->getClub()->getRfegId(),
"C_Competition_StartDate" => $this->getFecha()->format("Y-m-d\TH:i:s"),
"C_Competition_EndDate" => $util->getLastJornada($this->getId())->getFecha()->format("Y-m-d\TH:i:s"),
"C_Competition_Level" => "Competiciones de Club",
"C_Competition_GameStyle" => ($this->getFormula() != null) ? $this->getFormula()->getNombre() : "",
"C_Competition_GameMode" => ($this->getJugadores() > 1) ? "Por Equipo" : "Individual",
"C_Competition_Category" => "1,2,3,4,5,6,7,8,9,10",
"C_Competition_Access" => "Abierto",
"C_Competition_Sex" => "Mixto",
"C_Competition_Web" => $router->generate('_tournament', array('id' => $this->getId()), true),
"C_Competition_CategTorneo" => $C_Competition_CategTorneo,
"C_Competition_FechaDefinitiva" => 1,
);
return $rfeg;
}
/**
* Sets file_inscritos.
*
* @param UploadedFile $file
*/
public function setFileInscritos($file)
{
$this->file_inscritos = $file;
// check if we have an old image path
if (isset($this->fichero_inscritos)) {
// store the old name to delete after the update
$this->temp_inscritos = $this->fichero_inscritos;
$this->fichero_inscritos = null;
} else {
$this->fichero_inscritos = '';
}
}
/**
* Sets file_reglas.
*
* @param UploadedFile $file
*/
public function setFileReglas($file)
{
$this->file_reglas = $file;
// check if we have an old image path
if (isset($this->fichero_reglas)) {
// store the old name to delete after the update
$this->temp_reglas = $this->fichero_reglas;
$this->fichero_reglas = null;
} else {
$this->fichero_reglas = '';
}
}
/**
* Sets file_varios.
*
* @param UploadedFile $file
*/
public function setFileVarios($file)
{
$this->file_varios = $file;
// check if we have an old image path
if (isset($this->fichero_varios)) {
// store the old name to delete after the update
$this->temp_varios = $this->fichero_varios;
$this->fichero_varios = null;
} else {
$this->fichero_varios = '';
}
}
/**
* Sets file.
*
* @param UploadedFile $file
*/
public function setFileClasificaciones($file)
{
$this->file_clasificaciones = $file;
// check if we have an old image path
if (isset($this->fichero_clasificaciones)) {
// store the old name to delete after the update
$this->temp_clasificaciones = $this->fichero_clasificaciones;
$this->fichero_clasificaciones = null;
} else {
$this->fichero_clasificaciones = '';
}
}
public function setFileLocaleRulePdf($file)
{
$this->file_localeRulePdf = $file;
// check if we have an old image path
if (isset($this->fichero_localeRulePdf)) {
// store the old name to delete after the update
$this->temp_localeRulePdf = $this->fichero_localeRulePdf;
$this->fichero_localeRulePdf = null;
} else {
$this->fichero_localeRulePdf = '';
}
}
public function setFileBannerSchedule($file)
{
$this->file_banner_schedule = $file;
// check if we have an old image path
if (isset($this->fichero_banner_schedule)) {
// store the old name to delete after the update
$this->temp_banner_schedule = $this->fichero_banner_schedule;
$this->fichero_banner_schedule = null;
} else {
$this->fichero_banner_schedule = '';
}
}
/**
* Sets file.
*
* @param UploadedFile $file
*/
public function setFileHorario($file)
{
$this->file_horario = $file;
// check if we have an old image path
if (isset($this->horario)) {
// store the old name to delete after the update
$this->temp_horario = $this->horario;
$this->horario = null;
} else {
$this->horario = '';
}
}
/**
* Sets file.
*
* @param UploadedFile $file
*/
public function setFileCartel($file)
{
$this->file_cartel = $file;
// check if we have an old image path
if (isset($this->cartel)) {
// store the old name to delete after the update
$this->temp_cartel = $this->cartel;
$this->cartel = null;
} else {
$this->cartel = '';
}
}
/**
* Set tarifa_reglamento
*
* @param boolean $tarifaReglamento
* @return Competicion
*/
public function setTarifaReglamento($tarifaReglamento)
{
$this->tarifa_reglamento = $tarifaReglamento;
return $this;
}
/**
* Get tarifa_reglamento
*
* @return boolean
*/
public function getTarifaReglamento()
{
return $this->tarifa_reglamento;
}
/**
* Set redireccion
*
* @param string $redireccion
* @return Competicion
*/
public function setRedireccion($redireccion)
{
$this->redireccion = $redireccion;
return $this;
}
/**
* Get redireccion
*
* @return string
*/
public function getRedireccion()
{
return $this->redireccion;
}
/**
* Set wagr
*
* @param boolean $wagr
* @return Competicion
*/
public function setWagr($wagr)
{
$this->wagr = $wagr;
return $this;
}
/**
* Get wagr
*
* @return boolean
*/
public function getWagr()
{
return $this->wagr;
}
/**
* Set subvencionJunta
*
* @param boolean $subvencionJunta
* @return Competicion
*/
public function setSubvencionJunta($subvencionJunta)
{
$this->subvencion_junta = $subvencionJunta;
return $this;
}
/**
* Get subvencionJunta
*
* @return boolean
*/
public function getSubvencionJunta()
{
return $this->subvencion_junta;
}
/**
* Set galeria
*
* @param string $galeria
* @return Competicion
*/
public function setGaleria($galeria)
{
$this->galeria = $galeria;
return $this;
}
/**
* Get galeria
*
* @return string
*/
public function getGaleria()
{
return $this->galeria;
}
/**
* Set informacionPopup
*
* @param string $informacionPopup
* @return Competicion
*/
public function setInformacionPopup($informacionPopup)
{
$this->informacion_popup = $informacionPopup;
return $this;
}
/**
* Get informacionPopup
*
* @return string
*/
public function getInformacionPopup()
{
return $this->informacion_popup;
}
/**
* Set num_competiciones
*
* @param integer $numCompeticiones
* @return Competicion
*/
public function setNumCompeticiones($numCompeticiones)
{
$this->num_competiciones = $numCompeticiones;
return $this;
}
/**
* Get num_competiciones
*
* @return integer
*/
public function getNumCompeticiones()
{
return $this->num_competiciones;
}
/**
* Add aspirantes
*
* @param \App\Entity\Backend\Club $aspirante
* @return Competicion
*/
public function addAspirante(\App\Entity\Backend\Club $aspirante)
{
$this->aspirantes[] = $aspirante;
return $this;
}
/**
* Remove aspirantes
*
* @param \App\Entity\Backend\Club $aspirante
*/
public function removeAspirante(\App\Entity\Backend\Club $aspirante)
{
$this->aspirantes->removeElement($aspirante);
}
/**
* Get aspirantes
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getAspirantes()
{
return $this->aspirantes;
}
/**
* Set aspirantes
*
* @param \Doctrine\Common\Collections\ArrayCollection $aspirantes
* @return Competicion
*/
public function setAspirantes($aspirantes)
{
$this->aspirantes = $aspirantes;
return $this->aspirantes;
}
/**
* Add preferentes
*
* @param \App\Entity\Backend\Club $preferentes
* @return Competicion
*/
public function addPreferente(\App\Entity\Backend\Club $preferentes)
{
$this->preferentes[] = $preferentes;
return $this;
}
/**
* Remove preferentes
*
* @param \App\Entity\Backend\Club $preferentes
*/
public function removePreferente(\App\Entity\Backend\Club $preferentes)
{
$this->preferentes->removeElement($preferentes);
}
/**
* Get preferentes
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getPreferentes()
{
return $this->preferentes;
}
/**
* Set preferentes
*
* @param \Doctrine\Common\Collections\ArrayCollection $preferentes
* @return Competicion
*/
public function setPreferentes($preferentes)
{
$this->preferentes = $preferentes;
return $this->preferentes;
}
/**
* Set observacionesPlanificacion
*
* @param string $observacionesPlanificacion
* @return Competicion
*/
public function setObservacionesPlanificacion($observacionesPlanificacion)
{
$this->observaciones_planificacion = $observacionesPlanificacion;
return $this;
}
/**
* Get observacionesPlanificacion
*
* @return string
*/
public function getObservacionesPlanificacion()
{
return $this->observaciones_planificacion;
}
/**
* Set tag_color
*
* @param string $tagColor
* @return Competicion
*/
public function setTagColor($tagColor)
{
$color = strtolower(str_replace("#", "", $tagColor));
$this->tag_color = (strtolower($color) != "ffffff") ? $color : null;
return $this;
}
/**
* Get tag_color
*
* @return string
*/
public function getTagColor()
{
return ($this->tag_color) ? "#" . $this->tag_color : null;
}
/**
* Set showLiveScoring
*
* @param enumestadolivescoring $showLiveScoring
* @return Competicion
*/
public function setShowLiveScoring($showLiveScoring)
{
//Si viene vacÃo metemos el valor por defecto
$this->show_live_scoring = !empty($showLiveScoring) ? $showLiveScoring : "club";
return $this;
}
/**
* Get showLiveScoring
*
* @return boolean
*/
public function getShowLiveScoring()
{
return $this->show_live_scoring;
}
/**
* Set rfc
*
* @param boolean $rfc
* @return Competicion
*/
public function setRfc($rfc)
{
$this->rfc = $rfc;
}
/**
* Get rfc
*
* @return boolean
*/
public function getRfc()
{
return $this->rfc;
}
/**
* Get hcpInscritoMasculino
*
* @return integer
*/
public function getHcpInscritoMasculino()
{
return $this->hcp_inscrito_masculino;
}
/**
* Get hcpInscritoMasculinoMin
*
* @return integer
*/
public function getHcpInscritoMasculinoMin()
{
return $this->hcp_inscrito_masculino_min;
}
/**
* Get hcpInscritoFemenino
*
* @return integer
*/
public function getHcpInscritoFemenino()
{
return $this->hcp_inscrito_femenino;
}
/**
* Get hcpInscritoFemeninoMin
*
* @return integer
*/
public function getHcpInscritoFemeninoMin()
{
return $this->hcp_inscrito_femenino_min;
}
/**
* Get hcpJuegoMasculino
*
* @return integer
*/
public function getHcpJuegoMasculino()
{
return $this->hcp_juego_masculino;
}
/**
* Get hcpJuegoFemenino
*
* @return integer
*/
public function getHcpJuegoFemenino()
{
return $this->hcp_juego_femenino;
}
/**
* Get hcpJuegoPareja
*
* @return integer
*/
public function getHcpJuegoPareja()
{
return $this->hcp_juego_pareja;
}
/**
* Get hcpJuegoEquipo
*
* @return integer
*/
public function getHcpJuegoEquipo()
{
return $this->hcp_juego_equipo;
}
/**
* Set hcpInscritoMasculino
*
* @param integer $hcpInscritoMasculino
* @return Competicion
*/
public function setHcpInscritoMasculino($hcpInscritoMasculino)
{
$this->hcp_inscrito_masculino = $hcpInscritoMasculino;
}
/**
* Set hcpInscritoFemenino
*
* @param integer $hcpInscritoFemenino
* @return Competicion
*/
public function setHcpInscritoFemenino($hcpInscritoFemenino)
{
$this->hcp_inscrito_femenino = $hcpInscritoFemenino;
}
/**
* Set hcpInscritoMasculinoMin
*
* @param integer $hcpInscritoMasculinoMin
* @return Competicion
*/
public function setHcpInscritoMasculinoMin($hcpInscritoMasculinoMin)
{
$this->hcp_inscrito_masculino_min = $hcpInscritoMasculinoMin;
}
/**
* Set hcpInscritoFemeninoMin
*
* @param integer $hcpInscritoFemeninoMin
* @return Competicion
*/
public function setHcpInscritoFemeninoMin($hcpInscritoFemeninoMin)
{
$this->hcp_inscrito_femenino_min = $hcpInscritoFemeninoMin;
}
/**
* Set hcpJuegoMasculino
*
* @param boolean $hcpJuegoMasculino
* @return Competicion
*/
public function setHcpJuegoMasculino($hcpJuegoMasculino)
{
$this->hcp_juego_masculino = $hcpJuegoMasculino;
}
/**
* Set hcpJuegoFemenino
*
* @param boolean $hcpJuegoFemenino
* @return Competicion
*/
public function setHcpJuegoFemenino($hcpJuegoFemenino)
{
$this->hcp_juego_femenino = $hcpJuegoFemenino;
}
/**
* Set hcpJuegoPareja
*
* @param boolean $hcpJuegoPareja
* @return Competicion
*/
public function setHcpJuegoPareja($hcpJuegoPareja)
{
$this->hcp_juego_pareja = $hcpJuegoPareja;
}
/**
* Set hcpJuegoEquipo
*
* @param boolean $hcpJuegoEquipo
* @return Competicion
*/
public function setHcpJuegoEquipo($hcpJuegoEquipo)
{
$this->hcp_juego_equipo = $hcpJuegoEquipo;
}
/**
* Set ficheroVariosNombre
*
* @param string $ficheroVariosNombre
* @return Competicion
*/
public function setFicheroVariosNombre($ficheroVariosNombre)
{
$this->fichero_varios_nombre = $ficheroVariosNombre;
return $this;
}
/**
* Get ficheroVariosNombre
*
* @return string
*/
public function getFicheroVariosNombre()
{
return $this->fichero_varios_nombre;
}
/**
* Set premios
*
* @param string $premios
* @return Competicion
*/
public function setPremios($premios)
{
$this->premios = $premios;
return $this;
}
/**
* Get premios
*
* @return string
*/
public function getPremios()
{
return $this->premios;
}
/**
* Set reglas
*
* @param string $reglas
* @return Competicion
*/
public function setReglas($reglas)
{
$this->reglas = $reglas;
return $this;
}
/**
* Get reglas
*
* @return string
*/
public function getReglas()
{
return $this->reglas;
}
/**
* Set arbitrable
*
* @param boolean $arbitrable
* @return Competicion
*/
public function setArbitrable($arbitrable)
{
$this->arbitrable = $arbitrable;
return $this;
}
/**
* Get arbitrable
*
* @return boolean
*/
public function getArbitrable()
{
return $this->arbitrable;
}
/**
* Set direccionTorneos
*
* @param boolean $direccionTorneos
* @return Competicion
*/
public function setDireccionTorneos($direccionTorneos)
{
$this->direccion_torneos = $direccionTorneos;
return $this;
}
/**
* Get direccionTorneos
*
* @return boolean
*/
public function getDireccionTorneos()
{
return $this->direccion_torneos;
}
/**
* Set asistenciaPresidente
*
* @param boolean $asistenciaPresidente
* @return Competicion
*/
public function setAsistenciaPresidente($asistenciaPresidente)
{
$this->asistencia_presidente = $asistenciaPresidente;
return $this;
}
/**
* Get asistenciaPresidente
*
* @return boolean
*/
public function getAsistenciaPresidente()
{
return $this->asistencia_presidente;
}
/**
* Set institucional
*
* @param boolean $institucional
* @return Competicion
*/
public function setInstitucional($institucional)
{
$this->institucional = $institucional;
return $this;
}
/**
* Get institucional
*
* @return boolean
*/
public function getInstitucional()
{
return $this->institucional;
}
/**
* Set voluntarios
*
* @param boolean $voluntarios
* @return Competicion
*/
public function setVoluntarios($voluntarios)
{
$this->voluntarios = $voluntarios;
return $this;
}
/**
* Get voluntarios
*
* @return boolean
*/
public function getVoluntarios()
{
return $this->voluntarios;
}
/**
* Set flyer
*
* @param boolean $flyer
* @return Competicion
*/
public function setFlyer($flyer)
{
$this->flyer = $flyer;
return $this;
}
/**
* Get flyer
*
* @return boolean
*/
public function getFlyer()
{
return $this->flyer;
}
/**
* Set permitir
*
* @param boolean $permitir
* @return Competicion
*/
public function setPermitir($permitir)
{
$this->permitir = $permitir;
return $this;
}
/**
* Get permitir
*
* @return boolean
*/
public function getPermitir()
{
return $this->permitir;
}
/**
* Set social
*
* @param boolean $social
* @return Competicion
*/
public function setSocial($social)
{
$this->social = $social;
return $this;
}
/**
* Get social
*
* @return boolean
*/
public function getSocial()
{
return $this->social;
}
/**
* Set visible
*
* @param boolean $visible
* @return Competicion
*/
public function setVisible($visible)
{
$this->visible = $visible;
return $this;
}
/**
* Get visible
*
* @return boolean
*/
public function getVisible()
{
return $this->visible;
}
/**
* Set hcpEstricto
*
* @param boolean $hcpEstricto
* @return Competicion
*/
public function setHcpEstricto($hcpEstricto)
{
$this->hcp_estricto = $hcpEstricto;
return $this;
}
/**
* Get hcpEstricto
*
* @return boolean
*/
public function getHcpEstricto()
{
return $this->hcp_estricto;
}
/**
* Set popup_inscripcion
*
* @param boolean $popup_inscripcion
* @return Competicion
*/
public function setPopupInscripcion($popup_inscripcion)
{
$this->popup_inscripcion = $popup_inscripcion;
return $this;
}
/**
* Get popup_inscripcion
*
* @return boolean
*/
public function getPopupInscripcion()
{
return $this->popup_inscripcion;
}
/**
* Set popup_inscripcion_texto
*
* @param string $popup_inscripcion_texto
* @return Competicion
*/
public function setPopupInscripcionTexto($popup_inscripcion_texto)
{
$this->popup_inscripcion_texto = $popup_inscripcion_texto;
return $this;
}
/**
* Get popup_inscripcion_texto
*
* @return string
*/
public function getPopupInscripcionTexto()
{
return $this->popup_inscripcion_texto;
}
/**
* Set seguimiento
*
* @param boolean $seguimiento
* @return Competicion
*/
public function setSeguimiento($seguimiento)
{
$this->seguimiento = $seguimiento;
return $this;
}
/**
* Get seguimiento
*
* @return boolean
*/
public function getSeguimiento()
{
return $this->seguimiento;
}
/**
* Set mostrar_sorteo
*
* @param boolean $mostrarSorteo
* @return Competicion
*/
public function setMostrarSorteo($mostrarSorteo)
{
$this->mostrar_sorteo = $mostrarSorteo;
return $this;
}
/**
* Get mostrar_sorteo
*
* @return boolean
*/
public function getMostrarSorteo()
{
return $this->mostrar_sorteo;
}
/**
* Add albaranes
*
* @param \App\Entity\Backend\Albaran $albaranes
* @return Competicion
*/
public function addAlbarane(\App\Entity\Backend\Albaran $albaranes)
{
$this->albaranes[] = $albaranes;
return $this;
}
/**
* Remove albaranes
*
* @param \App\Entity\Backend\Albaran $albaranes
*/
public function removeAlbarane(\App\Entity\Backend\Albaran $albaranes)
{
$this->albaranes->removeElement($albaranes);
}
/**
* Get albaranes
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getAlbaranes()
{
return $this->albaranes;
}
/**
* Add adicionales
*
* @param \App\Entity\Backend\DatoAdicional $adicionales
* @return Competicion
*/
public function addAdicional(\App\Entity\Backend\DatoAdicional $adicionales)
{
$adicionales->setCompeticion($this);
$this->adicionales[] = $adicionales;
return $this;
}
/**
* Remove adicionales
*
* @param \App\Entity\Backend\DatoAdicional $adicionales
*/
public function removeAdicional(\App\Entity\Backend\DatoAdicional $adicionales)
{
$this->adicionales->removeElement($adicionales);
$adicionales->removeCompeticion();
}
/**
* Get adicionales
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getAdicionales()
{
return $this->adicionales;
}
public function getAdicionalesFiltered()
{
return array_filter($this->adicionales->toArray(), function ($a) {
return $a->getTipo() != "Privacidad";
});
}
/**
* Set malaga2020
*
* @param boolean $malaga2020
* @return Competicion
*/
public function setMalaga2020($malaga2020)
{
$this->malaga2020 = $malaga2020;
return $this;
}
/**
* Get malaga2020
*
* @return boolean
*/
public function getMalaga2020()
{
return $this->malaga2020;
}
/**
* Set lista_espera
*
* @param boolean $lista_espera
* @return Competicion
*/
public function setListaEspera($lista_espera)
{
$this->lista_espera = $lista_espera;
return $this;
}
/**
* Get lista_espera
*
* @return boolean
*/
public function getListaEspera()
{
return $this->lista_espera;
}
public function getRestringirLicencia()
{
return $this->restringir_licencia;
}
public function setRestringirLicencia($restringir_licencia): self
{
$this->restringir_licencia = $restringir_licencia;
return $this;
}
/**
* Set seleccion_tarifas
*
* @param boolean $seleccionTarifas
* @return Competicion
*/
public function setSeleccionTarifas($seleccionTarifas)
{
$this->seleccion_tarifas = $seleccionTarifas;
return $this;
}
/**
* Get seleccion_tarifas
*
* @return boolean
*/
public function getSeleccionTarifas()
{
return $this->seleccion_tarifas;
}
/**
* Add adicionales
*
* @param \App\Entity\Backend\DatoAdicional $adicionales
* @return Competicion
*/
public function addAdicionale(\App\Entity\Backend\DatoAdicional $adicionales)
{
$this->adicionales[] = $adicionales;
return $this;
}
/**
* Remove adicionales
*
* @param \App\Entity\Backend\DatoAdicional $adicionales
*/
public function removeAdicionale(\App\Entity\Backend\DatoAdicional $adicionales)
{
$this->adicionales->removeElement($adicionales);
}
/**
* Set permitir_extranjeros
*
* @param boolean $permitirExtranjeros
* @return Competicion
*/
public function setPermitirExtranjeros($permitirExtranjeros)
{
$this->permitir_extranjeros = $permitirExtranjeros;
return $this;
}
/**
* Get permitir_extranjeros
*
* @return boolean
*/
public function getPermitirExtranjeros()
{
return $this->permitir_extranjeros;
}
/**
* Set plazas_manana
*
* @param integer $plazasManana
* @return Competicion
*/
public function setPlazasManana($plazasManana)
{
$this->plazas_manana = $plazasManana;
return $this;
}
/**
* Get plazas_manana
*
* @return integer
*/
public function getPlazasManana()
{
return $this->plazas_manana;
}
/**
* Set plazas_tarde
*
* @param integer $plazasTarde
* @return Competicion
*/
public function setPlazasTarde($plazasTarde)
{
$this->plazas_tarde = $plazasTarde;
return $this;
}
/**
* Get plazas_tarde
*
* @return integer
*/
public function getPlazasTarde()
{
return $this->plazas_tarde;
}
/**
* Set tarjeta_electronica
*
* @param boolean $tarjeta_electronica
* @return Competicion
*/
public function setTarjetaElectronica($tarjeta_electronica)
{
$this->tarjeta_electronica = $tarjeta_electronica;
return $this;
}
/**
* Get tarjeta_electronica
*
* @return boolean
*/
public function getTarjetaElectronica()
{
return $this->tarjeta_electronica;
}
public function setAutoAssignMarker($auto_assign_marker)
{
$this->auto_assign_marker = $auto_assign_marker;
return $this;
}
public function getAutoAssignMarker()
{
return $this->auto_assign_marker;
}
/**
* Set codigo_contable
*
* @param string $codigoContable
* @return Competicion
*/
public function setCodigoContable($codigoContable)
{
$this->codigo_contable = $codigoContable;
return $this;
}
/**
* Get codigo_contable
*
* @return string
*/
public function getCodigoContable()
{
return $this->codigo_contable;
}
/**
* Set livescoring_comunidad
*
* @param boolean $livescoringComunidad
* @return Competicion
*/
public function setLivescoringComunidad($livescoringComunidad)
{
$this->livescoring_comunidad = $livescoringComunidad;
return $this;
}
/**
* Get livescoring_comunidad
*
* @return boolean
*/
public function getLivescoringComunidad()
{
return $this->livescoring_comunidad;
}
/**
* Get plazas_lista_espera
*
* @return integer
*/
public function getPlazasListaEspera()
{
return $this->plazas_lista_espera;
}
/**
* Set plazas_tarde
*
* @param integer $plazasListaEspera
* @return Competicion
*/
public function setPlazasListaEspera($plazasListaEspera)
{
$this->plazas_lista_espera = $plazasListaEspera;
return $this;
}
/**
* Get comites
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getNombresComites()
{
$nombres = [];
foreach ($this->comites as $comite) {
$nombres[] = $comite->getNombre();
}
return $nombres;
}
public function getDeletedAt()
{
return $this->deleted_at;
}
public function setDeletedAt($deleted_at)
{
$this->deleted_at = $deleted_at;
}
/**
* Set contacto
*
* @param string $contacto
* @return Competicion
*/
public function setContacto($contacto)
{
$this->contacto = $contacto;
return $this;
}
/**
* Get contacto
*
* @return string
*/
public function getContacto()
{
return $this->contacto;
}
/**
* Add rankings
*
* @param \App\Entity\Gestion\CompeticionRanking $rankings
* @return Competicion
*/
public function addRanking(\App\Entity\Gestion\CompeticionRanking $rankings)
{
$this->rankings[] = $rankings;
return $this;
}
/**
* Remove rankings
*
* @param \App\Entity\Gestion\CompeticionRanking $rankings
*/
public function removeRanking(\App\Entity\Gestion\CompeticionRanking $rankings)
{
$this->rankings->removeElement($rankings);
}
/**
* Get rankings
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getRankings()
{
return $this->rankings;
}
/**
* Set benefico
*
* @param boolean $benefico
* @return Competicion
*/
public function setBenefico($benefico)
{
$this->benefico = $benefico;
return $this;
}
/**
* Get benefico
*
* @return boolean
*/
public function getBenefico()
{
return $this->benefico;
}
/**
* Add vouchers
*
* @param Voucher $vouchers
* @return Competicion
*/
public function addVoucher(Voucher $vouchers)
{
$this->vouchers[] = $vouchers;
return $this;
}
/**
* Remove vouchers
*
* @param Voucher $vouchers
*/
public function removeVoucher(Voucher $vouchers)
{
$this->vouchers->removeElement($vouchers);
}
/**
* Get vouchers
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getVouchers()
{
return $this->vouchers;
}
/**
* Set flickr_gallery
*
* @param string $flickr_gallery
*/
public function setFlickrGallery($flickr_gallery)
{
$this->flickr_gallery = $flickr_gallery;
}
/**
* Get flickr_gallery
*
* @return string
*/
public function getFlickrGallery()
{
return $this->flickr_gallery;
}
/**
* Set barra_salida
*
* @param boolean $barraSalida
* @return Competicion
*/
public function setBarraSalida($barraSalida)
{
$this->barra_salida = $barraSalida;
return $this;
}
/**
* Get barra_salida
*
* @return boolean
*/
public function getBarraSalida()
{
return $this->barra_salida;
}
/**
* Set observacionesFrontend
*
* @param string $observacionesFrontend
* @return Competicion
*/
public function setObservacionesFrontend($observacionesFrontend)
{
$this->observaciones_frontend = $observacionesFrontend;
return $this;
}
/**
* Get observacionesFrontend
*
* @return string
*/
public function getObservacionesFrontend()
{
return $this->observaciones_frontend;
}
public function unlinkIfExist($file)
{
if (file_exists($file)) {
unlink($file);
}
}
public function getMostrarPlazas()
{
return $this->mostrar_plazas;
}
public function setMostrarPlazas($mostrar_plazas)
{
$this->mostrar_plazas = $mostrar_plazas;
}
/**
* Set politica_entrega
*
* @param integer $politicaEntrega
* @return Competicion
*/
public function setPoliticaEntrega($politicaEntrega)
{
$this->politica_entrega = $politicaEntrega;
return $this;
}
/**
* Get politica_entrega
*
* @return integer
*/
public function getPoliticaEntrega()
{
return $this->politica_entrega;
}
/**
* Set politica_inicio
*
* @param integer $politicaInicio
* @return Competicion
*/
public function setPoliticaInicio($politicaInicio)
{
$this->politica_inicio = $politicaInicio;
return $this;
}
/**
* Get politica_inicio
*
* @return integer
*/
public function getPoliticaInicio()
{
return $this->politica_inicio;
}
public function getShortUrl(): ?string
{
return $this->short_url;
}
public function setShortUrl(?string $short_url): self
{
$this->short_url = $short_url;
return $this;
}
public function getPrivada(): ?bool
{
return $this->privada;
}
public function setPrivada(bool $privada): self
{
$this->privada = $privada;
return $this;
}
public function getMarcadorRfc(): ?MarcadorRfc
{
return $this->marcadorRfc;
}
public function setMarcadorRfc(MarcadorRfc $marcadorRfc): self
{
// set the owning side of the relation if necessary
if ($marcadorRfc->getCompeticion() !== $this) {
$marcadorRfc->setCompeticion($this);
}
$this->marcadorRfc = $marcadorRfc;
return $this;
}
/**
* @return Collection<int, MensajeTorneo>
*/
public function getMensajeTorneos(): Collection
{
return $this->mensajeTorneos;
}
public function addMensajeTorneo(MensajeTorneo $mensajeTorneo): self
{
if (!$this->mensajeTorneos->contains($mensajeTorneo)) {
$this->mensajeTorneos[] = $mensajeTorneo;
$mensajeTorneo->setCompeticion($this);
}
return $this;
}
public function removeMensajeTorneo(MensajeTorneo $mensajeTorneo): self
{
if ($this->mensajeTorneos->removeElement($mensajeTorneo)) {
// set the owning side to null (unless already changed)
if ($mensajeTorneo->getCompeticion() === $this) {
$mensajeTorneo->setCompeticion(null);
}
}
return $this;
}
public function getRondas(): Collection
{
return $this->rondas;
}
public function getCameraUrl(): ?string
{
return $this->camera_url;
}
public function setCameraUrl(?string $camera_url): self
{
$this->camera_url = $camera_url;
return $this;
}
public function getCode(): string
{
return $this->getOrganizador()->getId() . "_" . $this->getId();
}
public function getTipoConfiguracionMatchplay()
{
return $this->tipo_configuracion_matchplay;
}
public function setTipoConfiguracionMatchplay($tipo_configuracion_matchplay): self
{
$this->tipo_configuracion_matchplay = $tipo_configuracion_matchplay;
return $this;
}
public function getLiquidationDate(): ?\DateTime
{
return $this->liquidation_date;
}
public function setLiquidationDate($liquidation_date): self
{
$this->liquidation_date = $liquidation_date;
return $this;
}
public function getCollectionDate(): ?\DateTime
{
return $this->collection_date;
}
public function setCollectionDate($collection_date): self
{
$this->collection_date = $collection_date;
return $this;
}
/**
* @return Collection<int, CompetitionSectionHidden>
*/
public function getCompetitionSectionHidden(): Collection
{
return $this->competitionSectionHidden;
}
public function addCompetitionSectionHidden(CompetitionSectionHidden $competitionSectionHidden): self
{
if (!$this->competitionSectionHidden->contains($competitionSectionHidden)) {
$this->competitionSectionHidden[] = $competitionSectionHidden;
$competitionSectionHidden->setCompetition($this);
}
return $this;
}
public function removeCompetitionSectionHidden(CompetitionSectionHidden $competitionSectionHidden): self
{
if ($this->competitionSectionHidden->removeElement($competitionSectionHidden)) {
// set the owning side to null (unless already changed)
if ($competitionSectionHidden->getCompetition() === $this) {
$competitionSectionHidden->setCompetition(null);
}
}
return $this;
}
public function getLivescoringPolicy(): string
{
return $this->livescoring_policy;
}
public function setLivescoringPolicy($livescoringPolicy): self
{
$this->livescoring_policy = $livescoringPolicy;
return $this;
}
public function isRyderCup(): bool
{
return $this->getFormula() && RYDER_CUP === $this->getFormula()->getId();
}
public function getLivescoringFormula(): string
{
return $this->livescoring_formula;
}
public function setLivescoringFormula(string $livescoring_formula): void
{
$this->livescoring_formula = $livescoring_formula;
}
public function isShowEvents(): bool
{
return $this->show_events;
}
public function setShowEvents($show_events): void
{
$this->show_events = $show_events;
}
/**
* @return Collection<int, Highlight>
*/
public function getHighlights(): Collection
{
return $this->highlights;
}
public function addHighlight(Highlight $highlight): self
{
if (!$this->highlights->contains($highlight)) {
$this->highlights[] = $highlight;
$highlight->setCompeticion($this);
}
return $this;
}
public function removeHighlight(Highlight $highlight): self
{
if ($this->highlights->removeElement($highlight)) {
// set the owning side to null (unless already changed)
if ($highlight->getCompeticion() === $this) {
$highlight->setCompeticion(null);
}
}
return $this;
}
public function getGroupsByInscribed(): array
{
if (empty($this->getInscritos())) {
return [];
}
return array_unique($this->getInscritos()->filter(function (Inscrito $inscribed) {
return !empty($inscribed->getAgrupacion());
})->map(function (Inscrito $inscribed) {
return $inscribed->getAgrupacion();
})->toArray());
}
}