Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT *
- FROM beneficiobbva.imagenes im
- LEFT JOIN beneficiobbva.imagenes_x_exppromociones impro
- ON im.id=impro.id_imagen
- where impro.id_imagen is null;
- select *
- from beneficiobbva.imagenes a
- where a.id
- NOT IN (
- SELECT id_imagen
- FROM beneficiobbva.imagenes_x_exppromociones
- );
- $imagenes = $em->createQueryBuilder()
- ->select('img')
- ->addSelect('img_pro')
- ->from('beneficiobbva.imagenes', 'img')
- ->leftjoin('beneficiobbva.imagenes_x_exppromociones', 'img_pro', 'WITH', 'img.id=img_pro.imagenes')
- ->where('img_pro.imagenes is null')
- ->getQuery()
- ->getResult();
- <?php
- namespace ROSHKABBVASitioExperienceFrontendBundleEntity;
- use DoctrineORMMapping as ORM;
- /**
- * Exppromociones
- */
- class Exppromociones
- {
- /**
- * @var integer
- */
- private $id;
- /**
- * @var string
- */
- private $nombre;
- /**
- * @var string
- */
- private $descripcion;
- /**
- * @var integer
- */
- private $puntos;
- /**
- * @var DateTime
- */
- private $fechaInicio;
- /**
- * @var DateTime
- */
- private $fechaFin;
- /**
- * @var boolean
- */
- private $enPromocion;
- /**
- * @var string
- */
- private $vigenciaDescripcion;
- /**
- * @var string
- */
- private $miniDescripcion;
- /**
- * @var integer
- */
- private $puntosOtros;
- /**
- * @var string
- */
- private $flujoCanje;
- /**
- * @var ROSHKABBVASitioExperienceFrontendBundleEntityExpCategorias
- */
- private $categoria;
- /**
- * @var ROSHKABBVASitioUniversosImagenesBundleEntityImagenes
- */
- private $banner;
- /**
- * @var ROSHKABBVASitioUniversosImagenesBundleEntityImagenes
- */
- private $imagen;
- /**
- * @var ROSHKABBVASitioExperienceFrontendBundleEntityexpcomercios
- */
- private $comercio;
- /**
- * @var string
- *
- * @ORMColumn(name="Nombre_Real", type="text")
- */
- private $nombreReal;
- /**
- * @var string
- *
- * @ORMColumn(name="Descripcion_Experience", type="text")
- */
- private $descripcionExperience;
- /**
- * @var boolean
- */
- private $destacado = false;
- /**
- * @var DoctrineCommonCollectionsCollection
- */
- private $imagenes;
- /**
- * @var DoctrineCommonCollectionsCollection
- */
- private $categorias;
- /**
- * @var DoctrineCommonCollectionsCollection
- */
- private $etiquetas;
- /**
- * @var DateTime
- */
- private $fechaFinNovedad;
- /**
- * @var integer
- */
- private $cantidadVista = 0;
- /**
- * @var integer
- */
- private $cantidadCanjeada = 0;
- /**
- * @var integer
- */
- private $valorGuaranies = 0;
- /**
- * @var integer
- */
- private $puntosTelefonico;
- /**
- * @var string
- */
- private $texto_circulo;
- /**
- * @var boolean
- */
- private $mostrarValorGuaranies;
- /**
- * Get id
- *
- * @return integer
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Set nombre
- *
- * @param string $nombre
- * @return Exppromociones
- */
- public function setNombre($nombre)
- {
- $this->nombre = $nombre;
- return $this;
- }
- /**
- * Get nombre
- *
- * @return string
- */
- public function getNombre()
- {
- return $this->nombre;
- }
- /**
- * Set descripcion
- *
- * @param string $descripcion
- * @return Exppromociones
- */
- public function setDescripcion($descripcion)
- {
- $this->descripcion = $descripcion;
- return $this;
- }
- /**
- * Get descripcion
- *
- * @return string
- */
- public function getDescripcion()
- {
- return $this->descripcion;
- }
- /**
- * Set puntos
- *
- * @param integer $puntos
- * @return Exppromociones
- */
- public function setPuntos($puntos)
- {
- $this->puntos = $puntos;
- return $this;
- }
- /**
- * Get puntos
- *
- * @return integer
- */
- public function getPuntos()
- {
- return $this->puntos;
- }
- /**
- * Set fechaInicio
- *
- * @param DateTime $fechaInicio
- * @return Exppromociones
- */
- public function setFechaInicio($fechaInicio)
- {
- $this->fechaInicio = $fechaInicio;
- return $this;
- }
- /**
- * Get fechaInicio
- *
- * @return DateTime
- */
- public function getFechaInicio()
- {
- return $this->fechaInicio;
- }
- /**
- * Set fechaFin
- *
- * @param DateTime $fechaFin
- * @return Exppromociones
- */
- public function setFechaFin($fechaFin)
- {
- $this->fechaFin = $fechaFin;
- return $this;
- }
- /**
- * Get fechaFin
- *
- * @return DateTime
- */
- public function getFechaFin()
- {
- return $this->fechaFin;
- }
- /**
- * Set enPromocion
- *
- * @param boolean $enPromocion
- * @return Exppromociones
- */
- public function setEnPromocion($enPromocion)
- {
- $this->enPromocion = $enPromocion;
- return $this;
- }
- /**
- * Get enPromocion
- *
- * @return boolean
- */
- public function getEnPromocion()
- {
- return $this->enPromocion;
- }
- /**
- * Set vigenciaDescripcion
- *
- * @param string $vigenciaDescripcion
- * @return Exppromociones
- */
- public function setVigenciaDescripcion($vigenciaDescripcion)
- {
- $this->vigenciaDescripcion = $vigenciaDescripcion;
- return $this;
- }
- /**
- * Get vigenciaDescripcion
- *
- * @return string
- */
- public function getVigenciaDescripcion()
- {
- return $this->vigenciaDescripcion;
- }
- /**
- * Set miniDescripcion
- *
- * @param string $miniDescripcion
- * @return Exppromociones
- */
- public function setMiniDescripcion($miniDescripcion)
- {
- $this->miniDescripcion = $miniDescripcion;
- return $this;
- }
- /**
- * Get miniDescripcion
- *
- * @return string
- */
- public function getMiniDescripcion()
- {
- return $this->miniDescripcion;
- }
- /**
- * Set puntosOtros
- *
- * @param integer $puntosOtros
- * @return Exppromociones
- */
- public function setPuntosOtros($puntosOtros)
- {
- $this->puntosOtros = $puntosOtros;
- return $this;
- }
- /**
- * Get puntosOtros
- *
- * @return integer
- */
- public function getPuntosOtros()
- {
- return $this->puntosOtros;
- }
- /**
- * Set flujoCanje
- *
- * @param string $flujoCanje
- * @return Exppromociones
- */
- public function setFlujoCanje($flujoCanje)
- {
- $this->flujoCanje = $flujoCanje;
- return $this;
- }
- /**
- * Get flujoCanje
- *
- * @return string
- */
- public function getFlujoCanje()
- {
- return $this->flujoCanje;
- }
- /**
- * Set categoria
- *
- * @param ROSHKABBVASitioExperienceFrontendBundleEntityExpCategorias $categoria
- * @return Exppromociones
- */
- public function setCategoria(ROSHKABBVASitioExperienceFrontendBundleEntityExpCategorias $categoria = null)
- {
- $this->categoria = $categoria;
- return $this;
- }
- /**
- * Get categoria
- *
- * @return ROSHKABBVASitioExperienceFrontendBundleEntityExpCategorias
- */
- public function getCategoria()
- {
- return $this->categoria;
- }
- /**
- * Set banner
- *
- * @param ROSHKABBVASitioUniversosImagenesBundleEntityImagenes $banner
- * @return Exppromociones
- */
- public function setBanner(ROSHKABBVASitioUniversosImagenesBundleEntityImagenes $banner = null)
- {
- $this->banner = $banner;
- return $this;
- }
- /**
- * Get banner
- *
- * @return ROSHKABBVASitioUniversosImagenesBundleEntityImagenes
- */
- public function getBanner()
- {
- return $this->banner;
- }
- /**
- * Set imagen
- *
- * @param ROSHKABBVASitioUniversosImagenesBundleEntityImagenes $imagen
- * @return Exppromociones
- */
- public function setImagen(ROSHKABBVASitioUniversosImagenesBundleEntityImagenes $imagen = null)
- {
- $this->imagen = $imagen;
- return $this;
- }
- /**
- * Get imagen
- *
- * @return ROSHKABBVASitioUniversosImagenesBundleEntityImagenes
- */
- public function getImagen()
- {
- return $this->imagen;
- }
- /**
- * Set comercio
- *
- * @param ROSHKABBVASitioExperienceFrontendBundleEntityexpcomercios $comercio
- * @return Exppromociones
- */
- public function setComercio(ROSHKABBVASitioExperienceFrontendBundleEntityexpcomercios $comercio = null)
- {
- $this->comercio = $comercio;
- return $this;
- }
- /**
- * Get comercio
- *
- * @return ROSHKABBVASitioExperienceFrontendBundleEntityexpcomercios
- */
- public function getComercio()
- {
- return $this->comercio;
- }
- /**
- * Set nombreReal
- *
- * @param string $nombreReal
- * @return ExpPromociones
- */
- public function setNombreReal($nombreReal)
- {
- $this->nombreReal = $nombreReal;
- return $this;
- }
- /**
- * Get nombreReal
- *
- * @return string
- */
- public function getNombreReal()
- {
- return $this->nombreReal;
- }
- /**
- * Set descripcionExperience
- *
- * @param string $descripcionExperience
- * @return ExpPromociones
- */
- public function setDescripcionExperience($descripcionExperience)
- {
- $this->descripcionExperience = $descripcionExperience;
- return $this;
- }
- /**
- * Get descripcionExperience
- *
- * @return string
- */
- public function getDescripcionExperience()
- {
- return $this->descripcionExperience;
- }
- /**
- * @var integer
- */
- private $orden = 0;
- /**
- * Set orden
- *
- * @param integer $orden
- * @return Exppromociones
- */
- public function setOrden($orden)
- {
- $this->orden = $orden;
- return $this;
- }
- /**
- * Get orden
- *
- * @return integer
- */
- public function getOrden()
- {
- return $this->orden;
- }
- /**
- * Determina si la promoción es un viaje genérico,
- * según las condición:
- * - $flujoCanje de la instancia debe ser igual al string 'generico', y
- * - Id de la categoría asociada debe ser igual a 2 (Viajes)
- *
- * "Opción Genérico": Es una promoción canjeable de tipo Viaje,
- * en la que el usuario puede determinar cuántos puntos utilizar.
- *
- * @return boolean
- */
- public function esOpcionGenerica()
- {
- $categorias = $this->getCategorias();
- $flujoCanje = $this->getFlujoCanje();
- $esViaje=false;
- foreach($categorias as $categoria){
- if($categoria->getId() == 2){
- $esViaje = true;
- break;
- }
- }
- // Comparar cadenas.
- // "strcasecmp: Binary safe case-insensitive string comparison".
- // retorna 0 si las cadenas son iguales, ignorando mayusculas.
- $esGenerico = strcasecmp($flujoCanje, 'generico') == 0;
- return $esViaje && $esGenerico;
- }
- /**
- * Determina si la promoción es un viaje
- * según las condición:
- * - Id de la categoría asociada debe ser igual a 2 (Viajes)
- *
- * @return boolean
- */
- public function esViaje()
- {
- $categorias = $this->getCategorias();
- $esViaje=false;
- foreach($categorias as $categoria){
- if($categoria->getId() == 2){
- $esViaje = true;
- break;
- }
- }
- return $esViaje;
- }
- /**
- * Constructor
- */
- public function __construct()
- {
- $this->imagenes = new DoctrineCommonCollectionsArrayCollection();
- $this->categorias = new DoctrineCommonCollectionsArrayCollection();
- $this->etiquetas = new DoctrineCommonCollectionsArrayCollection();
- }
- /**
- * Get imagenes
- *
- * @return DoctrineCommonCollectionsCollection
- */
- public function getImagenes()
- {
- return $this->imagenes;
- }
- /**
- * Set destacado
- *
- * @param boolean $destacado
- * @return Exppromociones
- */
- public function setDestacado($destacado)
- {
- $this->destacado = $destacado;
- return $this;
- }
- /**
- * Get destacado
- *
- * @return boolean
- */
- public function getDestacado()
- {
- return $this->destacado;
- }
- /**
- * Add categorias
- *
- * @param ROSHKABBVASitioExperienceFrontendBundleEntityExpcategorias $categorias
- * @return Exppromociones
- */
- public function addCategoria(ROSHKABBVASitioExperienceFrontendBundleEntityExpcategorias $categorias)
- {
- $this->categorias[] = $categorias;
- return $this;
- }
- /**
- * Remove categorias
- *
- * @param ROSHKABBVASitioExperienceFrontendBundleEntityExpcategorias $categorias
- */
- public function removeCategoria(ROSHKABBVASitioExperienceFrontendBundleEntityExpcategorias $categorias)
- {
- $this->categorias->removeElement($categorias);
- }
- /**
- * Get categorias
- *
- * @return DoctrineCommonCollectionsCollection
- */
- public function getCategorias()
- {
- return $this->categorias;
- }
- /**
- * Add imagenes
- *
- * @param ROSHKABBVASitioUniversosImagenesBundleEntityImagenes $imagenes
- * @return Exppromociones
- */
- public function addImagene(ROSHKABBVASitioUniversosImagenesBundleEntityImagenes $imagenes)
- {
- $this->imagenes[] = $imagenes;
- return $this;
- }
- /**
- * Remove imagenes
- *
- * @param ROSHKABBVASitioUniversosImagenesBundleEntityImagenes $imagenes
- */
- public function removeImagene(ROSHKABBVASitioUniversosImagenesBundleEntityImagenes $imagenes)
- {
- $this->imagenes->removeElement($imagenes);
- }
- /**
- * Add etiquetas
- *
- * @param ROSHKABBVASitioExperienceFrontendBundleEntityExpetiquetas $etiquetas
- * @return Exppromociones
- */
- public function addEtiqueta(ROSHKABBVASitioExperienceFrontendBundleEntityExpetiquetas $etiquetas)
- {
- $this->etiquetas[] = $etiquetas;
- return $this;
- }
- /**
- * Remove etiquetas
- *
- * @param ROSHKABBVASitioExperienceFrontendBundleEntityExpetiquetas $etiquetas
- */
- public function removeEtiqueta(ROSHKABBVASitioExperienceFrontendBundleEntityExpetiquetas $etiquetas)
- {
- $this->etiquetas->removeElement($etiquetas);
- }
- /**
- * Get etiquetas
- *
- * @return DoctrineCommonCollectionsCollection
- */
- public function getEtiquetas()
- {
- return $this->etiquetas;
- }
- /**
- * Set fechaFinNovedad
- *
- * @param DateTime $fechaFinNovedad
- * @return Exppromociones
- */
- public function setFechaFinNovedad($fechaFinNovedad)
- {
- $this->fechaFinNovedad = $fechaFinNovedad;
- return $this;
- }
- /**
- * Get fechaFinNovedad
- *
- * @return DateTime
- */
- public function getFechaFinNovedad()
- {
- return $this->fechaFinNovedad;
- }
- /**
- * Set cantidadVista
- *
- * @param integer $cantidadVista
- * @return Exppromociones
- */
- public function setCantidadVista($cantidadVista)
- {
- $this->cantidadVista = $cantidadVista;
- return $this;
- }
- /**
- * Get cantidadVista
- *
- * @return integer
- */
- public function getCantidadVista()
- {
- return $this->cantidadVista;
- }
- /**
- * Set cantidadCanjeada
- *
- * @param integer $cantidadCanjeada
- * @return Exppromociones
- */
- public function setCantidadCanjeada($cantidadCanjeada)
- {
- $this->cantidadCanjeada = $cantidadCanjeada;
- return $this;
- }
- /**
- * Get cantidadCanjeada
- *
- * @return integer
- */
- public function getCantidadCanjeada()
- {
- return $this->cantidadCanjeada;
- }
- /**
- * Set valorGuaranies
- *
- * @param integer $valorGuaranies
- * @return Exppromociones
- */
- public function setValorGuaranies($valorGuaranies)
- {
- $this->valorGuaranies = $valorGuaranies;
- return $this;
- }
- /**
- * Get valorGuaranies
- *
- * @return integer
- */
- public function getValorGuaranies()
- {
- return $this->valorGuaranies;
- }
- /**
- * Set puntosTelefonico
- *
- * @param integer $puntosTelefonico
- * @return Exppromociones
- */
- public function setPuntosTelefonico($puntosTelefonico)
- {
- $this->puntosTelefonico = $puntosTelefonico;
- return $this;
- }
- /**
- * Get puntosTelefonico
- *
- * @return integer
- */
- public function getPuntosTelefonico()
- {
- return $this->puntosTelefonico;
- }
- /**
- * Set texto_circulo
- *
- * @param string $textoCirculo
- * @return Exppromociones
- */
- public function setTextoCirculo($textoCirculo)
- {
- $this->texto_circulo = $textoCirculo;
- return $this;
- }
- /**
- * Get texto_circulo
- *
- * @return string
- */
- public function getTextoCirculo()
- {
- return $this->texto_circulo;
- }
- public function __toString()
- {
- return $this->getNombre();
- }
- /**
- * Set mostrarValorGuaranies
- *
- * @param boolean $mostrarValorGuaranies
- * @return Exppromociones
- */
- public function setMostrarValorGuaranies($mostrarValorGuaranies)
- {
- $this->mostrarValorGuaranies = $mostrarValorGuaranies;
- return $this;
- }
- /**
- * Get mostrarValorGuaranies
- *
- * @return boolean
- */
- public function getMostrarValorGuaranies()
- {
- return $this->mostrarValorGuaranies;
- }
- }
- <?php
- namespace ROSHKABBVASitioUniversosImagenesBundleEntity;
- use IphpFileStoreBundleMappingAnnotation as FileStore;
- use SymfonyComponentValidatorConstraints as Assert;
- use DoctrineORMMapping as ORM;
- /**
- * Imagenes
- *
- * @ORMTable(name="imagenes")
- * @ORMEntity
- * @FileStoreUploadable
- */
- class Imagenes
- {
- /**
- * @var integer
- *
- * @ORMColumn(name="id", type="integer")
- * @ORMId
- * @ORMGeneratedValue(strategy="AUTO")
- */
- private $id;
- /**
- * @var string
- *
- * @ORMColumn(name="Nombre", type="string", length=255)
- */
- private $nombre;
- /**
- * @var Datetime
- *
- * @ORMColumn(name="Fecha_Carga", type="date")
- */
- private $fechaCarga;
- /**
- * @ORMColumn(name="Enlace", type="array")
- * @AssertFile( maxSize="20M")
- * @FileStoreUploadableField(mapping="imagenes")
- **/
- private $enlace;
- /**
- * @var string
- *
- * @ORMColumn(name="Tipo", type="string", length=255)
- */
- private $tipo;
- /**
- * @var string
- *
- * @ORMColumn(name="Link", type="string", length=255)
- */
- private $link;
- /**
- * Get id
- *
- * @return integer
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Set nombre
- *
- * @param string $nombre
- * @return Imagenes
- */
- public function setNombre($nombre)
- {
- $this->nombre = $nombre;
- return $this;
- }
- /**
- * Get nombre
- *
- * @return string
- */
- public function getNombre()
- {
- return $this->nombre;
- }
- /**
- * Set fechaCarga
- *
- * @param DateTime $fechaCarga
- * @return Imagenes
- */
- public function setFechaCarga($fechaCarga)
- {
- $this->fechaCarga = $fechaCarga;
- return $this;
- }
- /**
- * Get fechaCarga
- *
- * @return DateTime
- */
- public function getFechaCarga()
- {
- return $this->fechaCarga;
- }
- /**
- * Set enlace
- *
- * @param array $enlace
- * @return Imagenes
- */
- public function setEnlace($enlace)
- {
- $this->enlace = $enlace;
- return $this;
- }
- /**
- * Get enlace
- *
- * @return array
- */
- public function getEnlace()
- {
- return $this->enlace;
- }
- public function __toString()
- {
- return $this->getNombre();
- }
- /**
- * Set tipo
- *
- * @param string $tipo
- * @return Imagenes
- */
- public function setTipo($tipo)
- {
- $this->tipo = $tipo;
- return $this;
- }
- /**
- * Get tipo
- *
- * @return string
- */
- public function getTipo()
- {
- return $this->tipo;
- }
- /**
- * Set link
- *
- * @param string $link
- * @return Imagenes
- */
- public function setLink($link)
- {
- $this->link = $link;
- return $this;
- }
- /**
- * Get link
- *
- * @return string
- */
- public function getLink()
- {
- return $this->link;
- }
- public function __construct(){
- $this->fechaCarga = new DateTime();
- }
- }
Add Comment
Please, Sign In to add comment