|
@@ 302-304 (lines=3) @@
|
| 299 |
|
$minOneRef = count($referencesDefinition) > 0; |
| 300 |
|
$maxOneRef = count($referencesDefinition) > 0 && ! $this->areReferencesMultivalued($referencesDefinition); |
| 301 |
|
|
| 302 |
|
if ($maxOneRef && count($entity) > 1) { |
| 303 |
|
throw new \InvalidArgumentException($this->getSelfName() . ' does not support setting references for multiple ' . $this->getCollectionName($entity) . 's'); |
| 304 |
|
} |
| 305 |
|
if ($minOneRef && count($entity) == 0) { |
| 306 |
|
throw new \InvalidArgumentException($this->getSelfName() . ' does not support setting references for no ' . $this->getCollectionName($entity) . 's'); |
| 307 |
|
} |
|
@@ 305-307 (lines=3) @@
|
| 302 |
|
if ($maxOneRef && count($entity) > 1) { |
| 303 |
|
throw new \InvalidArgumentException($this->getSelfName() . ' does not support setting references for multiple ' . $this->getCollectionName($entity) . 's'); |
| 304 |
|
} |
| 305 |
|
if ($minOneRef && count($entity) == 0) { |
| 306 |
|
throw new \InvalidArgumentException($this->getSelfName() . ' does not support setting references for no ' . $this->getCollectionName($entity) . 's'); |
| 307 |
|
} |
| 308 |
|
} |
| 309 |
|
} |
| 310 |
|
|