18/12/2012, 15:21
|
| | Fecha de Ingreso: abril-2012
Mensajes: 25
Antigüedad: 12 años, 7 meses Puntos: 0 | |
Respuesta: Problemas con consulta symfony
Código:
<?
namespace cnt\HBBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use cnt\HBBundle\Entity\Lenguages;
use Symfony\Component\Validator\Constrainst as Assert;
/**
* @ORM\Entity(repositoryClass="cnt\HBBundle\Entity\HotelDescriptionsRepository")
* @ORM\Table(name="HOTEL_DESCRIPTIONS")
*/
class HotelDescriptions
{
/**
* @ORM\Id
* @ORM\ManyToOne(targetEntity="HOTELS", inversedBy="HOTEL_DESCRIPTIONS")
* @ORM\Column(name="HotelCode",type="string", length=8, nullable=false, unique=true)
*/
protected $hotelcode;
/**
* @ORM\Id
* @ORM\ManyToOne(targetEntity="LANGUAGES", inversedBy="HOTEL_DESCRIPTIONS")
* @ORM\Column(name="LanguageCode",type="string", length=3, nullable=false)
*/
protected $languagecode;
/**
* @ORM\Column(name="HotelFacilities",type="string", length=2000, nullable=false)
*/
protected $hotelfacilities;
/**
* @ORM\Column(name="HotelLocationDescription",type="string", length=2000, nullable=false)
*/
protected $hotellocationdescription;
/**
* @ORM\Column(name="HotelRoomDescription",type="string", length=2000, nullable=false)
*/
protected $hotelroomdescription;
/**
* @ORM\Column(name="HolelSportDescription",type="string", length=2000, nullable=false)
*/
protected $holelsportdescription;
/**
* @ORM\Column(name="HotelMealsDescription",type="string", length=2000, nullable=false)
*/
protected $hotelmealsdescription;
/**
* @ORM\Column(name="HotelPaymentMethods",type="string", length=2000, nullable=false)
*/
protected $HotelPaymentMethods;
/**
* @ORM\Column(name="HotelHowToGetThere",type="string", length=2000, nullable=false)
*/
protected $hotelhowtogetthere;
/**
* @ORM\Column(name="HotelComments",type="string", length=2000, nullable=false)
*/
protected $hotelcomments;
/**
* Set hotelcode
*
* @param string $hotelcode
* @return HotelDescriptions
*/
public function setHotelcode($hotelcode)
{
$this->hotelcode = $hotelcode;
return $this;
}
/**
* Get hotelcode
*
* @return string
*/
public function getHotelcode()
{
return $this->hotelcode;
}
/**
* Set languagecode
*
* @param string $languagecode
* @return HotelDescriptions
*/
public function setLanguagecode($languagecode)
{
$this->languagecode = $languagecode;
return $this;
}
/**
* Get languagecode
*
* @return string
*/
public function getLanguagecode()
{
return $this->languagecode;
}
/**
* Set hotelfacilities
*
* @param string $hotelfacilities
* @return HotelDescriptions
*/
public function setHotelfacilities($hotelfacilities)
{
$this->hotelfacilities = $hotelfacilities;
return $this;
}
/**
* Get hotelfacilities
*
* @return string
*/
public function getHotelfacilities()
{
return $this->hotelfacilities;
}
/**
* Set hotellocationdescription
*
* @param string $hotellocationdescription
* @return HotelDescriptions
*/
public function setHotellocationdescription($hotellocationdescription)
{
$this->hotellocationdescription = $hotellocationdescription;
return $this;
}
/**
* Get hotellocationdescription
*
* @return string
*/
public function getHotellocationdescription()
{
return $this->hotellocationdescription;
}
/**
* Set hotelroomdescription
*
* @param string $hotelroomdescription
* @return HotelDescriptions
*/
public function setHotelroomdescription($hotelroomdescription)
{
$this->hotelroomdescription = $hotelroomdescription;
return $this;
}
/**
* Get hotelroomdescription
*
* @return string
*/
public function getHotelroomdescription()
{
return $this->hotelroomdescription;
}
/**
* Set holelsportdescription
*
* @param string $holelsportdescription
* @return HotelDescriptions
*/
public function setHolelsportdescription($holelsportdescription)
{
$this->holelsportdescription = $holelsportdescription;
return $this;
}
/**
* Get holelsportdescription
*
* @return string
*/
public function getHolelsportdescription()
{
return $this->holelsportdescription;
}
/**
* Set hotelmealsdescription
*
* @param string $hotelmealsdescription
* @return HotelDescriptions
*/
public function setHotelmealsdescription($hotelmealsdescription)
{
$this->hotelmealsdescription = $hotelmealsdescription;
return $this;
}
/**
* Get hotelmealsdescription
*
* @return string
*/
public function getHotelmealsdescription()
{
return $this->hotelmealsdescription;
}
/**
* Set HotelPaymentMethods
*
* @param string $hotelPaymentMethods
* @return HotelDescriptions
*/
public function setHotelPaymentMethods($hotelPaymentMethods)
{
$this->HotelPaymentMethods = $hotelPaymentMethods;
return $this;
}
/**
* Get HotelPaymentMethods
*
* @return string
*/
public function getHotelPaymentMethods()
{
return $this->HotelPaymentMethods;
}
/**
* Set hotelhowtogetthere
*
* @param string $hotelhowtogetthere
* @return HotelDescriptions
*/
public function setHotelhowtogetthere($hotelhowtogetthere)
{
$this->hotelhowtogetthere = $hotelhowtogetthere;
return $this;
}
/**
* Get hotelhowtogetthere
*
* @return string
*/
public function getHotelhowtogetthere()
{
return $this->hotelhowtogetthere;
}
/**
* Set hotelcomments
*
* @param string $hotelcomments
* @return HotelDescriptions
*/
public function setHotelcomments($hotelcomments)
{
$this->hotelcomments = $hotelcomments;
return $this;
}
/**
* Get hotelcomments
*
* @return string
*/
public function getHotelcomments()
{
return $this->hotelcomments;
}
}
y nuevamente inteto realizar mi dql, con la misma función:
Código:
public function findByname($params){
$name= $params['name'];
$language= $params['language'];
$em = $this->getEntityManager();
$query = $em->createQuery(' SELECT h, d
FROM cntHBBundle:Hotels h
JOIN h.HotelDescriptions d
WHERE h.hotelcode = :id
AND d.languagecode= :language
');
$query->setParameter('id',$name);
$query->setParameter('language',$language);
$query->setMaxResults(1);
$names = $query->getResult();
return $names;
:S! y me sigue saliendo error:
[Semantical Error] line 0, col 168 near 'd': Error: Class cnt\HBBundle\Entity\Hotels has no association named HotelDescriptions
:( |