public function setDocument($document) { if ($document instanceof Document) { $this->document = $document; } return $this; }