public function paste($after, $value, $key = null) 
    {
        //Argument test
        Eden_Array_Argument::i()
            //Argument 1 must be a scalar
            ->test(1, 'scalar')                
            //Argument 3 must be a scalar or null
            ->test(3, 'scalar', 'null');    

        $list = array();
        //for each row
        foreach ($this->data as $i => $val) {
            //add this row back to the list
            $list[$i] = $val;

            //if this is not the key we are
            //suppose to paste after 
            if ($after != $i) {
                //do nothing more
                continue;
            }

            //if there was a key involved
            if (!is_null($key)) {
                //lets add the new value
                $list[$key] = $value;
                continue;
            }

            //lets add the new value
            $list[] = $arrayValue;
        }

        //if there was no key involved
        if (is_null($key)) {
            //reindex the array
            $list = array_values($list);
        }

        //give it back
        $this->data = $list;

        return $this;
    }
public function paste($after, $value, $key = null) 
    {
        //Argument test
        Eden_Array_Argument::i()
            //Argument 1 must be a scalar
            ->test(1, 'scalar')                
            //Argument 3 must be a scalar or null
            ->test(3, 'scalar', 'null');    

        $list = array();
        //for each row
        foreach ($this->data as $i => $val) {
            //add this row back to the list
            $list[$i] = $val;

            //if this is not the key we are
            //suppose to paste after 
            if ($after != $i) {
                //do nothing more
                continue;
            }

            //if there was a key involved
            if (!is_null($key)) {
                //lets add the new value
                $list[$key] = $value;
                continue;
            }

            //lets add the new value
            $list[] = $arrayValue;
        }

        //if there was no key involved
        if (is_null($key)) {
            //reindex the array
            $list = array_values($list);
        }

        //give it back
        $this->data = $list;

        return $this;
    }
public function paste ( $ after , $ value , $ key = null ) { //Argument test Eden_Array_Argument :: i ( ) //Argument 1 must be a scalar -> test ( 1 , 'scalar' ) //Argument 3 must be a scalar or null -> test ( 3 , 'scalar' , 'null' ) ; $ list = array ( ) ; //for each row foreach ( $ this -> data as $ i => $ val ) { //add this row back to the list $ list [ $ i ] = $ val ; //if this is not the key we are //suppose to paste after  if ( $ after != $ i ) { //do nothing more continue ; } //if there was a key involved if ( ! is_null ( $ key ) ) { //lets add the new value $ list [ $ key ] = $ value ; continue ; } //lets add the new value $ list [ ] = $ arrayValue ; } //if there was no key involved if ( is_null ( $ key ) ) { //reindex the array $ list = array_values ( $ list ) ; } //give it back $ this -> data = $ list ; return $ this ; }
Inserts a row in an array after the given index and adjusts all the indexes

@param *scalar $after the key we are looking for to past after
@param *mixed  $value the value to paste
@param scalar  $key   the key to paste along with the value

@return Eden_Array_Index
Inserts a row in an array after the given index and adjusts all the indexes