Exemple #1
0
 /**
  * @param CollectionInterface $from
  * @param CollectionInterface $to
  *
  * @return Collection
  */
 private function getDiffs(CollectionInterface $from, CollectionInterface $to)
 {
     $modified = [];
     foreach ($from as $name => $element) {
         if ($to->has($name) && $to->get($name) !== $element) {
             $modified[$name] = new Diff($element, $to->get($name));
         }
     }
     return new Collection($modified);
 }
 /**
  * @param string $name
  *
  * @return CollectionInterface
  */
 public function additional($name = null)
 {
     return isset($name) ? $this->newElements->get($name) : $this->newElements;
 }