C5-8.4* Doctrine returns some values, and doesn't return others
Permalink
Here's how car model and associated car category ID columns are created:
I can get the car model in the view as
but I can't get the car category ID as
Why not? What's so different about the getCategoryID?
/** * @ORM\Column(type="string") */ protected $model; public function setModel($model) { $this->model = $model; } public function getModel() { return $this->model; } /** * Many Cars have One Category * @ORM\ManyToOne(targetEntity="Car\CarCategory")
Viewing 15 lines of 26 lines. View entire code block.
I can get the car model in the view as
<?php echo $car->getModel(); ?>
but I can't get the car category ID as
<?php echo $car->getCategoryID(); ?>
Why not? What's so different about the getCategoryID?
It turns out the $car->getCategoryID() returns only an object of the referenced category, to get the ID you actually have to ask again:
Anyone find working with Doctrine fun? )))