/**
  * Return parent object
  *
  * @param void
  * @return ApplicationObject
  */
 function &getParent()
 {
     if ($this->parent === false) {
         if (strtolower($this->getParentType()) == 'document') {
             $this->parent = $this->getParentId() ? Documents::findById($this->getParentId()) : null;
         } else {
             $this->parent = $this->getParentId() ? ProjectObjects::findById($this->getParentId()) : null;
         }
         // if
     }
     // if
     return $this->parent;
 }
 /**
  * Constructor method
  *
  * @param string $request
  * @return DocumentsController
  */
 function __construct($request)
 {
     parent::__construct($request);
     $document_id = $this->request->getId('document_id');
     if ($document_id) {
         $this->active_document = Documents::findById($document_id);
     }
     // if
     if (instance_of($this->active_document, 'Document')) {
         $this->wireframe->addBreadCrumb($this->active_document->getName(), $this->active_document->getViewUrl());
     } else {
         $this->active_document = new Document();
     }
     // if
     $this->wireframe->current_menu_item = 'documents';
     $this->smarty->assign(array('active_document' => $this->active_document));
 }