| @@ 1570-1579 (lines=10) @@ | ||
| 1567 | * |
|
| 1568 | * @return Arrayy (Immutable) |
|
| 1569 | */ |
|
| 1570 | public function mergeAppendKeepIndex(array $array = array(), $recursive = false) |
|
| 1571 | { |
|
| 1572 | if (true === $recursive) { |
|
| 1573 | $result = array_replace_recursive($this->array, $array); |
|
| 1574 | } else { |
|
| 1575 | $result = array_replace($this->array, $array); |
|
| 1576 | } |
|
| 1577 | ||
| 1578 | return static::create($result); |
|
| 1579 | } |
|
| 1580 | ||
| 1581 | /** |
|
| 1582 | * Merge the new $array into the current array. |
|
| @@ 1592-1601 (lines=10) @@ | ||
| 1589 | * |
|
| 1590 | * @return Arrayy (Immutable) |
|
| 1591 | */ |
|
| 1592 | public function mergeAppendNewIndex(array $array = array(), $recursive = false) |
|
| 1593 | { |
|
| 1594 | if (true === $recursive) { |
|
| 1595 | $result = array_merge_recursive($this->array, $array); |
|
| 1596 | } else { |
|
| 1597 | $result = array_merge($this->array, $array); |
|
| 1598 | } |
|
| 1599 | ||
| 1600 | return static::create($result); |
|
| 1601 | } |
|
| 1602 | ||
| 1603 | /** |
|
| 1604 | * Merge the the current array into the $array. |
|
| @@ 1613-1622 (lines=10) @@ | ||
| 1610 | * |
|
| 1611 | * @return Arrayy (Immutable) |
|
| 1612 | */ |
|
| 1613 | public function mergePrependKeepIndex(array $array = array(), $recursive = false) |
|
| 1614 | { |
|
| 1615 | if (true === $recursive) { |
|
| 1616 | $result = array_replace_recursive($array, $this->array); |
|
| 1617 | } else { |
|
| 1618 | $result = array_replace($array, $this->array); |
|
| 1619 | } |
|
| 1620 | ||
| 1621 | return static::create($result); |
|
| 1622 | } |
|
| 1623 | ||
| 1624 | /** |
|
| 1625 | * Merge the current array into the new $array. |
|
| @@ 1635-1644 (lines=10) @@ | ||
| 1632 | * |
|
| 1633 | * @return Arrayy (Immutable) |
|
| 1634 | */ |
|
| 1635 | public function mergePrependNewIndex(array $array = array(), $recursive = false) |
|
| 1636 | { |
|
| 1637 | if (true === $recursive) { |
|
| 1638 | $result = array_merge_recursive($array, $this->array); |
|
| 1639 | } else { |
|
| 1640 | $result = array_merge($array, $this->array); |
|
| 1641 | } |
|
| 1642 | ||
| 1643 | return static::create($result); |
|
| 1644 | } |
|
| 1645 | ||
| 1646 | /** |
|
| 1647 | * Get the min value from an array. |
|