Exam 1
Exam 1
1 2
Main Session Catch-up
Reservation
Hotel Id
1 * Date_Res
ref
Name Number of people
Address
1
*/ type="integer"
private $ref; * @ORM\Id
*/
B-/** private $ref;
* @var int
* D-/**
* @ORM@Column(name="ref", * @var int
type="integer" *
* @ORM\ref * @ORM@Column(name="ref",
*/ type="integer"
private $ref; * @ORM\Id
*
C-/** @ORM\GeneratedValue(strategy="AUT
* @var int O")
* */
* @ORM\Column(name="ref", private $ref;
8. Where are the CSS files of the project located? (Outside Program)
Under the src folder C-Under the app folder
B-Under the web folder D-Under the config folder
10. Knowing that the class 'Reservation' is linked to the class 'Hotel' by the 'ManyToOne' relationship,
What is the correct syntax to add in the Reservation entity?
A-/**
*
* @ORM\ManyToOne(targetEntity="Hotel")
* @ORM\JoinColumn(name="hotel_id", referencedColumnName="ref")
*/
private $hotel;
B-/**
*
* @ORM elationManyToOne(targetEntity="Hotel")
* @ORM\JoinColumn(name="hotel_id", referencedColumnName="id")
2
*/
private $hotel;
C-/**
*
* @ORM\x48anyToOne(targetEntity="Reservtion")
* @ORM\JoinColumn(name="reservation_id", referencedColumnName="id")
*/
private $reservation;
D-/**
*
* @ORM\ManyToOne(targetEntity="Hotel")
* @ORM\
*/
private $hotel;
12. What is the name of the class that the controller inherits from?
A-Controller C-AbstractType
B-Bundle D-FormType
13. What is the code to add a new object '$hotel' of the Hotel class to the database?
data?
14. We want to add an attribute nbrReservation that will contain the number of reservations per hotel. The
The associated column must be nbr_reservation. What should the annotation be?
* @ORM\Column(type="integer",
A-/** nullable=true, name="nbrReservation")
* @ORM\Column(type="integer", */
nullable=true, name=" nbr_reservation ") private $ nbr_reservation;
*/
private $nbrReservation; C-/**
B-/** * @ORM\Column(type="integer",
nullable=true, name=" nbr_reservation ")
3
*/ */
private $nbr_reservation; private $nbrReservation;
D-/**
* @ORM@Column(type="integer",
nullable=true, name="nbrReservation")
17. We want to display the name attribute of the Hotel object, in uppercase, in a Twig view. What is
the correct syntax?
A-{% HOTEL.NAME|UPPER %} C-{{ upper($hotel.name) }}
B-{{ upper(hotel.name) }} D-{{ hotel.name | upper }}
18. What is the code used to search for the $hotel object using DQL?
A-public function findHotelParameter($hotel)
{ $query=$this->getEntityManager()->createQuery(
select h from Hotel h where h.hotel=:hotel ->setParameter('hotel', $hotel);
return $query->getQuery()->getResult();
}
B-public function findHotelParameter()
{
$query=$this->getEntityManager()->createQuery(
select h from ExamenEspritBundle:Hotel h where h.hotel=$hotel
setParameter('hotel', $hotel); return $query->getResult();
}
C-public function findHotelParameter($hotel) {
$query=$this->getEntityManager()->createQuery("select h from
ExamenEspritBundle:Hotel h where h.ref=:hotel "->setParameter('hotel', $hotel);
return $query->getResult();}
D-None of these answers is true
19. What is the correct jQuery code to set the background color of all div tags to
out of program
A-$('div').css('background- C-$(" #div").manipulate("background
green d-color","green";
B-$("#div").css("background- D-$('div').layout('background-
green green
20. What is the result provided by this JQuery code? (Outside Program)
$("p").click(function(){$(this).css("color","red").slideUp().slideDown();}
4
Assign the red color to the p tag C-Assign an animation to the p tag
when clicking with animation one upon click
after the other D-None of these answers is true
B-Assign the color red to the p tag
when clicking with animation at the same
weather