8.4.3 Doctrine objects not array
Permalink
I have a table with prices which I reference from another table:
but when I try to get the prices, the returned value is not an array:
and so no array is returned. Why is it not an array of objects?
If it's not an array of objects, how can I count the number of entries/rows?
/** * One Product has many Price Rules * @ORM\OneToMany(targetEntity="Store\Product\ProductPrice",mappedBy="product",cascade={"persist"})) */ protected $prices; public function getPrices() { return $this->prices; } public function __construct() { $this->prices = new ArrayCollection(); }
but when I try to get the prices, the returned value is not an array:
and so no array is returned. Why is it not an array of objects?
If it's not an array of objects, how can I count the number of entries/rows?