undefinedPropertyHandler = function( $class, $propName, $jsonValue ){ if( $class instanceof Style ){ $class->{$propName} = $jsonValue; } }; $documentObject = isset( $dataObject->document ) ? $dataObject->document : $dataObject; $this->document = $mapper->map( $documentObject, new Document() ); if( $documentId ){ $this->document->setDocumentID( $documentId ); } return $this; } /** * Retrieves the mapped Document object * * @return Document */ public function get() { return $this->document; } /** * @return string */ public function render() { return $this->get()->render(); } }