src/Entity/VehicleBehaviour.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Behaviour;
  4. use App\Entity\User;
  5. use App\Entity\Vehicle;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. /**
  9.  * Represent a vehicle behaviour.
  10.  *
  11.  * @ORM\Entity(repositoryClass="App\Repository\VehicleBehaviourRepository")
  12.  */
  13. class VehicleBehaviour extends Behaviour
  14. {
  15.     /**
  16.      * @ORM\ManyToOne(targetEntity="App\Entity\Vehicle", inversedBy="behaviours")
  17.      *
  18.      * @ORM\JoinColumn(name="vehicle_id", referencedColumnName="id")
  19.      */
  20.     protected $vehicle;
  21.     public function __construct(User $userVehicle $vehicle)
  22.     {
  23.         parent::__construct($user);
  24.         $this->vehicle $vehicle;
  25.     }
  26.     /**
  27.      * Return the vehicle.
  28.      *
  29.      * @return Vehicle
  30.      */
  31.     public function getVehicle()
  32.     {
  33.         return $this->vehicle;
  34.     }
  35.     /**
  36.      * Set the vehicle.
  37.      */
  38.     public function setVehicle(Vehicle $vehicle): void
  39.     {
  40.         $this->vehicle $vehicle;
  41.     }
  42. }