public function __construct(Document $document = null) { $this->document = $document; $this->relations = $document->getRelationDefinition(); }