Core/Collection/Collection.php
public function add($data) {
        if (!array_search($data, $this->_datas, true) && is_object($data)) {
            $data = clone $data;
        }

        if (is_array($data)) {
            $this->_datas = array_merge($this->_datas, $data);
        }
        else {
            if (get_class($data) != 'Gcs\Framework\Core\Collection\Collection') {
                array_push($this->_datas, $data);
            }
            else {
                array_merge($this->_datas, $data->data());
            }
        }
    }
public function add($data) {
        if (!array_search($data, $this->_datas, true) && is_object($data)) {
            $data = clone $data;
        }

        if (is_array($data)) {
            $this->_datas = array_merge($this->_datas, $data);
        }
        else {
            if (get_class($data) != 'Gcs\Framework\Core\Collection\Collection') {
                array_push($this->_datas, $data);
            }
            else {
                array_merge($this->_datas, $data->data());
            }
        }
    }
public function add ( $ data ) { if ( ! array_search ( $ data , $ this -> _datas , true ) && is_object ( $ data ) ) { $ data = clone $ data ; } if ( is_array ( $ data ) ) { $ this -> _datas = array_merge ( $ this -> _datas , $ data ) ; } else { if ( get_class ( $ data ) != 'Gcs\Framework\Core\Collection\Collection' ) { array_push ( $ this -> _datas , $ data ) ; } else { array_merge ( $ this -> _datas , $ data -> data ( ) ) ; } } }
Add elements to the collection
@access public
@param $data mixed array[], Collection
@return void
@since 3.0
@package Gcs\Framework\Core\Collecion
Add elements to the collection