public function replaceAll($stack, $resetBodyKey = true)
    {
        if (! $stack instanceof DataCollection) {
            $stack = new DataCollection($stack);
        }

        $this->stack = $stack;

        if ($resetBodyKey) {
            $this->bodyKey = null;

            foreach ($stack as $key => $view) {
                if ($view->getType() === View::PART_BODY_PLACEHOLDER) {
                    $this->bodyKey = $key;
                }
            }
        }
    }
public function replaceAll($stack, $resetBodyKey = true)
    {
        if (! $stack instanceof DataCollection) {
            $stack = new DataCollection($stack);
        }

        $this->stack = $stack;

        if ($resetBodyKey) {
            $this->bodyKey = null;

            foreach ($stack as $key => $view) {
                if ($view->getType() === View::PART_BODY_PLACEHOLDER) {
                    $this->bodyKey = $key;
                }
            }
        }
    }
public function replaceAll ( $ stack , $ resetBodyKey = true ) { if ( ! $ stack instanceof DataCollection ) { $ stack = new DataCollection ( $ stack ) ; } $ this -> stack = $ stack ; if ( $ resetBodyKey ) { $ this -> bodyKey = null ; foreach ( $ stack as $ key => $ view ) { if ( $ view -> getType ( ) === View :: PART_BODY_PLACEHOLDER ) { $ this -> bodyKey = $ key ; } } } }
Replace all stack items for the array given

@param array|DataCollection $stack
@param bool $resetBodyKey Reset the body placeholder. Will reindex the new stack for it.
Replace all stack items for the array given