/** * Load Document type data * * @return string */ public function createDocumentType() { $documentTypesCollection = new DocumentType\Collection(); $array = $documentTypesCollection->getDocumentTypes(); if (empty($array)) { return ''; } foreach ($documentTypesCollection->getDocumentTypes() as $documentType) { //Preload dependencies $children = array(); $dependencies = $documentType->getDependencies(); foreach ($dependencies as $dependency) { $children[] = array('id' => $dependency); } $documentType->setData('dependencies', $children); //Preload available views $children = array(); $availableViews = $documentType->getAvailableViews()->getViews(); foreach ($availableViews as $view) { $children[] = array('id' => $view->getId()); } $documentType->setData('available_views', $children); foreach ($documentType->getTabs() as $tab) { //Preload Tabs foreach ($tab->getProperties() as $property) { //Preload Properties } } } return $documentTypesCollection->toXml($documentTypesCollection->getDocumentTypes(), 'document_types'); }
/** * List all document types * * @return \Zend\View\Model\ViewModel|array */ public function indexAction() { $documents = new DocumentType\Collection(); return array('documents' => $documents->getDocumentTypes()); }
/** * Test * * @return void */ public function testInit() { $this->object->init($this->documentType->getId()); $this->assertInternalType('array', $this->object->getDocumentTypes()); }