protected function add(AbstractModel $model)
    {
        if (true === $this->has($model)) {
            return $this;
        }
        $this->validateAdd($model);
        if (true === $model->getState()->is('empty')) {
            $this->loaded = false;
        }

        $key = $model->getCompositeKey();
        $this->models[$key] = $model;
        $this->modelKeyMap[] = $key;

        if (false === $this->hasOriginal($model)) {
            $this->original[$key] = $model;
        }
        return $this;
    }
protected function add(AbstractModel $model)
    {
        if (true === $this->has($model)) {
            return $this;
        }
        $this->validateAdd($model);
        if (true === $model->getState()->is('empty')) {
            $this->loaded = false;
        }

        $key = $model->getCompositeKey();
        $this->models[$key] = $model;
        $this->modelKeyMap[] = $key;

        if (false === $this->hasOriginal($model)) {
            $this->original[$key] = $model;
        }
        return $this;
    }
protected function add ( AbstractModel $ model ) { if ( true === $ this -> has ( $ model ) ) { return $ this ; } $ this -> validateAdd ( $ model ) ; if ( true === $ model -> getState ( ) -> is ( 'empty' ) ) { $ this -> loaded = false ; } $ key = $ model -> getCompositeKey ( ) ; $ this -> models [ $ key ] = $ model ; $ this -> modelKeyMap [ ] = $ key ; if ( false === $ this -> hasOriginal ( $ model ) ) { $ this -> original [ $ key ] = $ model ; } return $ this ; }
Adds an model to this collection.
Is used during initial collection construction.

@param   AbstractModel   $model
@return  self
Adds an model to this collection . Is used during initial collection construction .