src/Charcoal/Model/Collection.php
public function merge($objs)
    {
        $objs = $this->asArray($objs);

        foreach ($objs as $obj) {
            if (!$this->isAcceptable($obj)) {
                throw new InvalidArgumentException(
                    sprintf(
                        'Must be an array of models, contains %s',
                        (is_object($obj) ? get_class($obj) : gettype($obj))
                    )
                );
            }

            $key = $this->modelKey($obj);
            $this->objects[$key] = $obj;
        }

        return $this;
    }
public function merge($objs)
    {
        $objs = $this->asArray($objs);

        foreach ($objs as $obj) {
            if (!$this->isAcceptable($obj)) {
                throw new InvalidArgumentException(
                    sprintf(
                        'Must be an array of models, contains %s',
                        (is_object($obj) ? get_class($obj) : gettype($obj))
                    )
                );
            }

            $key = $this->modelKey($obj);
            $this->objects[$key] = $obj;
        }

        return $this;
    }
public function merge ( $ objs ) { $ objs = $ this -> asArray ( $ objs ) ; foreach ( $ objs as $ obj ) { if ( ! $ this -> isAcceptable ( $ obj ) ) { throw new InvalidArgumentException ( sprintf ( 'Must be an array of models, contains %s' , ( is_object ( $ obj ) ? get_class ( $ obj ) : gettype ( $ obj ) ) ) ) ; } $ key = $ this -> modelKey ( $ obj ) ; $ this -> objects [ $ key ] = $ obj ; } return $ this ; }
Merge the collection with the given objects.

@param  array|Traversable $objs Array of objects to append to this collection.
@throws InvalidArgumentException If the given array contains an unacceptable value.
@return self
Merge the collection with the given objects .