Illuminate\Support\Collection::offsetSet PHP Метод

offsetSet() публичный Метод

Set the item at a given offset.
public offsetSet ( mixed $key, mixed $value ) : void
$key mixed
$value mixed
Результат void
    public function offsetSet($key, $value)
    {
        if (is_null($key)) {
            $this->items[] = $value;
        } else {
            $this->items[$key] = $value;
        }
    }

Usage Example

Пример #1
0
 public function getFiels()
 {
     $values = new Collection();
     foreach ($this->seoModel->getFillable() as $fill) {
         if (!in_array($fill, ['document_id', 'document_type'])) {
             $values->offsetSet($fill, null);
         }
     }
     return $values;
 }
All Usage Examples Of Illuminate\Support\Collection::offsetSet