src/Doctrine/ORM/Entities/BaseEntity.php 1 location
|
@@ 236-242 (lines=7) @@
|
233 |
|
} |
234 |
|
$array[$key] = $this->$key->format($dateFormat); |
235 |
|
} |
236 |
|
} elseif ($this->$key instanceof ArrayCollection || $this->$key instanceof PersistentCollection) { |
237 |
|
$ids = []; |
238 |
|
foreach ($this->$key->getValues() as $item) { |
239 |
|
$ids[] = $item->getId(); |
240 |
|
} |
241 |
|
$array[$key] = $ids; |
242 |
|
} else { |
243 |
|
$array[$key] = $this->$key->getId(); |
244 |
|
} |
245 |
|
} else { |
src/Doctrine/ODM/MongoDB/Entities/BaseEntity.php 1 location
|
@@ 256-262 (lines=7) @@
|
253 |
|
|
254 |
|
$array[$key] = $this->$key->format($dateFormat); |
255 |
|
} |
256 |
|
} elseif (is_object($this->$key) && $this->$key instanceof ArrayCollection || $this->$key instanceof PersistentCollection) { |
257 |
|
$ids = []; |
258 |
|
foreach ($this->$key->getValues() as $item) { |
259 |
|
$ids[] = $item->getId(); |
260 |
|
} |
261 |
|
$array[$key] = $ids; |
262 |
|
} elseif (method_exists($this->$key, 'getId')) { |
263 |
|
$array[$key] = $this->$key->getId(); |
264 |
|
} else { |
265 |
|
$array[$key] = $this->$key; |