Example #1
0
 /**
  * Extended to also rollback changes of has-many collections.
  *
  * {@inheritDoc}
  */
 public function rollback()
 {
     parent::rollback();
     foreach ($this->getOriginalAll() as $collection) {
         if ($collection instanceof EmbedCollection) {
             $collection->rollback();
         }
     }
     return $this;
 }
Example #2
0
 /**
  * Constructor.
  *
  * @param   Embed[]   $original   Any original properties to apply.
  */
 public function __construct(array $original = [])
 {
     foreach ($original as $key => $embed) {
         if (!$embed instanceof Embed) {
             continue;
         }
         $this->current[$key] = clone $embed;
     }
     parent::__construct($original);
 }