Exemplo n.º 1
0
 public function unbind($value) : Data
 {
     Assertion::isArray($value);
     $data = Data::none();
     foreach ($value as $index => $individualValue) {
         $data = $data->merge($this->wrappedMapping->withPrefixAndRelativeKey($this->key, (string) $index)->unbind($individualValue));
     }
     return $data;
 }
Exemplo n.º 2
0
 public function withMapping(string $key, MappingInterface $mapping) : self
 {
     $clone = clone $this;
     $clone->mappings[$key] = $mapping->withPrefixAndRelativeKey($clone->key, $key);
     return $clone;
 }