Inherit

Inherit from Document(s).

Description

$this Document::inherit(Document $parent [, int $mode = Document::INHERIT_CONFIG])

Parameters

Modes

| Mode Constant | Mode Description | |-------------------------|----------------------------------------------------------------------------------| | INHERITCONFIG | Inherit only config. | | INHERITCONTENTREPLACE | Inherit only content. Replaces current content with that form parent document. | | INHERITCONTENTAPPEND | Inherit only content. Prepends content from parent document to current document. | | INHERITALLREPLACE | Inherit both config and content. Same as `INHERITCONTENTREPLACE` | | INHERITALLAPPEND | Inherit both config and content. Same as `INHERITCONTENT_APPEND` |

Return Value

Usage

$parent = new Document('Lorem Ipsum dol sidur.....', ['title'=> 'Not A Random Title', 'layout' => 'grid']);
$document = new Document('Lorem Ipsum.....', ['title'=> 'Random Title', 'category' => 'just another category']);

$document->inherit($parent);

$document->getConfig();
//['title'=> 'Random Title', 'layout'=> 'grid', 'category' => 'just another category']