Details
Description
Short: This issue is all about being able to use doctrine with naked domain objects without any use of doctrine classes.
I 'm not talking about PersistentCollection here, fully aware of that being tied into Doctrine, but those are injected, this is all about code dependency on ArrayCollection.
Seems like some of the UnitOfWork code is cable of handling other types of arrays, like:
// If $actualData[$name] is not a Collection then use an ArrayCollection.
if ( ! $actualData[$name] instanceof Collection) {
$actualData[$name] = new ArrayCollection($actualData[$name]);
}
But in __cascade* functions this is not the case in all but two:
if ($relatedEntities instanceof Collection) {
if ($relatedEntities instanceof PersistentCollection) {
// Unwrap so that foreach() does not initialize
2 however have:
if (($relatedEntities instanceof Collection || is_array($relatedEntities))) {
if ($relatedEntities instanceof PersistentCollection) {
// Unwrap so that foreach() does not initialize
Would it be an idea to do "instanceof Traversable" instead of " instanceof Collection"?
Activity
André R.
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Description |
Short: This issue is all about being able to use doctrine with naked domain objects without any use of doctrine classes. I 'm not talking about PersistentCollection here, fully aware of that being tied into Doctrine, but those are injected, this is all about code dependency on ArrayCollection. Seems like some of the UnitOfWork code is cable of handling other types of arrays, like: // If $actualData[$name] is not a Collection then use an ArrayCollection. if ( ! $actualData[$name] instanceof Collection) { $actualData[$name] = new ArrayCollection($actualData[$name]); } But in __cascade* functions this is not the case in all but two: if ($relatedEntities instanceof Collection) { if ($relatedEntities instanceof PersistentCollection) { // Unwrap so that foreach() does not initialize 2 however have: if (($relatedEntities instanceof Collection || is_array($relatedEntities))) { if ($relatedEntities instanceof PersistentCollection) { // Unwrap so that foreach() does not initialize Would it be an idea to do "instanceof Traversable" instead of " instanceof Collection"? |
Short: This issue is all about being able to use doctrine with naked domain objects without any use of doctrine classes. I 'm not talking about PersistentCollection here, fully aware of that being tied into Doctrine, but those are injected, this is all about code dependency on ArrayCollection. Seems like some of the UnitOfWork code is cable of handling other types of arrays, like: {noformat} // If $actualData[$name] is not a Collection then use an ArrayCollection. if ( ! $actualData[$name] instanceof Collection) { $actualData[$name] = new ArrayCollection($actualData[$name]); } {noformat} But in __cascade* functions this is not the case in all but two: {noformat} if ($relatedEntities instanceof Collection) { if ($relatedEntities instanceof PersistentCollection) { // Unwrap so that foreach() does not initialize {noformat} 2 however have: {noformat} if (($relatedEntities instanceof Collection || is_array($relatedEntities))) { if ($relatedEntities instanceof PersistentCollection) { // Unwrap so that foreach() does not initialize {noformat} Would it be an idea to do "instanceof Traversable" instead of " instanceof Collection"? |
André R.
made changes -
| Description |
Short: This issue is all about being able to use doctrine with naked domain objects without any use of doctrine classes. I 'm not talking about PersistentCollection here, fully aware of that being tied into Doctrine, but those are injected, this is all about code dependency on ArrayCollection. Seems like some of the UnitOfWork code is cable of handling other types of arrays, like: {noformat} // If $actualData[$name] is not a Collection then use an ArrayCollection. if ( ! $actualData[$name] instanceof Collection) { $actualData[$name] = new ArrayCollection($actualData[$name]); } {noformat} But in __cascade* functions this is not the case in all but two: {noformat} if ($relatedEntities instanceof Collection) { if ($relatedEntities instanceof PersistentCollection) { // Unwrap so that foreach() does not initialize {noformat} 2 however have: {noformat} if (($relatedEntities instanceof Collection || is_array($relatedEntities))) { if ($relatedEntities instanceof PersistentCollection) { // Unwrap so that foreach() does not initialize {noformat} Would it be an idea to do "instanceof Traversable" instead of " instanceof Collection"? |
Short: This issue is all about being able to use doctrine with naked domain objects without any use of doctrine classes. I 'm not talking about PersistentCollection here, fully aware of that being tied into Doctrine, but those are injected, this is all about code dependency on ArrayCollection. Seems like some of the UnitOfWork code is cable of handling other types of arrays, like: {noformat} // If $actualData[$name] is not a Collection then use an ArrayCollection. if ( ! $actualData[$name] instanceof Collection) { $actualData[$name] = new ArrayCollection($actualData[$name]); } {noformat} But in __cascade* functions this is not the case in all but two: {noformat} if ($relatedEntities instanceof Collection) { if ($relatedEntities instanceof PersistentCollection) { // Unwrap so that foreach() does not initialize {noformat} 2 however have: {noformat} if (($relatedEntities instanceof Collection || is_array($relatedEntities))) { if ($relatedEntities instanceof PersistentCollection) { // Unwrap so that foreach() does not initialize {noformat} Would it be an idea to do "instanceof Traversable" instead of " instanceof Collection"? |
Benjamin Eberlei
made changes -
| Fix Version/s | 2.x [ 10090 ] | |
| Fix Version/s | 2.1 [ 10022 ] |
Benjamin Eberlei
made changes -
| Workflow | jira [ 12730 ] | jira-feedback [ 13938 ] |
Benjamin Eberlei
made changes -
| Workflow | jira-feedback [ 13938 ] | jira-feedback2 [ 15802 ] |
Benjamin Eberlei
made changes -
| Workflow | jira-feedback2 [ 15802 ] | jira-feedback3 [ 18059 ] |