public function all($array = [])
    {
        if (!empty($array)) {
            foreach ($array as $key => $model) {
                $this->set($model, is_numeric($key) ? null : $key);
            }
        }

        return $this->byAlias;
    }
public function all($array = [])
    {
        if (!empty($array)) {
            foreach ($array as $key => $model) {
                $this->set($model, is_numeric($key) ? null : $key);
            }
        }

        return $this->byAlias;
    }
public function all ( $ array = [ ] ) { if ( ! empty ( $ array ) ) { foreach ( $ array as $ key => $ model ) { $ this -> set ( $ model , is_numeric ( $ key ) ? null : $ key ) ; } } return $ this -> byAlias ; }
Returns all options
If array passed, becomes bag content

@param array $array overwrites values

@return ModelInterface[]
Returns all options If array passed becomes bag content