/**
  * Return fields only NOT assigned
  * to the provided stream.
  *
  * @param StreamInterface $stream
  * @return static
  */
 public function notAssignedTo(StreamInterface $stream)
 {
     $fieldSlugs = $stream->getAssignmentFieldSlugs();
     return new static(array_filter($this->items, function (FieldInterface $field) use($fieldSlugs) {
         return !in_array($field->getSlug(), $fieldSlugs);
     }));
 }
 /**
  * Return the entry model base namespace.
  *
  * @param  StreamInterface $stream
  * @return string
  */
 public function parse(StreamInterface $stream)
 {
     $string = "[";
     foreach ($stream->getAssignmentFieldSlugs() as $slug) {
         $string .= "\n'{$slug}',";
     }
     $string .= "\n]";
     return $string;
 }