| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 4 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | public function __construct(\SplObjectStorage $failedBeans) |
||
| 20 | { |
||
| 21 | $this->failedBeans = $failedBeans; |
||
| 22 | |||
| 23 | /* |
||
| 24 | * Building the error message by iterating the SplObjectStorage |
||
| 25 | * @var ZohoBeanInterface $bean |
||
| 26 | * @var ZohoCRMException $error |
||
| 27 | */ |
||
| 28 | foreach ($this->failedBeans as $key) { |
||
| 29 | $this->errorMessage .= "\n".'['.$this->getFailedBeans()->current()->getZohoId().'] '.$this->getFailedBeans()->getInfo()->getMessage(); |
||
| 30 | } |
||
| 31 | |||
| 32 | // Repositioning the pointer at the beginning |
||
| 33 | $this->failedBeans->rewind(); |
||
| 34 | |||
| 35 | parent::__construct($this->errorMessage); |
||
| 36 | } |
||
| 37 | |||
| 46 |